types

package
v12.0.0-rc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "subscription"
)

Variables

View Source
var (
	ErrInvalidMessage = sdkerrors.Register(ModuleName, 101, "invalid message")

	ErrAllocationNotFound        = sdkerrors.Register(ModuleName, 201, "allocation not found")
	ErrInsufficientBytes         = sdkerrors.Register(ModuleName, 202, "insufficient bytes")
	ErrInvalidAllocation         = sdkerrors.Register(ModuleName, 203, "invalid allocation")
	ErrInvalidNodeStatus         = sdkerrors.Register(ModuleName, 204, "invalid node status")
	ErrInvalidPlanStatus         = sdkerrors.Register(ModuleName, 205, "invalid plan status")
	ErrInvalidRenewalPolicy      = sdkerrors.Register(ModuleName, 206, "invalid renewal policy")
	ErrInvalidSessionStatus      = sdkerrors.Register(ModuleName, 207, "invalid session status")
	ErrInvalidSubscriptionStatus = sdkerrors.Register(ModuleName, 208, "invalid subscription status")
	ErrNodeNotFound              = sdkerrors.Register(ModuleName, 209, "node not found")
	ErrPlanNotFound              = sdkerrors.Register(ModuleName, 210, "plan not found")
	ErrPriceNotFound             = sdkerrors.Register(ModuleName, 211, "price not found")
	ErrSessionNotFound           = sdkerrors.Register(ModuleName, 212, "session not found")
	ErrSubscriptionNotFound      = sdkerrors.Register(ModuleName, 213, "subscription not found")
	ErrUnauthorized              = sdkerrors.Register(ModuleName, 214, "unauthorized")
)
View Source
var (
	CountKey  = []byte{0x00}
	ParamsKey = []byte{0x01}

	SubscriptionKeyPrefix              = []byte{0x10}
	SubscriptionForAccountKeyPrefix    = []byte{0x11}
	SubscriptionForPlanKeyPrefix       = []byte{0x12}
	SubscriptionForInactiveAtKeyPrefix = []byte{0x13}
	SubscriptionForRenewalAtKeyPrefix  = []byte{0x14}

	AllocationKeyPrefix = []byte{0x20}
)

Functions

func AccAddrFromSubscriptionForAccountKey

func AccAddrFromSubscriptionForAccountKey(key []byte) sdk.AccAddress

func AllocationKey

func AllocationKey(id uint64, addr sdk.AccAddress) []byte

func GetAllocationForSubscriptionKeyPrefix

func GetAllocationForSubscriptionKeyPrefix(id uint64) []byte

func GetSubscriptionForAccountKeyPrefix

func GetSubscriptionForAccountKeyPrefix(addr sdk.AccAddress) []byte

func GetSubscriptionForInactiveAtKeyPrefix

func GetSubscriptionForInactiveAtKeyPrefix(at time.Time) []byte

func GetSubscriptionForPlanKeyPrefix

func GetSubscriptionForPlanKeyPrefix(id uint64) []byte

func GetSubscriptionForRenewalAtKeyPrefix

func GetSubscriptionForRenewalAtKeyPrefix(at time.Time) []byte

func IDFromSubscriptionForAccountKey

func IDFromSubscriptionForAccountKey(key []byte) uint64

func IDFromSubscriptionForInactiveAtKey

func IDFromSubscriptionForInactiveAtKey(key []byte) uint64

func IDFromSubscriptionForPlanKey

func IDFromSubscriptionForPlanKey(key []byte) uint64

func IDFromSubscriptionForRenewalAtKey

func IDFromSubscriptionForRenewalAtKey(key []byte) uint64

func NewErrorAllocationNotFound

func NewErrorAllocationNotFound(id uint64, addr sdk.AccAddress) error

NewErrorAllocationNotFound returns an error indicating that the specified allocation does not exist.

func NewErrorInsufficientBytes

func NewErrorInsufficientBytes(id uint64, bytes sdkmath.Int) error

NewErrorInsufficientBytes returns an error indicating that there are insufficient bytes for the specified subscription.

func NewErrorInvalidAllocation

func NewErrorInvalidAllocation(id uint64, addr sdk.AccAddress) error

NewErrorInvalidAllocation returns an error indicating that the allocation is invalid.

func NewErrorInvalidNodeStatus

func NewErrorInvalidNodeStatus(addr base.NodeAddress, status v1base.Status) error

NewErrorInvalidNodeStatus returns an error indicating that the provided status is invalid for the node.

func NewErrorInvalidPlanStatus

func NewErrorInvalidPlanStatus(id uint64, status v1base.Status) error

NewErrorInvalidPlanStatus returns an error indicating that the provided status is invalid for the plan.

func NewErrorInvalidSessionStatus

func NewErrorInvalidSessionStatus(id uint64, status v1base.Status) error

NewErrorInvalidSessionStatus returns an error indicating that the provided status is invalid for the session.

func NewErrorInvalidSubscriptionStatus

func NewErrorInvalidSubscriptionStatus(id uint64, status v1base.Status) error

NewErrorInvalidSubscriptionStatus returns an error indicating that the provided status is invalid for the subscription.

func NewErrorNodeNotFound

func NewErrorNodeNotFound(addr base.NodeAddress) error

NewErrorNodeNotFound returns an error indicating that the specified node does not exist.

func NewErrorPlanNotFound

func NewErrorPlanNotFound(id uint64) error

NewErrorPlanNotFound returns an error indicating that the specified plan does not exist.

func NewErrorPriceNotFound

func NewErrorPriceNotFound(denom string) error

NewErrorPriceNotFound returns an error indicating that the price for the specified denomination does not exist.

func NewErrorSessionNotFound

func NewErrorSessionNotFound(id uint64) error

NewErrorSessionNotFound returns an error indicating that the specified session does not exist.

func NewErrorSubscriptionNotFound

func NewErrorSubscriptionNotFound(id uint64) error

NewErrorSubscriptionNotFound returns an error indicating that the specified subscription does not exist.

func NewErrorUnauthorized

func NewErrorUnauthorized(addr string) error

NewErrorUnauthorized returns an error indicating that the specified address is not authorized.

func SubscriptionForAccountKey

func SubscriptionForAccountKey(addr sdk.AccAddress, id uint64) []byte

func SubscriptionForInactiveAtKey

func SubscriptionForInactiveAtKey(at time.Time, id uint64) []byte

func SubscriptionForPlanKey

func SubscriptionForPlanKey(planID, subscriptionID uint64) []byte

func SubscriptionForRenewalAtKey

func SubscriptionForRenewalAtKey(at time.Time, id uint64) []byte

func SubscriptionKey

func SubscriptionKey(id uint64) []byte

Types

This section is empty.

Directories

Path Synopsis
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.
Package v2 is a reverse proxy.
Package v2 is a reverse proxy.
Package v3 is a reverse proxy.
Package v3 is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL