forked from akash-network/provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reservation.go
39 lines (30 loc) · 964 Bytes
/
reservation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package cluster
import (
ctypes "github.com/akash-network/provider/cluster/types/v1beta2"
"github.com/akash-network/provider/cluster/util"
atypes "github.com/akash-network/node/types/v1beta2"
mtypes "github.com/akash-network/node/x/market/types/v1beta2"
)
func newReservation(order mtypes.OrderID, resources atypes.ResourceGroup) *reservation {
return &reservation{
order: order,
resources: resources,
endpointQuantity: util.GetEndpointQuantityOfResourceGroup(resources, atypes.Endpoint_LEASED_IP)}
}
type reservation struct {
order mtypes.OrderID
resources atypes.ResourceGroup
allocated bool
endpointQuantity uint
ipsConfirmed bool
}
var _ ctypes.Reservation = (*reservation)(nil)
func (r *reservation) OrderID() mtypes.OrderID {
return r.order
}
func (r *reservation) Resources() atypes.ResourceGroup {
return r.resources
}
func (r *reservation) Allocated() bool {
return r.allocated
}