Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountId
- type Balance
- type Bucket
- type BucketAllocatedEvent
- type BucketAvailabilityUpdatedEvent
- type BucketCreatedEvent
- type BucketId
- type BucketParams
- type BucketSettlePaymentEvent
- type BucketStatus
- type CDNCluster
- type CDNClusterStatus
- type CDNNode
- type CDNNodeParams
- type CDNNodeStatus
- type Cash
- type CdnClusterCreatedEvent
- type CdnClusterDistributeRevenuesEvent
- type CdnNodeCreatedEvent
- type Cluster
- type ClusterCreatedEvent
- type ClusterDistributeRevenuesEvent
- type ClusterId
- type ClusterNodeReplacedEvent
- type ClusterParams
- type ClusterReserveResourceEvent
- type ClusterStatus
- type DdcBucketContract
- type DepositEvent
- type FlexInt
- type GrantPermissionEvent
- type Node
- type NodeCreatedEvent
- type NodeId
- type NodeState
- type NodeStatus
- type Params
- type ProviderId
- type Resource
- type Result
- type RevokePermissionEvent
- type Schedule
- type Token
Constants ¶
View Source
const ( BucketCreatedEventId = "004464634275636b65743a3a4275636b65744372656174656400000000000000" BucketAllocatedEventId = "004464634275636b65743a3a4275636b6574416c6c6f63617465640000000000" BucketSettlePaymentEventId = "004464634275636b65743a3a4275636b6574536574746c655061796d656e7400" BucketAvailabilityUpdatedId = "8d8714b3df602b0ce92b8a3de12daedf222ff9198078f834d57176ca2a06359c" ClusterCreatedEventId = "004464634275636b65743a3a436c757374657243726561746564000000000000" ClusterNodeReplacedEventId = "004464634275636b65743a3a436c75737465724e6f64655265706c6163656400" ClusterReserveResourceEventId = "84d6d26a3275dced8e359779bf21488762a1d88029f52522d8fc27607759399e" ClusterDistributeRevenuesEventId = "65441936759a16fb28d0e059b878f2e48283ca2eac57c396a8035cce9e2acdd3" CdnClusterCreatedEventId = "004464634275636b65743a3a43646e436c757374657243726561746564000000" CdnClusterDistributeRevenuesEventId = "4e19fc4683a9a741a09d89a1d62b22d592a8bf10e2b8b6eff7c6742a0ed88bb4" CdnNodeCreatedEventId = "004464634275636b65743a3a43646e4e6f646543726561746564000000000000" NodeCreatedEventId = "004464634275636b65743a3a4e6f646543726561746564000000000000000000" DepositEventId = "004464634275636b65743a3a4465706f73697400000000000000000000000000" GrantPermissionEventId = "004464634275636b65743a3a4772616e745065726d697373696f6e0000000000" RevokePermissionEventId = "004464634275636b65743a3a5265766f6b655065726d697373696f6e00000000" )
Variables ¶
View Source
var ( ErrBucketDoesNotExist = errors.New("bucket doesn't exist") ErrProviderDoesNotExist = errors.New("provider doesn't exist") ErrTransferFailed = errors.New("transfer failed") ErrUndefined = errors.New("undefined error") )
ToDo update error regarding latest contract
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Deposit Cash Bonded Cash Negative Cash UnboundedAmount Cash UnbondedTimestamp uint64 PayableSchedule Schedule }
func (*Account) HasBalance ¶
type BucketAllocatedEvent ¶ added in v0.1.5
type BucketAvailabilityUpdatedEvent ¶ added in v0.1.5
type BucketCreatedEvent ¶ added in v0.1.5
type BucketParams ¶
type BucketParams = Params
type BucketSettlePaymentEvent ¶ added in v0.1.5
type BucketStatus ¶
type BucketStatus struct { BucketId BucketId Bucket Bucket Params BucketParams WriterIds []AccountId ReaderIds []AccountId RentCoveredUntilMs uint64 }
func (*BucketStatus) HasReadAccess ¶
func (b *BucketStatus) HasReadAccess(publicKey []byte) bool
func (*BucketStatus) HasWriteAccess ¶
func (b *BucketStatus) HasWriteAccess(publicKey []byte) bool
func (*BucketStatus) IsOwner ¶
func (b *BucketStatus) IsOwner(publicKey []byte) bool
func (*BucketStatus) RentExpired ¶
func (b *BucketStatus) RentExpired() bool
type CDNCluster ¶
type CDNClusterStatus ¶
type CDNClusterStatus struct { ClusterId ClusterId CDNCluster CDNCluster }
type CDNNode ¶
type CDNNode struct { ProviderId ProviderId UndistributedPayment Balance }
type CDNNodeParams ¶
type CDNNodeParams struct { Url string `json:"url"` Size FlexInt `json:"size"` Location string `json:"location"` PublicKey string `json:"publicKey"` }
Structure-helper for json on the CDN Node Params string
func ReadCDNNodeParams ¶
func ReadCDNNodeParams(s string) (p CDNNodeParams, err error)
type CDNNodeStatus ¶
type CdnClusterCreatedEvent ¶ added in v0.1.5
type CdnClusterDistributeRevenuesEvent ¶ added in v0.1.5
type CdnNodeCreatedEvent ¶ added in v0.1.5
type ClusterCreatedEvent ¶ added in v0.1.5
type ClusterDistributeRevenuesEvent ¶ added in v0.1.5
type ClusterNodeReplacedEvent ¶ added in v0.1.5
type ClusterParams ¶
type ClusterParams struct {
ReplicationFactor FlexInt `json:"replicationFactor"`
}
type ClusterReserveResourceEvent ¶ added in v0.1.5
type ClusterStatus ¶
func (*ClusterStatus) ReplicationFactor ¶
func (c *ClusterStatus) ReplicationFactor() uint
type DdcBucketContract ¶
type DdcBucketContract interface { GetContractAddress() string GetLastAccessTime() time.Time BucketGet(bucketId uint32) (*BucketStatus, error) ClusterGet(clusterId uint32) (*ClusterStatus, error) NodeGet(nodeId uint32) (*NodeStatus, error) CDNClusterGet(clusterId uint32) (*CDNClusterStatus, error) CDNNodeGet(nodeId uint32) (*CDNNodeStatus, error) AccountGet(account types.AccountID) (*Account, error) AddContractEventHandler(event string, handler func(interface{})) error GetEventDispatcher() map[types.Hash]pkg.ContractEventDispatchEntry }
func CreateDdcBucketContract ¶
func CreateDdcBucketContract(client pkg.BlockchainClient, contractAddressSS58 string) DdcBucketContract
type DepositEvent ¶ added in v0.1.5
type FlexInt ¶ added in v0.1.6
type FlexInt int
A FlexInt is an int that can be unmarshalled from a JSON field that has either a number or a string value. E.g. if the json field contains an string "42", the FlexInt value will be "42". Use it for example for int fields that can came from smart contract "params" field. JS will save them as strings, but Go will expect them to be ints.
func (*FlexInt) UnmarshalJSON ¶ added in v0.1.6
type GrantPermissionEvent ¶ added in v0.1.5
type Node ¶
type Node struct { ProviderId ProviderId RentPerMonth Balance FreeResources Resource NodeState NodeState }
type NodeCreatedEvent ¶ added in v0.1.5
type NodeStatus ¶
type ProviderId ¶
type ProviderId = AccountId
type RevokePermissionEvent ¶ added in v0.1.5
Click to show internal directories.
Click to hide internal directories.