Documentation ¶
Index ¶
- Constants
- func DeploymentAddress(account []byte, nonce uint64) []byte
- func DeploymentGroupID(daddr []byte, gseq uint64) []byte
- func FulfillmentID(daddr []byte, gseq uint64, oseq uint64, paddr []byte) []byte
- func GetMaxEndRange64() base.Bytes
- func GetMinStartRange() base.Bytes
- func IDForLease(obj *types.Lease) []byte
- func LeaseID(daddr []byte, gseq uint64, oseq uint64, paddr []byte) []byte
- func MaxAddress() []byte
- func MinAddress() []byte
- func NonceAddress(account []byte, nonce uint64) []byte
- func OrderID(daddr []byte, gseq uint64, oseq uint64) []byte
- func ProviderAddress(account []byte, nonce uint64) []byte
- type AccountAdapter
- 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 )
Variables ¶
This section is empty.
Functions ¶
func DeploymentAddress ¶
func DeploymentGroupID ¶
{deployment-address}{group-sequence-id}
func FulfillmentID ¶
{deployment-address}{group-sequence-id}{order-sequence-id}{provider-address}
AKA: OrderID(daddr,gseq,oseq) + provider-address
func GetMaxEndRange64 ¶
func GetMinStartRange ¶
func IDForLease ¶
func LeaseID ¶
{deployment-address}{group-sequence-id}{order-sequence-id}{provider-address}
AKA: FulfillmentID(daddr,gseq,oseq)
func MaxAddress ¶
func MaxAddress() []byte
func MinAddress ¶
func MinAddress() []byte
func NonceAddress ¶
func OrderID ¶
{deployment-address}{group-sequence-id}{order-sequence-id}
AKA: DeploymentGroupID(daddr,gseq) + oseq
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(db DB) AccountAdapter
type DB ¶
type DeploymentAdapter ¶
type DeploymentAdapter interface { Save(deployment *types.Deployment) error Get(base.Bytes) (*types.Deployment, error) GetMaxRange() (*types.Deployments, error) GetRangeWithProof(base.Bytes, base.Bytes, int) ([][]byte, *types.Deployments, iavl.KeyRangeProof, error) KeyFor(base.Bytes) base.Bytes SequenceFor(base.Bytes) Sequence }
func NewDeploymentAdapter ¶
func NewDeploymentAdapter(db DB) DeploymentAdapter
type DeploymentGroupAdapter ¶
type DeploymentGroupAdapter interface { Save(*types.DeploymentGroup) error Get(addr base.Bytes, seq uint64) (*types.DeploymentGroup, error) GetByKey(addr base.Bytes) (*types.DeploymentGroup, error) ForDeployment(addr base.Bytes) ([]*types.DeploymentGroup, error) KeyFor(base.Bytes) base.Bytes }
func NewDeploymentGroupAdapter ¶
func NewDeploymentGroupAdapter(db DB) DeploymentGroupAdapter
type FulfillmentAdapter ¶
type FulfillmentAdapter interface { Save(*types.Fulfillment) error Get(daddr base.Bytes, group uint64, order uint64, paddr base.Bytes) (*types.Fulfillment, error) GetByKey(address base.Bytes) (*types.Fulfillment, error) ForGroup(*types.DeploymentGroup) ([]*types.Fulfillment, error) ForOrder(*types.Order) ([]*types.Fulfillment, error) IDFor(*types.Fulfillment) []byte KeyFor(id []byte) []byte }
func NewFulfillmentAdapter ¶
func NewFulfillmentAdapter(db DB) FulfillmentAdapter
type LeaseAdapter ¶
type LeaseAdapter interface { Save(*types.Lease) error Get(daddr base.Bytes, group uint64, order uint64, paddr base.Bytes) (*types.Lease, error) GetByKey(address base.Bytes) (*types.Lease, error) IDFor(obj *types.Lease) []byte KeyFor(id []byte) []byte All() ([]*types.Lease, error) }
func NewLeaseAdapter ¶
func NewLeaseAdapter(db DB) LeaseAdapter
type OrderAdapter ¶
type OrderAdapter interface { Save(*types.Order) error GetByKey(base.Bytes) (*types.Order, error) Get(addr base.Bytes, group uint64, order uint64) (*types.Order, error) ForGroup(*types.DeploymentGroup) ([]*types.Order, error) All() ([]*types.Order, error) KeyFor(base.Bytes) base.Bytes }
func NewOrderAdapter ¶
func NewOrderAdapter(db DB) OrderAdapter
type ProviderAdapter ¶
type ProviderAdapter interface { Save(provider *types.Provider) error Get(base.Bytes) (*types.Provider, error) GetMaxRange() (*types.Providers, error) GetRangeWithProof(base.Bytes, base.Bytes, int) ([][]byte, *types.Providers, iavl.KeyRangeProof, error) KeyFor(base.Bytes) base.Bytes }
func NewProviderAdapter ¶
func NewProviderAdapter(db DB) ProviderAdapter
type Sequence ¶
func NewSequence ¶
type State ¶
type State interface { Version() int64 Hash() []byte Commit() ([]byte, int64, error) DB() DBReader Account() AccountAdapter Deployment() DeploymentAdapter Provider() ProviderAdapter Order() OrderAdapter DeploymentGroup() DeploymentGroupAdapter Fulfillment() FulfillmentAdapter Lease() LeaseAdapter }
Click to show internal directories.
Click to hide internal directories.