Documentation
¶
Index ¶
- Constants
- func DeploymentAddress(account []byte, nonce uint64) []byte
- func LoadState(db DB, gen *types.Genesis) (CommitState, CacheState, error)
- func MaxAddress() []byte
- func MinAddress() []byte
- func NonceAddress(account []byte, nonce uint64) []byte
- func ProviderAddress(account []byte, nonce uint64) []byte
- type AccountAdapter
- type CacheState
- type CommitState
- type DB
- type DBReader
- type DeploymentAdapter
- type DeploymentGroupAdapter
- type FulfillmentAdapter
- type LeaseAdapter
- type OrderAdapter
- type ProviderAdapter
- type Sequence
- type State
Constants ¶
View Source
const ( AccountPath = "/accounts/" DeploymentPath = "/deployments/" DeploymentSequencePath = "/deployments-seq/" DeploymentGroupPath = "/deployment-groups/" ProviderPath = "/providers/" OrderPath = "/orders/" FulfillmentPath = "/fulfillment-orders/" LeasePath = "/lease/" MaxRangeLimit = math.MaxInt64 AddressSize = 32 // XXX: check )
Variables ¶
This section is empty.
Functions ¶
func DeploymentAddress ¶
func LoadState ¶
func LoadState(db DB, gen *types.Genesis) (CommitState, CacheState, error)
func MaxAddress ¶
func MaxAddress() []byte
func MinAddress ¶
func MinAddress() []byte
func NonceAddress ¶
func ProviderAddress ¶
Types ¶
type AccountAdapter ¶
type AccountAdapter interface {
Save(account *types.Account) error
Get(base.Bytes) (*types.Account, error)
KeyFor(base.Bytes) base.Bytes
}
func NewAccountAdapter ¶
func NewAccountAdapter(state State) AccountAdapter
type CacheState ¶ added in v0.0.9
func NewCache ¶ added in v0.0.9
func NewCache(db DB) CacheState
type CommitState ¶ added in v0.0.9
type CommitState interface {
Version() int64
Hash() []byte
Commit() ([]byte, int64, error)
Get(key []byte) []byte
GetRange([]byte, []byte, int) ([][]byte, [][]byte, error)
Set(key, val []byte)
Remove(key []byte)
Account() AccountAdapter
Deployment() DeploymentAdapter
Provider() ProviderAdapter
Order() OrderAdapter
DeploymentGroup() DeploymentGroupAdapter
Fulfillment() FulfillmentAdapter
Lease() LeaseAdapter
}
func NewState ¶
func NewState(db DB) CommitState
type DB ¶
type DeploymentAdapter ¶
type DeploymentAdapter interface {
Save(deployment *types.Deployment) error
Get(base.Bytes) (*types.Deployment, error)
GetMaxRange() (*types.Deployments, error)
KeyFor(base.Bytes) base.Bytes
SequenceFor(base.Bytes) Sequence
}
func NewDeploymentAdapter ¶
func NewDeploymentAdapter(state State) DeploymentAdapter
type DeploymentGroupAdapter ¶
type DeploymentGroupAdapter interface {
Save(*types.DeploymentGroup) error
Get(id types.DeploymentGroupID) (*types.DeploymentGroup, error)
All() ([]*types.DeploymentGroup, error)
ForDeployment(addr base.Bytes) ([]*types.DeploymentGroup, error)
}
func NewDeploymentGroupAdapter ¶
func NewDeploymentGroupAdapter(state State) DeploymentGroupAdapter
type FulfillmentAdapter ¶
type FulfillmentAdapter interface {
Save(*types.Fulfillment) error
Get(id types.FulfillmentID) (*types.Fulfillment, error)
ForDeployment(base.Bytes) ([]*types.Fulfillment, error)
ForGroup(types.DeploymentGroupID) ([]*types.Fulfillment, error)
ForOrder(types.OrderID) ([]*types.Fulfillment, error)
All() ([]*types.Fulfillment, error)
}
func NewFulfillmentAdapter ¶
func NewFulfillmentAdapter(state State) FulfillmentAdapter
type LeaseAdapter ¶
type LeaseAdapter interface {
Save(*types.Lease) error
Get(types.LeaseID) (*types.Lease, error)
ForDeployment(deployment base.Bytes) ([]*types.Lease, error)
All() ([]*types.Lease, error)
}
func NewLeaseAdapter ¶
func NewLeaseAdapter(state State) LeaseAdapter
type OrderAdapter ¶
type OrderAdapter interface {
Save(*types.Order) error
Get(types.OrderID) (*types.Order, error)
ForDeployment(base.Bytes) ([]*types.Order, error)
ForGroup(types.DeploymentGroupID) ([]*types.Order, error)
All() ([]*types.Order, error)
}
func NewOrderAdapter ¶
func NewOrderAdapter(state State) OrderAdapter
type ProviderAdapter ¶
type ProviderAdapter interface {
Save(provider *types.Provider) error
Get(base.Bytes) (*types.Provider, error)
GetMaxRange() (*types.Providers, error)
GetRange(base.Bytes, base.Bytes, int) ([][]byte, *types.Providers, error)
KeyFor(base.Bytes) base.Bytes
}
func NewProviderAdapter ¶
func NewProviderAdapter(state State) ProviderAdapter
type Sequence ¶
func NewSequence ¶
type State ¶
type State interface {
Get(key []byte) []byte
Set(key, val []byte)
Remove(key []byte)
GetRange([]byte, []byte, int) ([][]byte, [][]byte, error)
Version() int64
Account() AccountAdapter
Deployment() DeploymentAdapter
Provider() ProviderAdapter
Order() OrderAdapter
DeploymentGroup() DeploymentGroupAdapter
Fulfillment() FulfillmentAdapter
Lease() LeaseAdapter
}
Click to show internal directories.
Click to hide internal directories.