Documentation
¶
Index ¶
- Constants
- Variables
- func AppToPb(app *App) *pb.App
- func AppVersionToPb(appVersion *AppVersion) *pb.AppVersion
- func AppVersionsToPbs(appVersions []*AppVersion) (pbAppVersions []*pb.AppVersion)
- func CategoriesToPbs(categories []*Category) (pbCategories []*pb.Category)
- func CategoryToPb(category *Category) *pb.Category
- func ClusterCommonToPb(clusterCommon *ClusterCommon) *pb.ClusterCommon
- func ClusterCommonsToPbs(clusterCommons []*ClusterCommon) (pbClusterCommons []*pb.ClusterCommon)
- func ClusterLinkToPb(clusterLink *ClusterLink) *pb.ClusterLink
- func ClusterLinksToPbs(clusterLinks []*ClusterLink) (pbClusterLinks []*pb.ClusterLink)
- func ClusterLoadbalancerToPb(clusterLoadbalancer *ClusterLoadbalancer) *pb.ClusterLoadbalancer
- func ClusterLoadbalancersToPbs(clusterLoadbalancers []*ClusterLoadbalancer) (pbClusterLoadbalancers []*pb.ClusterLoadbalancer)
- func ClusterNodeToPb(clusterNode *ClusterNode) *pb.ClusterNode
- func ClusterNodeWithKeyPairsToPb(clusterNodeKeyPairs *ClusterNodeWithKeyPairs) *pb.ClusterNode
- func ClusterNodeWrapperToPb(clusterNode *ClusterNodeWithKeyPairs, clusterCommon *ClusterCommon, ...) *pb.ClusterNode
- func ClusterNodesWithKeyPairsToPbs(clusterNodeKeyPairs []*ClusterNodeWithKeyPairs) (pbClusterNodes []*pb.ClusterNode)
- func ClusterRoleToPb(clusterRole *ClusterRole) *pb.ClusterRole
- func ClusterRolesToPbs(clusterRoles []*ClusterRole) (pbClusterRoles []*pb.ClusterRole)
- func ClusterToPb(cluster *Cluster) *pb.Cluster
- func ClusterWrapperToPb(clusterWrapper *ClusterWrapper) *pb.Cluster
- func JobToPb(job *Job) *pb.Job
- func JobsToPbs(jobs []*Job) (pbJobs []*pb.Job)
- func KeyPairNodesToPb(keyPairNodes *KeyPairWithNodes) *pb.KeyPair
- func KeyPairNodesToPbs(keyPairNodes []*KeyPairWithNodes) (pbKeyPairs []*pb.KeyPair)
- func NewAppId() string
- func NewAppVersionId() string
- func NewCategoryId() string
- func NewClusterId() string
- func NewClusterNodeId() string
- func NewJobId() string
- func NewKeyPairId() string
- func NewRepoEventId() string
- func NewRepoId() string
- func NewRepoLabelId() string
- func NewRepoSelectorId() string
- func NewRuntimeCrentialId() string
- func NewRuntimeId() string
- func NewRuntimeLabelId() string
- func NewTaskId() string
- func NodeKeyPairToPb(nodeKeyPair *NodeKeyPair) *pb.NodeKeyPair
- func RepoEventToPb(repoTask *RepoEvent) *pb.RepoEvent
- func RepoEventsToPbs(repoTasks []*RepoEvent) (pbRepoTasks []*pb.RepoEvent)
- func RepoLabelToPb(repoLabel *RepoLabel) *pb.RepoLabel
- func RepoLabelsMap(repoLabels []*RepoLabel) map[string][]*RepoLabel
- func RepoLabelsToPbs(repoLabels []*RepoLabel) (pbRepoLabels []*pb.RepoLabel)
- func RepoProvidersMap(repoProviders []*RepoProvider) map[string][]*RepoProvider
- func RepoSelectorToPb(repoSelector *RepoSelector) *pb.RepoSelector
- func RepoSelectorsMap(repoSelectors []*RepoSelector) map[string][]*RepoSelector
- func RepoSelectorsToPbs(repoSelectors []*RepoSelector) (pbRepoSelectors []*pb.RepoSelector)
- func RepoToPb(repo *Repo) *pb.Repo
- func ReposToPbs(repos []*Repo) (pbRepos []*pb.Repo)
- func RuntimeCredentialMap(runtimeCredentials []*RuntimeCredential) map[string]*RuntimeCredential
- func RuntimeLabelToPb(runtimeLabel *RuntimeLabel) *pb.RuntimeLabel
- func RuntimeLabelsMap(runtimeLabels []*RuntimeLabel) map[string][]*RuntimeLabel
- func RuntimeLabelsToPbs(runtimeLabels []*RuntimeLabel) (pbRuntimeLabels []*pb.RuntimeLabel)
- func RuntimeToPb(runtime *Runtime) *pb.Runtime
- func RuntimeToPbs(runtimes []*Runtime) (pbRuntimes []*pb.Runtime)
- func TaskToPb(task *Task) *pb.Task
- func TasksToPbs(tasks []*Task) (pbTasks []*pb.Task)
- type App
- type AppVersion
- type AppVersions
- type Category
- type CategoryResource
- type Cluster
- type ClusterCommon
- type ClusterLink
- type ClusterLoadbalancer
- type ClusterNode
- type ClusterNodeWithKeyPairs
- type ClusterRole
- type ClusterSnapshot
- type ClusterUpgradeAudit
- type ClusterWrapper
- type Cmd
- type CmdCnodes
- type Eip
- type Instance
- type Job
- type KeyPair
- type KeyPairWithNodes
- type Meta
- type NodeKeyPair
- type NodeKeyPairDetail
- type NodeKeyPairDetails
- type Quota
- type Quotas
- type Repo
- type RepoEvent
- type RepoLabel
- type RepoProvider
- type RepoSelector
- type RoleResizeResource
- type RoleResizeResources
- type RoleResource
- type Runtime
- type RuntimeCredential
- type RuntimeLabel
- type Subnet
- type Task
- type TaskLayer
- type Volume
- type Vpc
- type WalkFunc
Constants ¶
View Source
const RuntimeCredentialPrifix = "runtimec-"
View Source
const RuntimeIdPrefix = "runtime-"
View Source
const UncategorizedId = "ctg-uncategorized"
Variables ¶
View Source
var AppColumns = db.GetColumnsFromStruct(&App{})
View Source
var AppVersionColumns = db.GetColumnsFromStruct(&AppVersion{})
View Source
var CategoryColumns = db.GetColumnsFromStruct(&Category{})
View Source
var CategoryResourceColumns = db.GetColumnsFromStruct(&CategoryResource{})
View Source
var ClusterColumns = db.GetColumnsFromStruct(&Cluster{})
View Source
var ClusterCommonColumns = db.GetColumnsFromStruct(&ClusterCommon{})
View Source
var ClusterLinkColumns = db.GetColumnsFromStruct(&ClusterLink{})
View Source
var ClusterLoadbalancerColumns = db.GetColumnsFromStruct(&ClusterLoadbalancer{})
View Source
var ClusterNodeColumns = db.GetColumnsFromStruct(&ClusterNode{})
View Source
var ClusterRoleColumns = db.GetColumnsFromStruct(&ClusterRole{})
View Source
var ClusterSnapshotColumns = db.GetColumnsFromStruct(&ClusterSnapshot{})
View Source
var ClusterUpgradeAuditColumns = db.GetColumnsFromStruct(&ClusterUpgradeAudit{})
View Source
var JobColumns = db.GetColumnsFromStruct(&Job{})
View Source
var KeyPairColumns = db.GetColumnsFromStruct(&KeyPair{})
View Source
var NodeKeyPairColumns = db.GetColumnsFromStruct(&NodeKeyPair{})
View Source
var RepoColumns = db.GetColumnsFromStruct(&Repo{})
View Source
var RepoColumnsWithTablePrefix = db.GetColumnsFromStructWithPrefix(constants.TableRepo, &Repo{})
View Source
var RepoEventColumns = db.GetColumnsFromStruct(&RepoEvent{})
View Source
var RepoLabelColumns = db.GetColumnsFromStruct(&RepoLabel{})
View Source
var RepoProviderColumns = db.GetColumnsFromStruct(&RepoProvider{})
View Source
var RepoSelectorColumns = db.GetColumnsFromStruct(&RepoSelector{})
View Source
var RuntimeColumns = db.GetColumnsFromStruct(&Runtime{})
View Source
var RuntimeColumnsWithTablePrefix = db.GetColumnsFromStructWithPrefix(constants.TableRuntime, &Runtime{})
View Source
var RuntimeCredentialColumns = db.GetColumnsFromStruct(&RuntimeCredential{})
View Source
var RuntimeLabelColumns = db.GetColumnsFromStruct(&RuntimeLabel{})
View Source
var TaskColumns = db.GetColumnsFromStruct(&Task{})
Functions ¶
func AppVersionToPb ¶
func AppVersionToPb(appVersion *AppVersion) *pb.AppVersion
func AppVersionsToPbs ¶
func AppVersionsToPbs(appVersions []*AppVersion) (pbAppVersions []*pb.AppVersion)
func CategoriesToPbs ¶
func CategoryToPb ¶
func ClusterCommonToPb ¶
func ClusterCommonToPb(clusterCommon *ClusterCommon) *pb.ClusterCommon
func ClusterCommonsToPbs ¶
func ClusterCommonsToPbs(clusterCommons []*ClusterCommon) (pbClusterCommons []*pb.ClusterCommon)
func ClusterLinkToPb ¶
func ClusterLinkToPb(clusterLink *ClusterLink) *pb.ClusterLink
func ClusterLinksToPbs ¶
func ClusterLinksToPbs(clusterLinks []*ClusterLink) (pbClusterLinks []*pb.ClusterLink)
func ClusterLoadbalancerToPb ¶
func ClusterLoadbalancerToPb(clusterLoadbalancer *ClusterLoadbalancer) *pb.ClusterLoadbalancer
func ClusterLoadbalancersToPbs ¶
func ClusterLoadbalancersToPbs(clusterLoadbalancers []*ClusterLoadbalancer) (pbClusterLoadbalancers []*pb.ClusterLoadbalancer)
func ClusterNodeToPb ¶
func ClusterNodeToPb(clusterNode *ClusterNode) *pb.ClusterNode
func ClusterNodeWithKeyPairsToPb ¶ added in v0.1.8
func ClusterNodeWithKeyPairsToPb(clusterNodeKeyPairs *ClusterNodeWithKeyPairs) *pb.ClusterNode
func ClusterNodeWrapperToPb ¶
func ClusterNodeWrapperToPb(clusterNode *ClusterNodeWithKeyPairs, clusterCommon *ClusterCommon, clusterRole *ClusterRole) *pb.ClusterNode
func ClusterNodesWithKeyPairsToPbs ¶ added in v0.1.8
func ClusterNodesWithKeyPairsToPbs(clusterNodeKeyPairs []*ClusterNodeWithKeyPairs) (pbClusterNodes []*pb.ClusterNode)
func ClusterRoleToPb ¶
func ClusterRoleToPb(clusterRole *ClusterRole) *pb.ClusterRole
func ClusterRolesToPbs ¶
func ClusterRolesToPbs(clusterRoles []*ClusterRole) (pbClusterRoles []*pb.ClusterRole)
func ClusterToPb ¶
func ClusterWrapperToPb ¶
func ClusterWrapperToPb(clusterWrapper *ClusterWrapper) *pb.Cluster
func KeyPairNodesToPb ¶ added in v0.1.8
func KeyPairNodesToPb(keyPairNodes *KeyPairWithNodes) *pb.KeyPair
func KeyPairNodesToPbs ¶ added in v0.1.8
func KeyPairNodesToPbs(keyPairNodes []*KeyPairWithNodes) (pbKeyPairs []*pb.KeyPair)
func NewAppVersionId ¶
func NewAppVersionId() string
func NewCategoryId ¶
func NewCategoryId() string
func NewClusterId ¶
func NewClusterId() string
func NewClusterNodeId ¶
func NewClusterNodeId() string
func NewKeyPairId ¶ added in v0.1.7
func NewKeyPairId() string
func NewRepoEventId ¶
func NewRepoEventId() string
func NewRepoLabelId ¶
func NewRepoLabelId() string
func NewRepoSelectorId ¶
func NewRepoSelectorId() string
func NewRuntimeCrentialId ¶
func NewRuntimeCrentialId() string
func NewRuntimeId ¶
func NewRuntimeId() string
func NewRuntimeLabelId ¶
func NewRuntimeLabelId() string
func NodeKeyPairToPb ¶ added in v0.1.7
func NodeKeyPairToPb(nodeKeyPair *NodeKeyPair) *pb.NodeKeyPair
func RepoEventToPb ¶
func RepoEventsToPbs ¶
func RepoLabelToPb ¶
func RepoLabelsMap ¶
func RepoLabelsToPbs ¶
func RepoProvidersMap ¶
func RepoProvidersMap(repoProviders []*RepoProvider) map[string][]*RepoProvider
func RepoSelectorToPb ¶
func RepoSelectorToPb(repoSelector *RepoSelector) *pb.RepoSelector
func RepoSelectorsMap ¶
func RepoSelectorsMap(repoSelectors []*RepoSelector) map[string][]*RepoSelector
func RepoSelectorsToPbs ¶
func RepoSelectorsToPbs(repoSelectors []*RepoSelector) (pbRepoSelectors []*pb.RepoSelector)
func ReposToPbs ¶
func RuntimeCredentialMap ¶
func RuntimeCredentialMap(runtimeCredentials []*RuntimeCredential) map[string]*RuntimeCredential
func RuntimeLabelToPb ¶
func RuntimeLabelToPb(runtimeLabel *RuntimeLabel) *pb.RuntimeLabel
func RuntimeLabelsMap ¶
func RuntimeLabelsMap(runtimeLabels []*RuntimeLabel) map[string][]*RuntimeLabel
func RuntimeLabelsToPbs ¶
func RuntimeLabelsToPbs(runtimeLabels []*RuntimeLabel) (pbRuntimeLabels []*pb.RuntimeLabel)
func RuntimeToPb ¶
func RuntimeToPbs ¶
func TasksToPbs ¶
Types ¶
type App ¶
type AppVersion ¶
type AppVersion struct {
VersionId string
AppId string
Owner string
Name string
Description string
PackageName string
Home string
Icon string
Screenshots string
Maintainers string
Keywords string
Sources string
Readme string
Status string
Sequence uint32
CreateTime time.Time
StatusTime time.Time
UpdateTime *time.Time
}
func NewAppVersion ¶
func NewAppVersion(appId, name, description, owner, packageName string) *AppVersion
func (AppVersion) GetSemver ¶ added in v0.2.1
func (v AppVersion) GetSemver() string
type AppVersions ¶ added in v0.2.1
type AppVersions []*AppVersion
func (AppVersions) Less ¶ added in v0.2.1
func (c AppVersions) Less(a, b int) bool
Less returns true if the version of entry a is less than the version of entry b.
func (AppVersions) Swap ¶ added in v0.2.1
func (c AppVersions) Swap(i, j int)
Swap swaps the position of two items in the versions slice.
type Category ¶
type Category struct {
CategoryId string
Name string
Description string
Locale string
Owner string
CreateTime time.Time
UpdateTime *time.Time
}
func NewCategory ¶
type CategoryResource ¶
type CategoryResource struct {
CategoryId string
ResourceId string
Status string
CreateTime time.Time
StatusTime time.Time
}
func NewCategoryResource ¶
func NewCategoryResource(categoryId, resourceId, status string) *CategoryResource
type Cluster ¶
type Cluster struct {
Zone string
ClusterId string
Name string
Description string
AppId string
VersionId string
SubnetId string
VpcId string
FrontgateId string
ClusterType uint32
Endpoints string
Status string
TransitionStatus string
MetadataRootAccess bool
Owner string
GlobalUuid string
UpgradeStatus string
UpgradeTime *time.Time
RuntimeId string
CreateTime time.Time
StatusTime time.Time
}
func NewCluster ¶
func NewCluster() *Cluster
func PbToCluster ¶
type ClusterCommon ¶
type ClusterCommon struct {
ClusterId string
Role string
ServerIdUpperBound uint32
AdvancedActions string
InitService string
StartService string
StopService string
ScaleOutService string
ScaleInService string
RestartService string
DestroyService string
UpgradeService string
CustomService string
BackupService string
RestoreService string
DeleteSnapshotService string
HealthCheck string
Monitor string
Passphraseless string
VerticalScalingPolicy string
AgentInstalled bool
CustomMetadataScript string
ImageId string
BackupPolicy string
IncrementalBackupSupported bool
Hypervisor string
}
func PbToClusterCommon ¶
func PbToClusterCommon(pbClusterCommon *pb.ClusterCommon) *ClusterCommon
func (ClusterCommon) GetAttribute ¶
func (c ClusterCommon) GetAttribute(attributeName string) interface{}
type ClusterLink ¶
func PbToClusterLink ¶
func PbToClusterLink(pbClusterLink *pb.ClusterLink) *ClusterLink
type ClusterLoadbalancer ¶
type ClusterLoadbalancer struct {
ClusterId string
Role string
LoadbalancerListenerId string
LoadbalancerPort uint32
LoadbalancerPolicyId string
}
func PbToClusterLoadbalancer ¶
func PbToClusterLoadbalancer(pbClusterLoadbalancer *pb.ClusterLoadbalancer) *ClusterLoadbalancer
type ClusterNode ¶
type ClusterNode struct {
NodeId string
ClusterId string
Name string
InstanceId string
VolumeId string
Device string
SubnetId string
PrivateIp string
Eip string
ServerId uint32
Role string
Status string
TransitionStatus string
GroupId uint32
Owner string
GlobalServerId uint32
CustomMetadata string
PubKey string
HealthStatus string
IsBackup bool
AutoBackup bool
CreateTime time.Time
StatusTime time.Time
HostId string
HostIp string
}
func NewClusterNode ¶
func NewClusterNode() *ClusterNode
type ClusterNodeWithKeyPairs ¶ added in v0.1.8
type ClusterNodeWithKeyPairs struct {
*ClusterNode
KeyPairId []string
}
func PbToClusterNode ¶
func PbToClusterNode(pbClusterNode *pb.ClusterNode) *ClusterNodeWithKeyPairs
type ClusterRole ¶
type ClusterRole struct {
ClusterId string
Role string
Cpu uint32
Gpu uint32
Memory uint32
InstanceSize uint32
StorageSize uint32
MountPoint string
MountOptions string
FileSystem string
Env string
Replicas uint32
ReadyReplicas uint32
ApiVersion string
}
func PbToClusterRole ¶
func PbToClusterRole(pbClusterRole *pb.ClusterRole) *ClusterRole
type ClusterSnapshot ¶
type ClusterUpgradeAudit ¶
type ClusterWrapper ¶
type ClusterWrapper struct {
Cluster *Cluster
ClusterNodesWithKeyPairs map[string]*ClusterNodeWithKeyPairs // key=nodeId
ClusterCommons map[string]*ClusterCommon // key=role
ClusterLinks map[string]*ClusterLink // key=name
ClusterRoles map[string]*ClusterRole // key=role
ClusterLoadbalancers map[string][]*ClusterLoadbalancer // key=role
// contains filtered or unexported fields
}
func NewClusterWrapper ¶
func NewClusterWrapper(ctx context.Context, data string) (*ClusterWrapper, error)
func PbToClusterWrapper ¶
func PbToClusterWrapper(pbCluster *pb.Cluster) *ClusterWrapper
func (*ClusterWrapper) GetCommonAttribute ¶
func (c *ClusterWrapper) GetCommonAttribute(role, attributeName string) interface{}
func (*ClusterWrapper) GetEndpoints ¶
func (c *ClusterWrapper) GetEndpoints() (map[string]map[string]interface{}, error)
endpoints is in the following format:
{
"client_port": {
"port": 2181,
"protocol": "tcp"
},
"reserved_ips": {
"write_vip":{
},
"read_vip":{
}
}
}
where client_port is a developer-defined name. Port either is an integer or a reference to an env variable such as env.<port> or env.<role>.<port>. It may have multiple endpoints defined.
type CmdCnodes ¶
func NewCmdCnodes ¶
type Instance ¶
type Instance struct {
InstanceId string
NodeId string
Name string
ImageId string
Cpu int
Memory int
Gpu int
PrivateIp string
Eip string
VolumeId string
Device string
LoginPasswd string
Subnet string
NeedUserData int
UserDataValue string
UserdataFile string
Zone string
Status string
TransitionStatus string
RuntimeId string
TargetJobId string // target cloud job id
Timeout int `json:"timeout"`
Hostname string
}
func NewInstance ¶
type Job ¶
type KeyPairWithNodes ¶ added in v0.1.8
type Meta ¶
type NodeKeyPair ¶ added in v0.1.7
type NodeKeyPairDetail ¶ added in v0.1.7
type NodeKeyPairDetail struct {
NodeKeyPair *NodeKeyPair
ClusterNode *ClusterNode
KeyPair *KeyPair
}
type NodeKeyPairDetails ¶ added in v0.1.7
type NodeKeyPairDetails []NodeKeyPairDetail
func NewNodeKeyPairDetails ¶ added in v0.1.7
func NewNodeKeyPairDetails(data string) (NodeKeyPairDetails, error)
type Quotas ¶ added in v0.1.2
type Repo ¶
type RepoEvent ¶
type RepoEvent struct {
RepoEventId string
RepoId string
Status string
Result string
Owner string
CreateTime time.Time
StatusTime time.Time
}
func NewRepoEvent ¶
type RepoLabel ¶
type RepoLabel struct {
RepoLabelId string
RepoId string
LabelKey string
LabelValue string
CreateTime time.Time
}
func NewRepoLabel ¶
type RepoProvider ¶
type RepoSelector ¶
type RepoSelector struct {
RepoSelectorId string
RepoId string
SelectorKey string
SelectorValue string
CreateTime time.Time
}
func NewRepoSelector ¶
func NewRepoSelector(repoId, selectorKey, selectorValue string) *RepoSelector
type RoleResizeResource ¶ added in v0.2.1
type RoleResizeResources ¶ added in v0.2.1
type RoleResizeResources []*RoleResizeResource
func NewRoleResizeResources ¶ added in v0.2.1
func NewRoleResizeResources(data string) (RoleResizeResources, error)
type RoleResource ¶ added in v0.2.1
type RoleResource struct {
Role string
Cpu uint32
Gpu uint32
Memory uint32
InstanceSize uint32
StorageSize uint32
}
func PbToRoleResource ¶ added in v0.2.1
func PbToRoleResource(pbRoleResource *pb.RoleResource) *RoleResource
func (*RoleResource) IsSame ¶ added in v0.2.1
func (r *RoleResource) IsSame(clusterRole *ClusterRole) (bool, *RoleResizeResource)
type Runtime ¶
type Runtime struct {
RuntimeId string
Name string
Description string
Provider string
RuntimeUrl string
Zone string
RuntimeCredentialId string
Owner string
Status string
CreateTime time.Time
StatusTime time.Time
}
func NewRuntime ¶
func PbToRuntime ¶ added in v0.2.1
type RuntimeCredential ¶
func NewRuntimeCredential ¶
func NewRuntimeCredential(content string) *RuntimeCredential
type RuntimeLabel ¶
type RuntimeLabel struct {
RuntimeLabelId string
RuntimeId string
LabelKey string
LabelValue string
CreateTime time.Time
}
func NewRuntimeLabel ¶
func NewRuntimeLabel(runtimeId, labelKey, labelValue string) *RuntimeLabel
type Task ¶
type Task struct {
TaskId string
JobId string
TaskAction string
Directive string
Owner string
Status string
ErrorCode uint32
Executor string
Target string
NodeId string
FailureAllowed bool
CreateTime time.Time
StatusTime time.Time
}
type Volume ¶
Source Files
¶
- app.go
- app_version.go
- category.go
- category_resource.go
- cluster.go
- cluster_common.go
- cluster_link.go
- cluster_loadbalancer.go
- cluster_node.go
- cluster_role.go
- cluster_snapshot.go
- cluster_upgrade_audit.go
- cluster_wrapper.go
- cmd.go
- instance.go
- job.go
- key_pair.go
- meta.go
- node_key_pair.go
- quota.go
- repo.go
- repo_event.go
- repo_label.go
- repo_provider.go
- repo_selector.go
- role_resource.go
- runtime.go
- runtime_credential.go
- runtime_label.go
- subnet.go
- task.go
- task_layer.go
- volume.go
- vpc.go
Click to show internal directories.
Click to hide internal directories.