models

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const AttachmentIdPrefix = "att-"
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 AppVersionAuditColumns = db.GetColumnsFromStruct(&AppVersionAudit{})
View Source
var AppVersionColumns = db.GetColumnsFromStruct(&AppVersion{})
View Source
var AppVersionReviewColumns = db.GetColumnsFromStruct(&AppVersionReview{})
View Source
var AttachmentColumns = db.GetColumnsFromStruct(&Attachment{})
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 MarketColumns = db.GetColumnsFromStruct(&Market{})
View Source
var MarketUserColumns = db.GetColumnsFromStruct(&MarketUser{})
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 RuntimeCredentialColumns = db.GetColumnsFromStruct(&RuntimeCredential{})
View Source
var TaskColumns = db.GetColumnsFromStruct(&Task{})
View Source
var TokenColumns = db.GetColumnsFromStruct(&Token{})
View Source
var UserClientColumns = db.GetColumnsFromStruct(&UserClient{})
View Source
var UserPasswordResetColumns = db.GetColumnsFromStruct(&UserPasswordReset{})

Functions

func AppToPb

func AppToPb(app *App) *pb.App

func AppVersionAuditToPb added in v0.4.0

func AppVersionAuditToPb(appVersionAudit *AppVersionAudit) *pb.AppVersionAudit

func AppVersionAuditsToPbs added in v0.4.0

func AppVersionAuditsToPbs(appVersionAudits []*AppVersionAudit) (pbAppVersionAudits []*pb.AppVersionAudit)

func AppVersionReviewToPb added in v0.4.0

func AppVersionReviewToPb(versionReview *AppVersionReview) *pb.AppVersionReview

func AppVersionReviewsToPbs added in v0.4.0

func AppVersionReviewsToPbs(versionReviews AppVersionReviews) (pbAppVersionReviews []*pb.AppVersionReview)

func AppVersionToPb

func AppVersionToPb(appVersion *AppVersion) *pb.AppVersion

func AppVersionsToPbs

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

func AttachmentToPb added in v0.4.0

func AttachmentToPb(attachment *Attachment) *pb.Attachment

func AttachmentsToPbs added in v0.4.0

func AttachmentsToPbs(attachments []*Attachment) (pbAttachments []*pb.Attachment)

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 EipToPb added in v0.4.0

func EipToPb(eip *Eip) *pb.Eip

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 MarketToPb added in v0.3.3

func MarketToPb(market *Market) *pb.Market

func MarketToPbs added in v0.3.3

func MarketToPbs(markets []*Market) (pbMarkets []*pb.Market)

func MarketUserToPb added in v0.3.3

func MarketUserToPb(marketUser *MarketUser) *pb.MarketUser

func MarketUserToPbs added in v0.3.3

func MarketUserToPbs(marketUsers []*MarketUser) (pbMarketUsers []*pb.MarketUser)

func NewAppId

func NewAppId() string

func NewAppVersionId

func NewAppVersionId() string

func NewAppVersionReviewId added in v0.4.0

func NewAppVersionReviewId() string

func NewAttachmentId added in v0.4.0

func NewAttachmentId() 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 NewMarketId added in v0.3.3

func NewMarketId() string

func NewRepoEventId

func NewRepoEventId() string

func NewRepoId

func NewRepoId() string

func NewRepoLabelId

func NewRepoLabelId() string

func NewRepoSelectorId

func NewRepoSelectorId() string

func NewRuntimeCredentialId added in v0.4.0

func NewRuntimeCredentialId() string

func NewRuntimeId

func NewRuntimeId() string

func NewTaskId

func NewTaskId() string

func NewTokenId added in v0.2.3

func NewTokenId() string

func NewUserClientId added in v0.2.3

func NewUserClientId() string

func NewUserPasswordResetId added in v0.2.3

func NewUserPasswordResetId() 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 RuntimeCredentialToPb added in v0.4.0

func RuntimeCredentialToPb(runtimeCredential *RuntimeCredential) *pb.RuntimeCredential

func RuntimeCredentialToPbs added in v0.4.0

func RuntimeCredentialToPbs(runtimeCredentials []*RuntimeCredential) (pbRuntimeCredentials []*pb.RuntimeCredential)

func RuntimeToPb

func RuntimeToPb(runtime *Runtime) *pb.Runtime

func RuntimeToPbs

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

func SubnetToPb added in v0.4.0

func SubnetToPb(subnet *Subnet) *pb.Subnet

func SubnetsToPbs added in v0.4.0

func SubnetsToPbs(subnets []*Subnet) (pbSubnets []*pb.Subnet)

func TaskLayerToPb added in v0.4.0

func TaskLayerToPb(taskLayer *TaskLayer) *pb.TaskLayer

func TaskToPb

func TaskToPb(task *Task) *pb.Task

func TasksToPbs

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

func ToAmActionBundles added in v0.4.0

func ToAmActionBundles(ps []*pb.ActionBundle) []*pbam.ActionBundle

func ToAmApis added in v0.4.0

func ToAmApis(ps []*pb.Api) []*pbam.Api

func ToAmFeatures added in v0.4.0

func ToAmFeatures(ps []*pb.Feature) []*pbam.Feature

func ToAmModule added in v0.4.0

func ToAmModule(p *pb.Module) *pbam.Module

func ToAmModuleElems added in v0.4.0

func ToAmModuleElems(ps []*pb.ModuleElem) []*pbam.ModuleElem

func ToPbActionBundles added in v0.4.0

func ToPbActionBundles(ps []*pbam.ActionBundle) []*pb.ActionBundle

func ToPbApis added in v0.4.0

func ToPbApis(ps []*pbam.Api) []*pb.Api

func ToPbFeatures added in v0.4.0

func ToPbFeatures(ps []*pbam.Feature) []*pb.Feature

func ToPbGroup added in v0.4.0

func ToPbGroup(group *pbim.Group) *pb.Group

func ToPbGroups added in v0.4.0

func ToPbGroups(groups []*pbim.Group) []*pb.Group

func ToPbModule added in v0.4.0

func ToPbModule(p *pbam.Module) *pb.Module

func ToPbModuleElems added in v0.4.0

func ToPbModuleElems(ps []*pbam.ModuleElem) []*pb.ModuleElem

func ToPbRole added in v0.4.0

func ToPbRole(role *pbam.Role) *pb.Role

func ToPbRoles added in v0.4.0

func ToPbRoles(roles []*pbam.Role) []*pb.Role

func ToPbUser added in v0.4.0

func ToPbUser(user *pbim.User) *pb.User

func ToPbUsers added in v0.4.0

func ToPbUsers(users []*pbim.User) []*pb.User

func UniqueAddresses added in v0.4.0

func UniqueAddresses(addresses []string) []string

func VendorStatisticsSetToPbSet added in v0.4.0

func VendorStatisticsSetToPbSet(vendorStatisticsSet []*VendorStatistics) []*pb.VendorStatistics

func VendorStatisticsToPb added in v0.4.0

func VendorStatisticsToPb(vendorStatistics *VendorStatistics) *pb.VendorStatistics

func VendorVerifyInfoSetToPbSet added in v0.4.0

func VendorVerifyInfoSetToPbSet(inVendors []*VendorVerifyInfo) []*pb.VendorVerifyInfo

func VendorVerifyInfoToPb added in v0.4.0

func VendorVerifyInfoToPb(inVendor *VendorVerifyInfo) *pb.VendorVerifyInfo

func VpcToPb added in v0.4.0

func VpcToPb(vpc *Vpc) *pb.Vpc

Types

type App

type App struct {
	AppId       string
	Active      bool
	Name        string
	RepoId      string
	Description string
	Status      string
	Home        string
	Icon        string
	Screenshots string
	Maintainers string
	Keywords    string
	Sources     string
	Readme      string
	Owner       string
	OwnerPath   sender.OwnerPath
	ChartName   string
	Tos         string
	Abstraction string
	Isv         string
	CreateTime  time.Time
	StatusTime  time.Time
	UpdateTime  *time.Time
}

func NewApp

func NewApp(name string, ownerPath sender.OwnerPath, isv string) *App

type AppVersion

type AppVersion struct {
	VersionId   string
	Active      bool
	AppId       string
	Owner       string
	OwnerPath   sender.OwnerPath
	Name        string
	Description string
	PackageName string
	Home        string
	Icon        string
	Screenshots string
	Maintainers string
	Keywords    string
	Sources     string
	Readme      string
	Status      string
	ReviewId    string
	Message     string
	Type        string
	Sequence    uint32
	CreateTime  time.Time
	StatusTime  time.Time
	UpdateTime  *time.Time
}

func NewAppVersion

func NewAppVersion(appId, name, description string, ownerPath sender.OwnerPath) *AppVersion

func (AppVersion) GetSemver added in v0.2.1

func (v AppVersion) GetSemver() string

type AppVersionAudit added in v0.4.0

type AppVersionAudit struct {
	VersionId    string
	AppId        string
	Status       string
	Operator     string
	OperatorType string
	Message      string
	Owner        string
	OwnerPath    sender.OwnerPath
	ReviewId     string
	StatusTime   time.Time
}

func NewAppVersionAudit added in v0.4.0

func NewAppVersionAudit(versionId, appId, status, operator, operatorType string, ownerPath sender.OwnerPath) *AppVersionAudit

type AppVersionReview added in v0.4.0

type AppVersionReview struct {
	ReviewId   string
	VersionId  string
	AppId      string
	OwnerPath  sender.OwnerPath
	Owner      string
	Status     string
	Phase      AppVersionReviewPhases
	StatusTime time.Time
	Reviewer   string
}

func NewAppVersionReview added in v0.4.0

func NewAppVersionReview(versionId, appId, status string, ownerPath sender.OwnerPath) *AppVersionReview

func (*AppVersionReview) UpdatePhase added in v0.4.0

func (avr *AppVersionReview) UpdatePhase(operatorType, status, operator, message string)

type AppVersionReviewPhase added in v0.4.0

type AppVersionReviewPhase struct {
	Status       string
	Operator     string
	OperatorType string
	Message      string
	ReviewTime   time.Time
	StatusTime   time.Time
}

type AppVersionReviewPhases added in v0.4.0

type AppVersionReviewPhases map[string]AppVersionReviewPhase

func (*AppVersionReviewPhases) Scan added in v0.4.0

func (p *AppVersionReviewPhases) Scan(value interface{}) error

func (AppVersionReviewPhases) Value added in v0.4.0

Value implements the driver Valuer interface.

type AppVersionReviews added in v0.4.0

type AppVersionReviews []*AppVersionReview

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 Attachment added in v0.4.0

type Attachment struct {
	AttachmentId string
	CreateTime   time.Time
}

func NewAttachment added in v0.4.0

func NewAttachment() *Attachment

func (Attachment) GetObjectName added in v0.4.0

func (a Attachment) GetObjectName(filename string) string

func (Attachment) GetObjectPrefix added in v0.4.0

func (a Attachment) GetObjectPrefix() string

func (Attachment) RemoveObjectName added in v0.4.0

func (a Attachment) RemoveObjectName(filenameWithPrefix string) string

type Category

type Category struct {
	CategoryId  string
	Name        string
	Description string
	Locale      string
	OwnerPath   sender.OwnerPath
	Owner       string
	Icon        string
	CreateTime  time.Time
	UpdateTime  *time.Time
}

func NewCategory

func NewCategory(name, locale, description string, ownerPath sender.OwnerPath) *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
	OwnerPath          sender.OwnerPath
	GlobalUuid         string
	UpgradeStatus      string
	UpgradeTime        *time.Time
	RuntimeId          string
	CreateTime         time.Time
	StatusTime         time.Time
	AdditionalInfo     string
	Env                string
	Debug              bool
}

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
	OwnerPath         sender.OwnerPath
}
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
	OwnerPath        sender.OwnerPath
	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
	OwnerPath             sender.OwnerPath
}

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"`
}

func NewCmd added in v0.4.0

func NewCmd(data string) (*Cmd, error)

type CmdCnodes

type CmdCnodes struct {
	RootPath   string
	ClusterId  string
	CmdKey     string
	InstanceId string
	Cmd        *Cmd
}

func NewCmdCnodes

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

func (*CmdCnodes) Format

func (c *CmdCnodes) Format() map[string]interface{}
{
  	clusters: {
		<cluster_id>: {
			cmd: {
				<instance_id>: <cmd>
			}
		}
	}
}

type Eip

type Eip struct {
	EipId string
	Name  string
	Addr  string
}

func PbToEip added in v0.4.0

func PbToEip(pbEip *pb.Eip) *Eip

type EmailNotification added in v0.4.0

type EmailNotification struct {
	Title       string
	Content     string
	Owner       string
	ContentType string
	Addresses   []string
}

func UniqueEmailNotifications added in v0.4.0

func UniqueEmailNotifications(emailNotifications []*EmailNotification) []*EmailNotification

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
	OwnerPath  sender.OwnerPath
	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 string, ownerPath sender.OwnerPath, runtimeId string) *Job

func PbToJob added in v0.4.0

func PbToJob(pbJob *pb.Job) *Job

type KeyPair added in v0.1.7

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

type KeyPairWithNodes added in v0.1.8

type KeyPairWithNodes struct {
	*KeyPair
	NodeId []string
}

type Market added in v0.3.3

type Market struct {
	MarketId    string
	Name        string
	Visibility  string
	Status      string
	Owner       string
	OwnerPath   sender.OwnerPath
	Description string
	CreateTime  time.Time
	StatusTime  time.Time
}

func NewMarket added in v0.3.3

func NewMarket(name, visibility, status, description string, ownerPath sender.OwnerPath) *Market

type MarketUser added in v0.3.3

type MarketUser struct {
	MarketId   string
	UserId     string
	Owner      string
	OwnerPath  sender.OwnerPath
	CreateTime time.Time
}

func NewMarketUser added in v0.3.3

func NewMarketUser(marketId, userId string, ownerPath sender.OwnerPath) *MarketUser

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
	OwnerPath        sender.OwnerPath
	AppDefaultStatus string
	Controller       int8

	Status     string
	CreateTime time.Time
	StatusTime time.Time
}

func NewRepo

func NewRepo(name, description, typ, url, credential, visibility string, ownerPath sender.OwnerPath) *Repo

type RepoEvent

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

func NewRepoEvent

func NewRepoEvent(repoId string, ownerPath sender.OwnerPath) *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
	Zone                string
	RuntimeCredentialId string
	Owner               string
	OwnerPath           sender.OwnerPath
	Status              string
	Debug               bool
	CreateTime          time.Time
	StatusTime          time.Time
}

func NewRuntime

func NewRuntime(runtimeId, name, description, provider, runtimeCredentialId, zone string, ownerPath sender.OwnerPath, debug bool) *Runtime

func PbToRuntime added in v0.2.1

func PbToRuntime(pbRuntime *pb.Runtime) *Runtime

type RuntimeCredential

type RuntimeCredential struct {
	RuntimeCredentialId      string
	Name                     string
	Description              string
	RuntimeUrl               string
	RuntimeCredentialContent string
	Owner                    string
	OwnerPath                sender.OwnerPath
	Provider                 string
	Status                   string
	Debug                    bool
	CreateTime               time.Time
	StatusTime               time.Time
}

func NewRuntimeCredential

func NewRuntimeCredential(runtimeCredentialId, name, description, runtimeUrl, runtimeCredentialContent, provider string, ownerPath sender.OwnerPath, debug bool) *RuntimeCredential

func PbToRuntimeCredential added in v0.4.0

func PbToRuntimeCredential(pbRuntimeCredential *pb.RuntimeCredential) *RuntimeCredential

type RuntimeDetails added in v0.4.0

type RuntimeDetails struct {
	Runtime
	RuntimeCredential
}

type Subnet

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

func PbToSubnet added in v0.4.0

func PbToSubnet(pbSubnet *pb.Subnet) *Subnet

type Task

type Task struct {
	TaskId         string
	JobId          string
	TaskAction     string
	Directive      string
	Owner          string
	OwnerPath      sender.OwnerPath
	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 string, ownerPath sender.OwnerPath, failureAllowed bool) *Task

func PbToTask added in v0.4.0

func PbToTask(pbTask *pb.Task) *Task

func PbsToTasks added in v0.4.0

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

func (*Task) GetTimeout

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

type TaskLayer

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

func PbToTaskLayer added in v0.4.0

func PbToTaskLayer(pbTaskLayer *pb.TaskLayer) *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 Token added in v0.2.3

type Token struct {
	TokenId      string
	ClientId     string
	RefreshToken string
	Scope        string
	UserId       string
	Status       string
	CreateTime   time.Time
	StatusTime   time.Time
}

func NewToken added in v0.2.3

func NewToken(clientId, userId, scope string) *Token

type UserClient added in v0.2.3

type UserClient struct {
	ClientId     string
	UserId       string
	ClientSecret string
	Status       string
	Description  string
	CreateTime   time.Time
}

func NewUserClient added in v0.2.3

func NewUserClient(userId string) *UserClient

type UserPasswordReset added in v0.2.3

type UserPasswordReset struct {
	ResetId string
	UserId  string

	Status     string
	CreateTime time.Time
}

func NewUserPasswordReset added in v0.2.3

func NewUserPasswordReset(userId string) *UserPasswordReset

type VendorStatistics added in v0.4.0

type VendorStatistics struct {
	UserId            string
	CompanyName       string
	ActiveAppCount    uint32
	ClusterCountMonth uint32
	ClusterCountTotal uint32
}

type VendorVerifyInfo added in v0.4.0

type VendorVerifyInfo struct {
	UserId            string
	CompanyName       string
	CompanyWebsite    string
	CompanyProfile    string
	AuthorizerName    string
	AuthorizerEmail   string
	AuthorizerPhone   string
	BankName          string
	BankAccountName   string
	BankAccountNumber string
	Status            string
	RejectMessage     string
	Approver          string
	Owner             string
	OwnerPath         sender.OwnerPath
	SubmitTime        *time.Time
	StatusTime        time.Time
}

func ReqToVendorVerifyInfo added in v0.4.0

func ReqToVendorVerifyInfo(ctx context.Context, req *pb.SubmitVendorVerifyInfoRequest) *VendorVerifyInfo

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
}

func PbToVpc added in v0.4.0

func PbToVpc(pbVpc *pb.Vpc) *Vpc

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