models

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 14 Imported by: 35

Documentation

Index

Constants

View Source
const (
	ColumnRepoId     = "repo_id"
	ColumnResouceId  = "resource_id"
	ColumnCategoryId = "category_id"

	ColumnTransitionStatus = "transition_status"

	ColumnName        = "name"
	ColumnDescription = "description"
	ColumnStatus      = "status"
	ColumnType        = "type"
	ColumnUrl         = "url"
	ColumnOwner       = "owner"
	ColumnLocale      = "locale"

	ColumnCreateTime = "create_time"
	ColumnStatusTime = "status_time"
	ColumnSequence   = "sequence"

	ColumnRepoLabelId = "repo_label_id"
	ColumnLabelKey    = "label_key"
	ColumnLabelValue  = "label_value"

	ColumnRepoSelectorId = "repo_selector_id"
	ColumnSelectorKey    = "selector_key"
	ColumnSelectorValue  = "selector_value"

	ColumnRepoEventId = "repo_event_id"

	ColumnRuntimeLabelId = "runtime_label_id"

	ColumnCredential = "credential"

	ColumnVisibility = "visibility"

	ColumnProvider = "provider"

	ColumnVersionId = "version_id"
	ColumnAppId     = "app_id"

	ColumnHome        = "home"
	ColumnIcon        = "icon"
	ColumnScreenshots = "screenshots"
	ColumnMaintainers = "maintainers"
	ColumnSources     = "sources"
	ColumnReadme      = "readme"
	ColumnChartName   = "chart_name"
	ColumnKeywords    = "keywords"
	ColumnPackageName = "package_name"

	ColumnJobId       = "job_id"
	ColumnClusterId   = "cluster_id"
	ColumnExecutor    = "executor"
	ColumnTaskId      = "task_id"
	ColumnRuntimeId   = "runtime_id"
	ColumnInstanceId  = "instance_id"
	ColumnVolumeId    = "volume_id"
	ColumnPrivateIp   = "private_ip"
	ColumnRole        = "role"
	ColumnFrontgateId = "frontgate_id"

	ColumnZone   = "zone"
	ColumnNodeId = "node_id"

	ColumnTaskAction = "task_action"
	ColumnJobAction  = "job_action"
	ColumnTarget     = "target"

	ColumnUpdateTime = "update_time"
)
View Source
const AppTableName = "app"
View Source
const AppVersionTableName = "app_version"
View Source
const CategoryResourceTableName = "category_resource"
View Source
const CategoryTableName = "category"
View Source
const ClusterCommonTableName = "cluster_common"
View Source
const ClusterLinkTableName = "cluster_link"
View Source
const ClusterLoadbalancerTableName = "cluster_loadbalancer"
View Source
const ClusterNodeTableName = "cluster_node"
View Source
const ClusterRoleTableName = "cluster_role"
View Source
const ClusterSnapshotTableName = "cluster_snapshot"
View Source
const ClusterTableName = "cluster"
View Source
const ClusterUpgradeAuditTableName = "cluster_upgrade_audit"
View Source
const JobTableName = "job"
View Source
const KeyPairTableName = "key_pair"
View Source
const NodeKeyPairTableName = "node_key_pair"
View Source
const RepoEventTableName = "repo_event"
View Source
const RepoLabelTableName = "repo_label"
View Source
const RepoProviderTableName = "repo_provider"
View Source
const RepoSelectorTableName = "repo_selector"
View Source
const RepoTableName = "repo"
View Source
const RuntimeCredentialPrifix = "runtimec-"
View Source
const RuntimeCredentialTableName = "runtime_credential"
View Source
const RuntimeIdPrefix = "runtime-"
View Source
const RuntimeLabelTableName = "runtime_label"
View Source
const RuntimeTableName = "runtime"
View Source
const TaskTableName = "task"
View Source
const UncategorizedId = "ctg-uncategorized"

Variables

View Source
var AppColumns = GetColumnsFromStruct(&App{})
View Source
var AppVersionColumns = GetColumnsFromStruct(&AppVersion{})
View Source
var CategoryColumns = GetColumnsFromStruct(&Category{})
View Source
var CategoryResourceColumns = GetColumnsFromStruct(&CategoryResource{})
View Source
var ClusterColumns = GetColumnsFromStruct(&Cluster{})
View Source
var ClusterCommonColumns = GetColumnsFromStruct(&ClusterCommon{})
View Source
var ClusterLinkColumns = GetColumnsFromStruct(&ClusterLink{})
View Source
var ClusterLoadbalancerColumns = GetColumnsFromStruct(&ClusterLoadbalancer{})
View Source
var ClusterNodeColumns = GetColumnsFromStruct(&ClusterNode{})
View Source
var ClusterRoleColumns = GetColumnsFromStruct(&ClusterRole{})
View Source
var ClusterSnapshotColumns = GetColumnsFromStruct(&ClusterSnapshot{})
View Source
var ClusterUpgradeAuditColumns = GetColumnsFromStruct(&ClusterUpgradeAudit{})

columns that can be search through sql '=' operator

View Source
var JobColumns = GetColumnsFromStruct(&Job{})
View Source
var KeyPairColumns = GetColumnsFromStruct(&KeyPair{})
View Source
var NodeKeyPairColumns = GetColumnsFromStruct(&NodeKeyPair{})
View Source
var PushEventTables = map[string][]string{
	RepoTableName: {
		ColumnRepoId, ColumnStatus, ColumnTransitionStatus,
	},
	RepoEventTableName: {
		ColumnRepoEventId, ColumnRepoId, ColumnStatus,
	},
	ClusterTableName: {
		ColumnClusterId, ColumnStatus, ColumnTransitionStatus,
	},
	ClusterNodeTableName: {
		ColumnNodeId, ColumnStatus, ColumnTransitionStatus,
	},
	JobTableName: {
		ColumnJobId, ColumnStatus, ColumnClusterId, ColumnAppId, ColumnAppId,
	},
}
View Source
var RepoColumns = GetColumnsFromStruct(&Repo{})
View Source
var RepoColumnsWithTablePrefix = GetColumnsFromStructWithPrefix(RepoTableName, &Repo{})
View Source
var RepoEventColumns = GetColumnsFromStruct(&RepoEvent{})
View Source
var RepoLabelColumns = GetColumnsFromStruct(&RepoLabel{})
View Source
var RepoProviderColumns = GetColumnsFromStruct(&RepoProvider{})
View Source
var RepoSelectorColumns = GetColumnsFromStruct(&RepoSelector{})
View Source
var RuntimeColumns = GetColumnsFromStruct(&Runtime{})
View Source
var RuntimeColumnsWithTablePrefix = GetColumnsFromStructWithPrefix(RuntimeTableName, &Runtime{})
View Source
var RuntimeCredentialColumns = GetColumnsFromStruct(&RuntimeCredential{})
View Source
var RuntimeLabelColumns = GetColumnsFromStruct(&RuntimeLabel{})

columns that can be search through sql 'like' operator

View Source
var TaskColumns = GetColumnsFromStruct(&Task{})

Functions

func AppToPb

func AppToPb(app *App) *pb.App

func AppVersionToPb

func AppVersionToPb(appVersion *AppVersion) *pb.AppVersion

func AppVersionsToPbs

func AppVersionsToPbs(appVersions []*AppVersion) (pbAppVersions []*pb.AppVersion)

func CategoriesToPbs

func CategoriesToPbs(categories []*Category) (pbCategories []*pb.Category)

func CategoryToPb

func CategoryToPb(category *Category) *pb.Category

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 ClusterToPb(cluster *Cluster) *pb.Cluster

func ClusterWrapperToPb

func ClusterWrapperToPb(clusterWrapper *ClusterWrapper) *pb.Cluster

func GetColumnsFromStruct

func GetColumnsFromStruct(s interface{}) []string

func GetColumnsFromStructWithPrefix

func GetColumnsFromStructWithPrefix(prefix string, s interface{}) []string

func JobToPb

func JobToPb(job *Job) *pb.Job

func JobsToPbs

func JobsToPbs(jobs []*Job) (pbJobs []*pb.Job)

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 NewAppId

func NewAppId() string

func NewAppVersionId

func NewAppVersionId() string

func NewCategoryId

func NewCategoryId() string

func NewClusterId

func NewClusterId() string

func NewClusterNodeId

func NewClusterNodeId() string

func NewJobId

func NewJobId() string

func NewKeyPairId added in v0.1.7

func NewKeyPairId() string

func NewRepoEventId

func NewRepoEventId() string

func NewRepoId

func NewRepoId() 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 NewTaskId

func NewTaskId() string

func NodeKeyPairToPb added in v0.1.7

func NodeKeyPairToPb(nodeKeyPair *NodeKeyPair) *pb.NodeKeyPair

func RepoEventToPb

func RepoEventToPb(repoTask *RepoEvent) *pb.RepoEvent

func RepoEventsToPbs

func RepoEventsToPbs(repoTasks []*RepoEvent) (pbRepoTasks []*pb.RepoEvent)

func RepoLabelToPb

func RepoLabelToPb(repoLabel *RepoLabel) *pb.RepoLabel

func RepoLabelsMap

func RepoLabelsMap(repoLabels []*RepoLabel) map[string][]*RepoLabel

func RepoLabelsToPbs

func RepoLabelsToPbs(repoLabels []*RepoLabel) (pbRepoLabels []*pb.RepoLabel)

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 RepoToPb

func RepoToPb(repo *Repo) *pb.Repo

func ReposToPbs

func ReposToPbs(repos []*Repo) (pbRepos []*pb.Repo)

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 RuntimeToPb(runtime *Runtime) *pb.Runtime

func RuntimeToPbs

func RuntimeToPbs(runtimes []*Runtime) (pbRuntimes []*pb.Runtime)

func TaskToPb

func TaskToPb(task *Task) *pb.Task

func TasksToPbs

func TasksToPbs(tasks []*Task) (pbTasks []*pb.Task)

func WithPrefix added in v0.1.7

func WithPrefix(prefix, str string) string

Types

type App

type App struct {
	AppId       string
	Name        string
	RepoId      string
	Description string
	Status      string
	Home        string
	Icon        string
	Screenshots string
	Maintainers string
	Keywords    string
	Sources     string
	Readme      string
	Owner       string
	ChartName   string
	CreateTime  time.Time
	StatusTime  time.Time
	UpdateTime  *time.Time
}

func NewApp

func NewApp(name, repoId, description, owner, chartName string) *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) Len added in v0.2.1

func (c AppVersions) Len() int

Len returns the length.

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

func NewCategory(name, locale, description, owner string) *Category

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

func PbToCluster(pbCluster *pb.Cluster) *Cluster

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 struct {
	ClusterId         string
	Name              string
	ExternalClusterId string
	Owner             string
}
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 ClusterSnapshot struct {
	SnapshotId string
	Role       string
	ServerIds  string

	AppId            string
	VersionId        string
	ChildSnapshotIds string
	Size             int32
	// contains filtered or unexported fields
}

type ClusterUpgradeAudit

type ClusterUpgradeAudit struct {
	ClusterUpgradeAuditId string
	ClusterId             string
	FromVersionId         string
	ToVersionId           string
	ServiceParams         string
	CreateTime            time.Time
	StatusTime            time.Time
	Status                string
	Owner                 string
}

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 Cmd

type Cmd struct {
	Id      string `json:"id"`
	Cmd     string `json:"cmd"`
	Timeout int    `json:"timeout"`
}

type CmdCnodes

type CmdCnodes map[string]map[string]*Cmd

func NewCmdCnodes

func NewCmdCnodes(data string) (*CmdCnodes, error)

func (CmdCnodes) Format

func (c CmdCnodes) Format(ip, taskId string) error

type Eip

type Eip struct {
	EipId string
	Name  string
	Addr  string
}

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

func NewInstance(data string) (*Instance, error)

type Job

type Job struct {
	JobId      string
	ClusterId  string
	AppId      string
	VersionId  string
	JobAction  string
	Directive  string
	Provider   string
	Owner      string
	Status     string
	ErrorCode  uint32
	Executor   string
	RuntimeId  string
	TaskCount  uint32
	CreateTime time.Time
	StatusTime time.Time
}

func NewJob

func NewJob(jobId, clusterId, appId, versionId, jobAction, directive, provider, userId, runtimeId string) *Job

type KeyPair added in v0.1.7

type KeyPair struct {
	KeyPairId   string
	Name        string
	Description string
	PubKey      string
	Owner       string
	CreateTime  time.Time
	StatusTime  time.Time
}

type KeyPairWithNodes added in v0.1.8

type KeyPairWithNodes struct {
	*KeyPair
	NodeId []string
}

type Meta

type Meta struct {
	FrontgateId string `json:"frontgate_id"`
	Timeout     int    `json:"timeout"`
	Cnodes      string `json:"cnodes"`
	DroneIp     string `json:"drone_ip"`
	NodeId      string `json:"node_id"`
	ClusterId   string `json:"cluster_id"`
}

func NewMeta

func NewMeta(data string) (*Meta, error)

type NodeKeyPair added in v0.1.7

type NodeKeyPair struct {
	KeyPairId string
	NodeId    string
}

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 Quota added in v0.1.2

type Quota struct {
	Name  string
	Count int
}

type Quotas added in v0.1.2

type Quotas struct {
	Instance   *Quota
	Cpu        *Quota
	Gpu        *Quota
	Memory     *Quota
	Volume     *Quota
	VolumeSize *Quota
}

func NewQuotas added in v0.1.2

func NewQuotas() *Quotas

func (*Quotas) LessThan added in v0.1.2

func (p *Quotas) LessThan(quotas *Quotas) error

type Repo

type Repo struct {
	RepoId      string
	Name        string
	Description string
	Type        string
	Url         string
	Credential  string
	Visibility  string
	Owner       string

	Status     string
	CreateTime time.Time
	StatusTime time.Time
}

func NewRepo

func NewRepo(name, description, typ, url, credential, visibility, owner string) *Repo

type RepoEvent

type RepoEvent struct {
	RepoEventId string
	RepoId      string
	Status      string
	Result      string
	Owner       string
	CreateTime  time.Time
	StatusTime  time.Time
}

func NewRepoEvent

func NewRepoEvent(repoId, owner string) *RepoEvent

type RepoLabel

type RepoLabel struct {
	RepoLabelId string
	RepoId      string
	LabelKey    string
	LabelValue  string

	CreateTime time.Time
}

func NewRepoLabel

func NewRepoLabel(repoId, labelKey, labelValue string) *RepoLabel

type RepoProvider

type RepoProvider struct {
	RepoId   string
	Provider string
}

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 RoleResizeResource struct {
	Role         string
	Cpu          bool
	Gpu          bool
	Memory       bool
	InstanceSize bool
	StorageSize  bool
}

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 NewRuntime(name, description, provider, runtimeUrl, runtimeCredentialId, zone, owner string) *Runtime

func PbToRuntime added in v0.2.1

func PbToRuntime(pbRuntime *pb.Runtime) *Runtime

type RuntimeCredential

type RuntimeCredential struct {
	RuntimeCredentialId string
	Content             string
	CreateTime          time.Time
}

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 Subnet

type Subnet struct {
	Zone        string
	SubnetId    string
	Name        string
	CreateTime  time.Time
	Description string
	InstanceIds []string
	VpcId       string
}

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
}

func NewTask

func NewTask(taskId, jobId, nodeId, target, taskAction, directive, userId string, failureAllowed bool) *Task

func (*Task) GetTimeout

func (t *Task) GetTimeout(defaultTimeout time.Duration) time.Duration

type TaskLayer

type TaskLayer struct {
	Tasks []*Task
	Child *TaskLayer
}

func (*TaskLayer) Append

func (t *TaskLayer) Append(target *TaskLayer) *TaskLayer

func (*TaskLayer) IsLeaf

func (t *TaskLayer) IsLeaf() bool

func (*TaskLayer) Leaf

func (t *TaskLayer) Leaf() *TaskLayer

func (*TaskLayer) WalkTree

func (t *TaskLayer) WalkTree(cb WalkFunc)

type Volume

type Volume struct {
	VolumeId         string
	NodeId           string
	InstanceId       string
	Device           string
	MountPoint       string
	MountOptions     string
	FileSystem       string
	Name             string
	Size             int
	Status           string
	TransitionStatus string
	Zone             string
	RuntimeId        string
	TargetJobId      string // target cloud job id
	Timeout          int    `json:"timeout"`
}

func NewVolume

func NewVolume(data string) (*Volume, error)

type Vpc

type Vpc struct {
	VpcId            string
	Name             string
	CreateTime       time.Time
	Description      string
	Status           string
	TransitionStatus string
	Subnets          []string
	Eip              *Eip
}

type WalkFunc

type WalkFunc func(parent *TaskLayer, current *TaskLayer)

WalkFunc is a callback type for use with TaskLayer.WalkTree

Jump to

Keyboard shortcuts

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