Documentation ¶
Index ¶
- Constants
- Variables
- func ActivePlanKey(id uint64) []byte
- func GetPlanForNodeByProviderKeyPrefix(nodeAddr base.NodeAddress, provAddr base.ProvAddress) []byte
- func GetPlanForNodeKeyPrefix(addr base.NodeAddress) []byte
- func GetPlanForProviderKeyPrefix(addr base.ProvAddress) []byte
- func IDFromPlanForNodeByProviderKey(key []byte) uint64
- func IDFromPlanForProviderKey(key []byte) uint64
- func InactivePlanKey(id uint64) []byte
- func NewErrorDuplicateNodeForPlan(id uint64, addr base.NodeAddress) error
- func NewErrorInvalidNodeStatus(addr base.NodeAddress, status v1base.Status) error
- func NewErrorLeaseForNodeByProviderNotFound(nodeAddr base.NodeAddress, provAddr base.ProvAddress) error
- func NewErrorLeaseNotFound(id uint64) error
- func NewErrorNodeForPlanNotFound(id uint64, addr base.NodeAddress) error
- func NewErrorNodeNotFound(addr base.NodeAddress) error
- func NewErrorPlanNotFound(id uint64) error
- func NewErrorProviderNotFound(addr base.ProvAddress) error
- func NewErrorUnauthorized(addr string) error
- func PlanForNodeByProviderKey(nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64) []byte
- func PlanForProviderKey(addr base.ProvAddress, id uint64) []byte
Constants ¶
const (
ModuleName = "plan"
)
Variables ¶
var ( ErrInvalidMessage = sdkerrors.Register(ModuleName, 101, "invalid message") ErrDuplicateNodeForPlan = sdkerrors.Register(ModuleName, 201, "duplicate node for plan") ErrInvalidNodeStatus = sdkerrors.Register(ModuleName, 202, "invalid node status") ErrLeaseForNodeByProviderNotFound = sdkerrors.Register(ModuleName, 203, "lease for node by provider not found") ErrLeaseNotFound = sdkerrors.Register(ModuleName, 204, "lease not found") ErrNodeForPlanNotFound = sdkerrors.Register(ModuleName, 205, "node for plan not found") ErrNodeNotFound = sdkerrors.Register(ModuleName, 206, "node not found") ErrPlanNotFound = sdkerrors.Register(ModuleName, 207, "plan not found") ErrProviderNotFound = sdkerrors.Register(ModuleName, 208, "provider not found") )
var ( CountKey = []byte{0x00} PlanKeyPrefix = []byte{0x10} ActivePlanKeyPrefix = append(PlanKeyPrefix, 0x01) InactivePlanKeyPrefix = append(PlanKeyPrefix, 0x02) PlanForNodeKeyPrefix = []byte{0x11} PlanForProviderKeyPrefix = []byte{0x12} )
Functions ¶
func ActivePlanKey ¶
func GetPlanForNodeByProviderKeyPrefix ¶
func GetPlanForNodeByProviderKeyPrefix(nodeAddr base.NodeAddress, provAddr base.ProvAddress) []byte
func GetPlanForNodeKeyPrefix ¶
func GetPlanForNodeKeyPrefix(addr base.NodeAddress) []byte
func GetPlanForProviderKeyPrefix ¶
func GetPlanForProviderKeyPrefix(addr base.ProvAddress) []byte
func InactivePlanKey ¶
func NewErrorDuplicateNodeForPlan ¶
func NewErrorDuplicateNodeForPlan(id uint64, addr base.NodeAddress) error
NewErrorDuplicateNodeForPlan returns an error indicating that a node already exists for the specified plan.
func NewErrorInvalidNodeStatus ¶
func NewErrorInvalidNodeStatus(addr base.NodeAddress, status v1base.Status) error
NewErrorInvalidNodeStatus returns an error indicating that the provided status is invalid for the given node.
func NewErrorLeaseForNodeByProviderNotFound ¶
func NewErrorLeaseForNodeByProviderNotFound(nodeAddr base.NodeAddress, provAddr base.ProvAddress) error
NewErrorLeaseForNodeByProviderNotFound returns an error indicating that the specified lease does not exist.
func NewErrorLeaseNotFound ¶
NewErrorLeaseNotFound returns an error indicating that the specified lease does not exist.
func NewErrorNodeForPlanNotFound ¶
func NewErrorNodeForPlanNotFound(id uint64, addr base.NodeAddress) error
NewErrorNodeForPlanNotFound returns an error indicating that the specified node does not exist for the plan.
func NewErrorNodeNotFound ¶
func NewErrorNodeNotFound(addr base.NodeAddress) error
NewErrorNodeNotFound returns an error indicating that the specified node does not exist.
func NewErrorPlanNotFound ¶
NewErrorPlanNotFound returns an error indicating that the specified plan does not exist.
func NewErrorProviderNotFound ¶
func NewErrorProviderNotFound(addr base.ProvAddress) error
NewErrorProviderNotFound returns an error indicating that the specified provider does not exist.
func NewErrorUnauthorized ¶
NewErrorUnauthorized returns an error indicating that the specified address is not authorized.
func PlanForNodeByProviderKey ¶
func PlanForNodeByProviderKey(nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64) []byte
func PlanForProviderKey ¶
func PlanForProviderKey(addr base.ProvAddress, id uint64) []byte
Types ¶
This section is empty.