Documentation ¶
Index ¶
- Constants
- func ActivateImage(wsID uint64, networkID string, imageId uint64) error
- func DeactivateImage(wsID uint64, networkID string, imageId uint64) error
- func DeleteImage(wsID uint64, networkID string, imageId uint64) error
- func DeleteNetworkSpecs(wsID uint64, networkID string) error
- func ExpandNodeStorage(wsID uint64, nodeID uint64, size string) error
- func GetSupportedNodeTypes(protocolKey string) ([]models.NodeType, error)
- func Init(accessKey, secretKey string, baseURL string)
- func InsertSessionKey(url string, key *SessionKey) error
- func InviteMember(wsID uint64, data *InviteMemberPayload) error
- func ListImageVersions(image string) ([]string, error)
- func RestartNode(wsID uint64, nodeID uint64) error
- func ResumeNode(wsID uint64, nodeID uint64) error
- func StopNode(wsID uint64, nodeID uint64) error
- func TerminateNode(wsID uint64, nodeID uint64) error
- func TransformConfig(wsID uint64, payload *payload.ConfigPayload, ...) *models.Config
- func UpdateImage(wsID uint64, nodeID uint64, data *UpdateNodeImagePayload) error
- func UpdateNetworkSpec(wsID uint64, networkID string, payload *UpdateNetworkSpecPayload) error
- func UpdateNode(wsID uint64, nodeID uint64, data *UpdateNodePayload) error
- func UpsertImage(wsID uint64, networkID string, payload *ImagePayload) error
- type ArgPayloadWrap
- type ArgSectionItem
- type ArgSectionItems
- type ArgumentSections
- type Backups
- type BootNode
- type BootstrapChainSpecMetadata
- type BootstrapChainSpecNode
- type BootstrapChainSpecPayload
- type CheckStatus
- type Clusters
- type Config
- type CreateNetworkSpecModel
- type CreateNetworkSpecPayload
- type CreateNodePayload
- type Endpoints
- type ExtraArgs
- type ExtraEnvs
- type GenerateChainSpecPayload
- type GenerateChainSpecResult
- type ImageCheckStatus
- type ImagePayload
- type ImageResult
- type Info
- type InviteLog
- type InviteMemberPayload
- type Member
- type Metadata
- type NetworkSpec
- type NetworkSpecBackups
- type NetworkSpecMetadata
- type Node
- type NodeItem
- type NodeLaunchConfig
- type NodeMetadata
- type NodeRecommendation
- type NodeSpec
- type NodeSpecPrice
- type NodeSpecs
- type NodeStatus
- type Protocols
- type Recommend
- type SessionKey
- type SpecNodeType
- type UpdateNetworkSpecModel
- type UpdateNetworkSpecPayload
- type UpdateNodeImagePayload
- type UpdateNodePayload
- type UploadResult
- type Value
- type Vars
- type Workspace
Constants ¶
View Source
const MaxRetryCount = 15
Variables ¶
This section is empty.
Functions ¶
func DeleteNetworkSpecs ¶
func GetSupportedNodeTypes ¶
func InsertSessionKey ¶
func InsertSessionKey(url string, key *SessionKey) error
func InviteMember ¶
func InviteMember(wsID uint64, data *InviteMemberPayload) error
func ListImageVersions ¶
func RestartNode ¶
func ResumeNode ¶
func TerminateNode ¶
func TransformConfig ¶
func TransformConfig(wsID uint64, payload *payload.ConfigPayload, argumentSections *ArgumentSections) *models.Config
func UpdateImage ¶
func UpdateImage(wsID uint64, nodeID uint64, data *UpdateNodeImagePayload) error
func UpdateNetworkSpec ¶
func UpdateNetworkSpec(wsID uint64, networkID string, payload *UpdateNetworkSpecPayload) error
func UpdateNode ¶
func UpdateNode(wsID uint64, nodeID uint64, data *UpdateNodePayload) error
func UpsertImage ¶
func UpsertImage(wsID uint64, networkID string, payload *ImagePayload) error
Types ¶
type ArgPayloadWrap ¶
type ArgSectionItem ¶
type ArgSectionItems ¶
type ArgSectionItems []*ArgSectionItem
func (ArgSectionItems) GetItem ¶
func (ast ArgSectionItems) GetItem(key string) *ArgSectionItem
type ArgumentSections ¶
type ArgumentSections struct { Sections ArgSectionItems `json:"sections"` Delimiter *string `json:"delimiter"` }
func GetArgumentSectionsByProtocol ¶
func GetArgumentSectionsByProtocol(protocolKey string) (*ArgumentSections, error)
type Backups ¶
type Backups struct { Id string `json:"id"` NetworkSpec string `json:"networkSpec"` Protocol string `json:"protocol"` ClusterHash string `json:"clusterHash"` StorageSize uint `json:"storageSize"` PruningMode string `json:"pruningMode"` }
func GetBackups ¶
func (Backups) GetNodeTypeFromPruningMode ¶
func (Backups) GetNodeTypeFromPruningModeAndProtocol ¶
type BootstrapChainSpecMetadata ¶
type BootstrapChainSpecMetadata struct { }
type BootstrapChainSpecNode ¶
type BootstrapChainSpecNode struct { Cluster string `json:"cluster"` NodeName string `json:"nodeName"` Metadata BootstrapChainSpecMetadata `json:"metadata"` }
type BootstrapChainSpecPayload ¶
type BootstrapChainSpecPayload struct { Bootnode BootstrapChainSpecNode `json:"bootnode"` Storage string `json:"storage"` NodeSpecKey string `json:"nodeSpecKey"` UseAPIKey bool `json:"useApiKey"` ImageVersion string `json:"imageVersion"` }
type CheckStatus ¶
type Clusters ¶
type Clusters struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name" header:"name"` Hash string `json:"hash" header:"hash"` Cloud string `json:"cloud" header:"cloud"` Region string `json:"region" header:"region"` Index int `json:"index" header:"index"` Active bool `json:"active" header:"active"` }
type Config ¶
type Config struct { Cmd string `json:"cmd"` CheckStatus CheckStatus `json:"checkStatus"` ClientFeatures map[string]bool `json:"clientFeatures"` }
type CreateNetworkSpecModel ¶
type CreateNetworkSpecPayload ¶
type CreateNetworkSpecPayload struct { Name string `json:"name"` DisplayName string `json:"displayName"` Protocol string `json:"protocol"` ImageRepository string `json:"imageRepository"` ImageVersion *string `json:"imageVersion,omitempty"` //Metadata *NetworkSpecMetadata `json:"metadata"` Config *payload.ConfigPayload `json:"config"` }
type CreateNodePayload ¶
type CreateNodePayload struct { NetworkSpecKey string `json:"networkSpecKey"` NodeSpecKey *string `json:"nodeSpecKey"` NodeSpec *NodeSpec `json:"nodeSpec"` NodeType models.NodeType `json:"nodeType"` NodeName string `json:"nodeName"` ClusterHash string `json:"clusterKey"` Storage *string `json:"storage"` InitFromBackup bool `json:"initFromBackup"` UseApiKey bool `json:"useApiKey"` ImageVersion *string `json:"imageVersion"` Client *string `json:"client"` PublicPort bool `json:"publicPort"` Metadata *NodeMetadata `json:"metadata"` Config *NodeLaunchConfig `json:"config"` }
type GenerateChainSpecResult ¶
type ImageCheckStatus ¶
type ImageCheckStatus string
const ( Pending ImageCheckStatus = "pending" Success ImageCheckStatus = "success" Fail ImageCheckStatus = "fail" Timeout ImageCheckStatus = "timeout" )
type ImagePayload ¶
type ImageResult ¶
type ImageResult struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` ID uint64 `json:"id" header:"Id"` ProtocolKey string `json:"protocolKey"` ImageRepository string `json:"imageRepository" header:"ImageRepository"` Version string `json:"version" header:"Version"` Client string `json:"client"` Active bool `json:"active" header:"Active"` Config Config `json:"config"` Status ImageCheckStatus `json:"status"` Image string `json:"image"` }
func CheckImage ¶
func CheckImage(payload *ImagePayload) (*ImageResult, error)
type Info ¶
type InviteLog ¶
type InviteLog struct { ID uint64 `json:"id,string"` Email string `json:"email"` Role string `json:"role"` IsDone bool `json:"isDone"` }
func GetInvitations ¶
type InviteMemberPayload ¶
type Member ¶
type Member struct { ID uint64 `json:"id,string"` Name string `json:"name"` Email string `json:"email"` Role string `json:"role"` }
func GetMembers ¶
type Metadata ¶
type Metadata struct { Rules map[models.NodeType]interface{} `json:"rules" header:"rules"` ArgumentSections *ArgumentSections `json:"argumentSections" ` }
type NetworkSpec ¶
type NetworkSpec struct { Key string `json:"key" header:"Key"` Name string `json:"name" ` DisplayName string `json:"displayName" header:"Name"` ProtocolKey string `json:"protocolKey" header:"Protocol"` IsPublic bool `json:"isPublic" header:"Public"` ImageRepository string `json:"imageRepository" header:"Image"` WorkspaceID uint64 `json:"workspaceId,string"` Status string `json:"status"` Metadata NetworkSpecMetadata `json:"metadata" header:"Status"` CreatedAt time.Time `json:"createdAt" ` UpdatedAt time.Time `json:"updatedAt" ` Recommend *Recommend `json:"recommend,omitempty"` NodeTypes []SpecNodeType `json:"nodeTypes,omitempty"` Config *models.Config `json:"config"` }
func CreateNetworkSpecs ¶
func CreateNetworkSpecs(wsID uint64, payload *CreateNetworkSpecPayload) (*NetworkSpec, error)
func GetNetworkSpec ¶
func GetNetworkSpec(wsID uint64, networkID string) (*NetworkSpec, error)
func GetNetworkSpecs ¶
func GetNetworkSpecs(wsID uint64) ([]NetworkSpec, error)
func (*NetworkSpec) MergeConfig ¶
func (c *NetworkSpec) MergeConfig(config *models.Config)
type NetworkSpecBackups ¶
type NetworkSpecBackups struct { Key string `json:"key" header:"Network Spec Key"` Name string `json:"name"` DisplayName string `json:"displayName" header:"Name"` ProtocolKey string `json:"protocolKey"` AvailNodeTypes string `json:"availNodeTypes" header:"Node Type"` MinStorageSize uint `json:"minStorageSize" header:"Min Storage Size (Gb)"` AvailCloudRegion string `json:"availCloudRegion" header:"Cloud & Region"` ClusterKey string `json:"cluserKey" header:"Cluster Key"` }
func GetBackupNetworkSpecs ¶
func GetBackupNetworkSpecs() ([]NetworkSpecBackups, error)
type NetworkSpecMetadata ¶
type NetworkSpecMetadata struct { Recommend *Recommend `json:"recommend,omitempty"` ChainSpec *string `json:"chainspec,omitempty"` ImageVersion *string `json:"imageVersion,omitempty"` Command *string `json:"command,omitempty"` VersionList []string `json:"versionList,omitempty"` BootNodes []string `json:"bootnodes,omitempty"` FetchRcChainspec *string `json:"fetchRcChainspec,omitempty"` RcChainspec *string `json:"rcChainspec,omitempty"` RcExtraArgs []string `json:"rcExtraArgs,omitempty"` ExtraArgs []string `json:"extraArgs,omitempty"` ParachainId *int `json:"parachainId,omitempty"` Cluster *string `json:"cluster,omitempty"` }
type Node ¶
type Node struct { ID uint64 `json:"id,string" header:"ID"` Name string `json:"name" header:"Name"` NetworkSpecKey string `json:"networkSpecKey" header:"Network"` WorkspaceID uint64 `json:"workspaceId,string"` OwnerID uint64 `json:"ownerId,string"` NodeType string `json:"type"` NodeSpec string `json:"nodeSpec"` CPU string `json:"cpu"` Ram string `json:"ram"` NodeSpecMultiplier float32 `json:"nodeSpecMultiplier"` Storage string `json:"storage"` StorageType string `json:"storageType"` Image string `json:"image"` ClusterHash string `json:"clusterHash" header:"Cluster"` Status string `json:"status" header:"Status"` Metadata NodeMetadata `json:"metadata"` NetworkSpec *NetworkSpec `json:"networkSpec"` Endpoints *Endpoints `json:"endpoints"` AvailableVersions []string `json:"availableVersions"` HasUpgrade bool `json:"hasUpgrade"` }
func CreateNode ¶
func CreateNode(wsID uint64, data *CreateNodePayload) (*Node, error)
type NodeItem ¶
type NodeItem struct { ID uint64 `json:"id,string" header:"ID"` Name string `json:"name" header:"Name"` NetworkSpecKey string `json:"networkSpecKey" header:"Network"` ClusterHash string `json:"clusterHash" header:"Cluster"` Status string `json:"status" header:"Status"` Image string `json:"image" header:"image"` }
func GetNodeList ¶
type NodeLaunchConfig ¶
type NodeMetadata ¶
type NodeRecommendation ¶
type NodeRecommendation struct { Network string `json:"network" header:"network"` NodeSpec string `json:"nodeSpec" header:"nodeSpec"` NodeSpecMultiplier int `json:"nodeSpecMultiplier" header:"nodeSpecMultiplier"` StorageSize int `json:"storageSize" header:"storageSize"` ImageVersion string `json:"imageVersion" header:"imageVersion"` Client string `json:"client" header:"client"` }
func NodeRecommends ¶
func NodeRecommends(network string) (NodeRecommendation, error)
type NodeSpecPrice ¶
type NodeSpecs ¶
type NodeSpecs struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Key string `json:"key" header:"key"` Name string `json:"name" header:"name"` CPU string `json:"cpu" header:"cpu"` Memory string `json:"memory" header:"memory"` Active bool `json:"active" header:"active"` Priority int `json:"priority" header:"priority"` Protocol string `json:"protocol" header:"protocol"` Network string `json:"network" header:"network"` Price NodeSpecPrice `json:"price" header:"price"` MaxMultiplier int `json:"maxMultiplier" header:"maxMultiplier"` }
type NodeStatus ¶
type NodeStatus struct {
Status string `json:"status"`
}
func GetNodeStatus ¶
func GetNodeStatus(wsID uint64, nodeID uint64) (*NodeStatus, error)
type Protocols ¶
type Protocols struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Key string `json:"key" header:"key"` Name string `json:"name" header:"name"` Derivable bool `json:"derivable" header:"derivable"` ImageRepositories []string `json:"imageRepositories" header:"images"` Metadata *Metadata `json:"metadata" header:"metadata"` }
type SessionKey ¶
type SpecNodeType ¶
type UpdateNetworkSpecModel ¶
type UpdateNetworkSpecPayload ¶
type UpdateNetworkSpecPayload struct { DisplayName *string `json:"displayName"` Config *payload.ConfigPayload `json:"config"` }
type UpdateNodeImagePayload ¶
type UpdateNodeImagePayload struct {
ImageVersion *string `json:"imageVersion"`
}
type UpdateNodePayload ¶
type UpdateNodePayload struct { NodeSpecKey *string `json:"nodeSpecKey"` NodeSpec *NodeSpec `json:"nodeSpec"` NodeType *string `json:"nodeType"` NodeName *string `json:"nodeName"` ImageVersion *string `json:"imageVersion"` Metadata *NodeMetadata `json:"metadata"` Config *NodeLaunchConfig `json:"config"` }
type UploadResult ¶
type UploadResult struct {
Key *string `json:"key"`
}
func UploadPrivateFile ¶
func UploadPrivateFile(wsID uint64, files []string) (*UploadResult, error)
type Value ¶
type Value struct { ValueType models.VarValueType `json:"valueType"` Payload interface{} `json:"payload"` }
type Workspace ¶
type Workspace struct { ID uint64 `json:"id,string" header:"ID"` Name string `json:"name" header:"Name"` Plan string `json:"plan" header:"Plan"` OwnerID uint64 `json:"ownerId,string"` BillingType string `json:"billingType"` PaymentMethodID string `json:"paymentMethodId"` Active bool `json:"active"` SuspendAt *time.Time `json:"suspendAt"` CreateAt *time.Time `json:"createdAt"` UpdateAt *time.Time `json:"updateAt"` }
func GetWorkspaceList ¶
Click to show internal directories.
Click to hide internal directories.