model

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GovernanceModeBuildInServiceMesh means the governance mode is BUILD_IN_SERVICE_MESH
	GovernanceModeBuildInServiceMesh = "BUILD_IN_SERVICE_MESH"
	// GovernanceModeKubernetesNativeService means the governance mode is KUBERNETES_NATIVE_SERVICE
	GovernanceModeKubernetesNativeService = "KUBERNETES_NATIVE_SERVICE"
	// GovernanceModeIstioServiceMesh means the governance mode is ISTIO_SERVICE_MESH
	GovernanceModeIstioServiceMesh = "ISTIO_SERVICE_MESH"
)
View Source
const (
	AppTypeWutong = "wutong"
	AppTypeHelm   = "helm"
)

app type

View Source
const ASYNEVENTTYPE = 0

ASYNEVENTTYPE asyn event type

View Source
const SYNEVENTTYPE = 1

SYNEVENTTYPE syn event type

View Source
const TargetTypePod = "pod"

TargetTypePod -

View Source
const TargetTypeService = "service"

TargetTypeService service target

View Source
const TargetTypeTenantEnv = "tenant_env"

TargetTypeTenantEnv tenant env target

View Source
const UsernameSystem = "system"

UsernameSystem -

Variables

View Source
var ALLPOWER = "all_power"

ALLPOWER ALLPOWER

View Source
var DbgatePlugin = "dbgate-plugin"

DbgatePlugin 数据中间件管理插件

View Source
var GeneralPlugin = "general-plugin"

GeneralPlugin 一般插件,默认分类,优先级最低

View Source
var HTTPGROUP = "http"

HTTPGROUP HTTPGROUP

View Source
var InBoundAndOutBoundNetPlugin = "net-plugin:in-and-out"

InBoundAndOutBoundNetPlugin 出站和入站治理

View Source
var InBoundNetPlugin = "net-plugin:up"

InBoundNetPlugin 入站治理网络插件

View Source
var InitPlugin = "init-plugin"

InitPlugin 初始化插件

View Source
var LabelKeyNodeAffinity = "node-affinity"

LabelKeyNodeAffinity 节点亲和标签

View Source
var LabelKeyNodeSelector = "node-selector"

LabelKeyNodeSelector 节点选择标签

View Source
var LabelKeyServiceAffinity = "service-affinity"

LabelKeyServiceAffinity 应用亲和标签

View Source
var LabelKeyServiceAntyAffinity = "service-anti-affinity"

LabelKeyServiceAntyAffinity 应用反亲和标签

View Source
var LabelKeyServicePrivileged = "privileged"

LabelKeyServicePrivileged -

View Source
var LabelKeyServiceType = "service-type"

LabelKeyServiceType 应用部署类型标签 TODO fanyangyang 待删除,组件类型记录在tenant_env_service表中

View Source
var MYSQLPROTOCOL = "mysql"

MYSQLPROTOCOL MYSQLPROTOCOL

View Source
var NODEMANAGER = "node_manager"

NODEMANAGER NODEMANAGER

View Source
var OutBoundNetPlugin = "net-plugin:down"

OutBoundNetPlugin 出站治理网络插件

View Source
var SERVERSOURCE = "server_source"

SERVERSOURCE SERVERSOURCE

View Source
var STREAMGROUP = "stream"

STREAMGROUP STREAMGROUP

View Source
var TCPPROTOCOL = "tcp"

TCPPROTOCOL TCPPROTOCOL

View Source
var TypeDeployment = "deployment"

TypeDeployment typedeployment

View Source
var TypeReplicationController = "replicationcontroller"

TypeReplicationController type rc

View Source
var TypeStatefulSet = "statefulset"

TypeStatefulSet typestateful

View Source
var UDPPROTOCOL = "udp"

UDPPROTOCOL UDPPROTOCOL

View Source
var V2VERSION = "v2"

V2VERSION region version

Functions

This section is empty.

Types

type AppBackup

type AppBackup struct {
	Model
	EventID  string `gorm:"column:event_id;size:32;" json:"event_id"`
	BackupID string `gorm:"column:backup_id;size:32;" json:"backup_id"`
	GroupID  string `gorm:"column:group_id;size:32;" json:"group_id"`
	//Status in starting,failed,success,restore
	Status        string `gorm:"column:status;size:32" json:"status"`
	Version       string `gorm:"column:version;size:32" json:"version"`
	SourceDir     string `gorm:"column:source_dir;size:255" json:"source_dir"`
	SourceType    string `gorm:"column:source_type;size:255;default:'local'" json:"source_type"`
	BackupMode    string `gorm:"column:backup_mode;size:32" json:"backup_mode"`
	BuckupSize    int64  `gorm:"column:backup_size;type:bigint" json:"backup_size"`
	Deleted       bool   `gorm:"column:deleted" json:"deleted"`
	WithImageData bool   `gorm:"column:with_image_data" json:"with_image_data"`
}

AppBackup app backup info

func (*AppBackup) TableName

func (t *AppBackup) TableName() string

TableName 表名

type AppStatus

type AppStatus struct {
	EventID     string `gorm:"column:event_id;size:32;primary_key" json:"event_id"`
	Format      string `gorm:"column:format;size:32" json:"format"` // only wutong-app/docker-compose
	SourceDir   string `gorm:"column:source_dir;size:255" json:"source_dir"`
	Apps        string `gorm:"column:apps;type:text" json:"apps"`
	Status      string `gorm:"column:status;size:32" json:"status"` // only exporting/importing/failed/success/cleaned
	TarFileHref string `gorm:"column:tar_file_href;size:255" json:"tar_file_href"`
	Metadata    string `gorm:"column:metadata;type:text" json:"metadata"`
}

AppStatus app status

func (*AppStatus) TableName

func (t *AppStatus) TableName() string

TableName 表名

type Application

type Application struct {
	Model
	TenantEnvID     string `gorm:"column:tenant_env_id" json:"tenant_env_id"`
	AppName         string `gorm:"column:app_name" json:"app_name"`
	AppID           string `gorm:"column:app_id" json:"app_id"`
	AppType         string `gorm:"column:app_type;default:'wutong'" json:"app_type"`
	AppStoreName    string `gorm:"column:app_store_name" json:"app_store_name"`
	AppStoreURL     string `gorm:"column:app_store_url" json:"app_store_url"`
	AppTemplateName string `gorm:"column:app_template_name" json:"app_template_name"`
	Version         string `gorm:"column:version" json:"version"`
	GovernanceMode  string `gorm:"column:governance_mode;default:'BUILD_IN_SERVICE_MESH'" json:"governance_mode"`
	K8sApp          string `gorm:"column:k8s_app" json:"k8s_app"`
}

Application -

func (*Application) TableName

func (t *Application) TableName() string

TableName return tableName "application"

type ApplicationConfigGroup

type ApplicationConfigGroup struct {
	Model
	AppID           string `gorm:"column:app_id" json:"app_id"`
	ConfigGroupName string `gorm:"column:config_group_name" json:"config_group_name"`
	DeployType      string `gorm:"column:deploy_type;default:'env'" json:"deploy_type"`
	Enable          bool   `gorm:"column:enable" json:"enable"`
}

ApplicationConfigGroup -

func (*ApplicationConfigGroup) TableName

func (t *ApplicationConfigGroup) TableName() string

TableName return tableName "application"

type Certificate

type Certificate struct {
	Model
	UUID            string `gorm:"column:uuid"`
	CertificateName string `gorm:"column:certificate_name;size:128"`
	Certificate     string `gorm:"column:certificate;size:65535"`
	PrivateKey      string `gorm:"column:private_key;size:65535"`
}

Certificate contains TLS information

func (Certificate) TableName

func (Certificate) TableName() string

TableName returns table name of Certificate

type CodeCheckResult

type CodeCheckResult struct {
	Model
	ServiceID       string `gorm:"column:service_id;size:70"`
	Condition       string `gorm:"column:condition"`
	Language        string `gorm:"column:language"`
	CheckType       string `gorm:"column:check_type"`
	GitURL          string `gorm:"column:git_url"`
	CodeVersion     string `gorm:"column:code_version"`
	GitProjectId    string `gorm:"column:git_project_id"`
	CodeFrom        string `gorm:"column:code_from"`
	URLRepos        string `gorm:"column:url_repos"`
	DockerFileReady bool   `gorm:"column:docker_file_ready"`
	InnerPort       string `gorm:"column:inner_port"`
	VolumeMountPath string `gorm:"column:volume_mount_path"`
	BuildImageName  string `gorm:"column:image"`
	PortList        string `gorm:"column:port_list"`
	VolumeList      string `gorm:"column:volume_list"`
}

CodeCheckResult codecheck result struct

func (*CodeCheckResult) TableName

func (t *CodeCheckResult) TableName() string

TableName 表名

type ConfigGroupItem

type ConfigGroupItem struct {
	Model
	AppID           string `gorm:"column:app_id" json:"-"`
	ConfigGroupName string `gorm:"column:config_group_name" json:"-"`
	ItemKey         string `gorm:"column:item_key" json:"item_key"`
	ItemValue       string `gorm:"column:item_value" json:"item_value"`
}

ConfigGroupItem -

func (*ConfigGroupItem) TableName

func (t *ConfigGroupItem) TableName() string

TableName return tableName "application"

type ConfigGroupService

type ConfigGroupService struct {
	Model
	AppID           string `gorm:"column:app_id" json:"-"`
	ConfigGroupName string `gorm:"column:config_group_name" json:"-"`
	ServiceID       string `gorm:"column:service_id" json:"service_id"`
	ServiceAlias    string `gorm:"column:service_alias" json:"service_alias"`
}

ConfigGroupService -

func (*ConfigGroupService) TableName

func (t *ConfigGroupService) TableName() string

TableName return tableName "application"

type DiscorveryType

type DiscorveryType string

DiscorveryType type of service discovery center.

var DiscorveryTypeEtcd DiscorveryType = "etcd"

DiscorveryTypeEtcd etcd

var DiscorveryTypeKubernetes DiscorveryType = "kubernetes"

DiscorveryTypeKubernetes kubernetes service

func (DiscorveryType) String

func (d DiscorveryType) String() string

type Endpoint

type Endpoint struct {
	Model
	UUID      string `gorm:"column:uuid;size:32" json:"uuid"`
	ServiceID string `gorm:"column:service_id;size:32;not null" json:"service_id"`
	IP        string `gorm:"column:ip;not null" json:"ip"`
	Port      int    `gorm:"column:port;size:65535" json:"port"`
}

Endpoint is a persistent object for table 3rd_party_svc_endpoints.

func (*Endpoint) GetAddress

func (e *Endpoint) GetAddress() string

GetAddress -

func (Endpoint) TableName

func (Endpoint) TableName() string

TableName returns table name of Endpoint.

type EventFinalStatus

type EventFinalStatus string

EventFinalStatus -

var EventFinalStatusComplete EventFinalStatus = "complete"

EventFinalStatusComplete -

var EventFinalStatusEmpty EventFinalStatus = "empty"

EventFinalStatusEmpty -

var EventFinalStatusEmptyComplete EventFinalStatus = "emptycomplete"

EventFinalStatusEmptyComplete -

var EventFinalStatusFailure EventFinalStatus = "failure"

EventFinalStatusFailure -

var EventFinalStatusRunning EventFinalStatus = "running"

EventFinalStatusRunning -

func (EventFinalStatus) String

func (e EventFinalStatus) String() string

String -

type EventLogMessage

type EventLogMessage struct {
	Model
	EventID   string `gorm:"column:event_id;size:40"`
	StartTime string `gorm:"column:start_time;size:40"`
	Message   []byte `gorm:"column:message"`
}

EventLogMessage event log message struct

func (*EventLogMessage) TableName

func (t *EventLogMessage) TableName() string

TableName 表名

type EventStatus

type EventStatus string

EventStatus -

var EventStatusFailure EventStatus = "failure"

EventStatusFailure -

var EventStatusSuccess EventStatus = "success"

EventStatusSuccess -

func (EventStatus) String

func (e EventStatus) String() string

String -

type FailureActionType

type FailureActionType string

FailureActionType type of failure action.

const (
	// IgnoreFailureAction do nothing when the probe result is a failure
	IgnoreFailureAction FailureActionType = "ignore"
	// OfflineFailureAction offline the probe object when the probe result is a failure
	OfflineFailureAction FailureActionType = "readiness"
	// RestartFailureAction restart the probe object when the probe result is a failure
	RestartFailureAction FailureActionType = "liveness"
)

func (FailureActionType) String

func (fat FailureActionType) String() string

type GwRuleConfig

type GwRuleConfig struct {
	Model
	RuleID string `gorm:"column:rule_id;size:32"`
	Key    string `gorm:"column:key"`
	Value  string `gorm:"column:value"`
}

GwRuleConfig describes a configuration of gateway rule.

func (GwRuleConfig) TableName

func (GwRuleConfig) TableName() string

TableName -

type HTTPRule

type HTTPRule struct {
	Model
	UUID          string `gorm:"column:uuid"`
	ServiceID     string `gorm:"column:service_id"`
	VMID          string `gorm:"column:vm_id"`
	ContainerPort int    `gorm:"column:container_port"`
	Domain        string `gorm:"column:domain"`
	Path          string `gorm:"column:path;type:longtext"`
	Header        string `gorm:"column:header;type:longtext"`
	Cookie        string `gorm:"column:cookie;type:longtext"`
	Weight        int    `gorm:"column:weight"`
	IP            string `gorm:"column:ip"`
	CertificateID string `gorm:"column:certificate_id"`
	PathRewrite   bool   `gorm:"column:path_rewrite"`
}

HTTPRule contains http rule

func (HTTPRule) TableName

func (HTTPRule) TableName() string

TableName returns table name of HTTPRule

type HTTPRuleRewrite

type HTTPRuleRewrite struct {
	Model
	UUID        string `gorm:"column:uuid"`
	HTTPRuleID  string `gorm:"column:http_rule_id"`
	Regex       string `gorm:"column:regex"`
	Replacement string `gorm:"column:replacement"`
	Flag        string `gorm:"column:flag"`
}

HTTPRuleRewrite containe http rule rewrites

func (HTTPRuleRewrite) TableName

func (HTTPRuleRewrite) TableName() string

TableName retuens table name of HTTPRuleRewrite

type IDModel

type IDModel struct {
	ID uint `gorm:"column:ID;primary_key"`
}

IDModel 默认ID字段

type Image

type Image struct {
	Host      string
	Namespace string
	Name      string
}

Image 镜像

func ParseImage

func ParseImage(name string) (image Image)

ParseImage 简单解析镜像名

func (Image) String

func (i Image) String() string

type Interface

type Interface interface {
	TableName() string
}

Interface model interface

type LicenseInfo

type LicenseInfo struct {
	//Model
	IDModel
	Token   string `gorm:"column:token;size:40;" json:"token"`
	License string `gorm:"column:license;" json:"license"`
	Label   string `gorm:"column:label" json:"label"`
}

LicenseInfo 信息

func (*LicenseInfo) TableName

func (l *LicenseInfo) TableName() string

TableName 返回license表名称

type LoadBalancerType

type LoadBalancerType string

LoadBalancerType load balancer type

var ConsistenceHash LoadBalancerType = "ConsistentHash"

ConsistenceHash consistence hash load balancer type

var RoundRobin LoadBalancerType = "RoundRobin"

RoundRobin round-robin load balancer type

type LocalScheduler

type LocalScheduler struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32"`
	NodeIP    string `gorm:"column:node_ip;size:32"`
	PodName   string `gorm:"column:pod_name;size:32"`
}

LocalScheduler 本地调度暂存信息

func (*LocalScheduler) TableName

func (t *LocalScheduler) TableName() string

TableName 表名

type Model

type Model struct {
	ID        uint      `gorm:"column:ID;primary_key"`
	CreatedAt time.Time `gorm:"column:create_time" json:"create_time"`
}

Model 默认字段

type NotificationEvent

type NotificationEvent struct {
	Model
	//Kind could be service, tenant env, cluster, node
	Kind string `gorm:"column:kind;size:40"`
	//KindID could be service_id,tenant_env_id,cluster_id,node_id
	KindID string `gorm:"column:kind_id;size:40"`
	Hash   string `gorm:"column:hash;size:100"`
	//Type could be Normal UnNormal Notification
	Type          string    `gorm:"column:type;size:40"`
	Message       string    `gorm:"column:message;size:200"`
	Reason        string    `gorm:"column:reson;size:200"`
	Count         int       `gorm:"column:count;"`
	LastTime      time.Time `gorm:"column:last_time;"`
	FirstTime     time.Time `gorm:"column:first_time;"`
	IsHandle      bool      `gorm:"column:is_handle;"`
	HandleMessage string    `gorm:"column:handle_message;"`
	ServiceName   string    `gorm:"column:service_name;size:40"`
	TenantEnvName string    `gorm:"column:tenant_env_name;size:40"`
}

NotificationEvent NotificationEvent

func (*NotificationEvent) TableName

func (n *NotificationEvent) TableName() string

TableName table name

type RegionAPIClass

type RegionAPIClass struct {
	Model
	ClassLevel string `gorm:"column:class_level;size:24;" json:"class_level"`
	Prefix     string `gorm:"column:prefix;size:128;" json:"prefix"`
	URI        string `gorm:"column:uri;size:256" json:"uri"`
	Alias      string `gorm:"column:alias;size:64" json:"alias"`
	Remark     string `gorm:"column:remark;size:64" json:"remark"`
}

RegionAPIClass RegionAPIClass

func (*RegionAPIClass) TableName

func (t *RegionAPIClass) TableName() string

TableName 表名

type RegionProcotols

type RegionProcotols struct {
	Model
	ProtocolGroup string `gorm:"column:protocol_group;size:32;" json:"protocol_group"`
	ProtocolChild string `gorm:"column:protocol_child;size:32;" json:"protocol_child"`
	APIVersion    string `gorm:"column:api_version;size:8" json:"api_version"`
	IsSupport     bool   `gorm:"column:is_support;default:false" json:"is_support"`
}

RegionProcotols RegionProcotol

func (*RegionProcotols) TableName

func (t *RegionProcotols) TableName() string

TableName 表名

type RuleExtension

type RuleExtension struct {
	Model
	UUID   string `gorm:"column:uuid"`
	RuleID string `gorm:"column:rule_id"`
	Key    string `gorm:"column:key"`
	Value  string `gorm:"column:value"`
}

RuleExtension contains rule extensions for http rule or tcp rule

func (RuleExtension) TableName

func (RuleExtension) TableName() string

TableName returns table name of RuleExtension

type RuleExtensionKey

type RuleExtensionKey string

RuleExtensionKey rule extension key

var HTTPToHTTPS RuleExtensionKey = "httptohttps"

HTTPToHTTPS forces http rewrite to https

var LBType RuleExtensionKey = "lb-type"

LBType load balancer type

type ServiceEvent

type ServiceEvent struct {
	Model
	EventID     string `gorm:"column:event_id;size:40"`
	TenantEnvID string `gorm:"column:tenant_env_id;size:40;index:tenant_env_id"`
	ServiceID   string `gorm:"column:service_id;size:40;index:service_id"`
	Target      string `gorm:"column:target;size:40"`
	TargetID    string `gorm:"column:target_id;size:255;index:target_id"`
	RequestBody string `gorm:"column:request_body;size:1024"`
	UserName    string `gorm:"column:user_name;size:40"`
	StartTime   string `gorm:"column:start_time;size:40"`
	EndTime     string `gorm:"column:end_time;size:40"`
	OptType     string `gorm:"column:opt_type;size:40"`
	SynType     int    `gorm:"column:syn_type;size:1"`
	Status      string `gorm:"column:status;size:40"`
	FinalStatus string `gorm:"column:final_status;size:40"`
	Message     string `gorm:"column:message"`
	Reason      string `gorm:"column:reason"`
}

ServiceEvent event struct

func (*ServiceEvent) TableName

func (t *ServiceEvent) TableName() string

TableName 表名

type ServiceID

type ServiceID struct {
	ServiceID string `gorm:"column:service_id" json:"-"`
}

ServiceID -

type ServiceKind

type ServiceKind string

ServiceKind kind of service

var ServiceKindCustom ServiceKind = "custom.componentdefinition."

ServiceKindCustom means custom component define

var ServiceKindInternal ServiceKind = "internal"

ServiceKindInternal means internal service

var ServiceKindThirdParty ServiceKind = "third_party"

ServiceKindThirdParty means third-party service

func (ServiceKind) String

func (s ServiceKind) String() string

type ServiceSourceConfig

type ServiceSourceConfig struct {
	Model
	ServiceID  string `gorm:"column:service_id;size:32"`
	SourceType string `gorm:"column:source_type;size:32"`
	SourceBody string `gorm:"column:source_body;size:2000"`
}

ServiceSourceConfig service source config info such as deployment、statefulset、configmap

func (*ServiceSourceConfig) TableName

func (t *ServiceSourceConfig) TableName() string

TableName 表名

type ServiceType

type ServiceType string

ServiceType type of service

var ServiceTypeStateMultiple ServiceType = "state_multiple"

ServiceTypeStateMultiple state_multiple

var ServiceTypeStateSingleton ServiceType = "state_singleton"

ServiceTypeStateSingleton state_singleton

var ServiceTypeStatelessMultiple ServiceType = "stateless_multiple"

ServiceTypeStatelessMultiple stateless_multiple

var ServiceTypeStatelessSingleton ServiceType = "stateless_singleton"

ServiceTypeStatelessSingleton stateless_singleton

var ServiceTypeUnknown ServiceType = "unknown"

ServiceTypeUnknown unknown

func (ServiceType) IsSingleton

func (s ServiceType) IsSingleton() bool

IsSingleton is singleton or not

func (ServiceType) IsState

func (s ServiceType) IsState() bool

IsState is state type or not

func (ServiceType) String

func (s ServiceType) String() string

String imple String

type TCPRule

type TCPRule struct {
	Model
	UUID          string `gorm:"column:uuid"`
	ServiceID     string `gorm:"column:service_id"`
	VMID          string `gorm:"column:vm_id"`
	ContainerPort int    `gorm:"column:container_port"`
	// external access ip
	IP string `gorm:"column:ip"`
	// external access port
	Port int `gorm:"column:port"`
}

TCPRule contain stream rule

func (TCPRule) TableName

func (TCPRule) TableName() string

TableName returns table name of TCPRule

type TenantEnvPlugin added in v1.1.0

type TenantEnvPlugin struct {
	Model
	PluginID string `gorm:"column:plugin_id;size:32"`
	//plugin name
	PluginName string `gorm:"column:plugin_name;size:32" json:"plugin_name"`
	//plugin describe
	PluginInfo string `gorm:"column:plugin_info;size:255" json:"plugin_info"`
	//plugin build by docker image name
	ImageURL string `gorm:"column:image_url" json:"image_url"`
	//plugin build by git code url
	GitURL string `gorm:"column:git_url" json:"git_url"`
	//build mode
	BuildModel string `gorm:"column:build_model" json:"build_model"`
	//plugin model InitPlugin,InBoundNetPlugin,OutBoundNetPlugin
	PluginModel string `gorm:"column:plugin_model" json:"plugin_model"`
	//tenant env id
	TenantEnvID string `gorm:"column:tenant_env_id" json:"tenant_env_id"`
	//tenant_env_name Used to calculate CPU and Memory.
	Domain string `gorm:"column:domain" json:"domain"`
	//gitlab; github The deprecated
	CodeFrom   string `gorm:"column:code_from" json:"code_from"`
	PluginType string `gorm:"column:plugin_type" json:"plugin_type"`
}

TenantEnvPlugin plugin model

func (*TenantEnvPlugin) TableName added in v1.1.0

func (t *TenantEnvPlugin) TableName() string

TableName table name

type TenantEnvPluginBuildVersion added in v1.1.0

type TenantEnvPluginBuildVersion struct {
	Model
	//plugin version eg v1.0.0
	VersionID string `gorm:"column:version_id;size:32" json:"version_id"`
	//deploy version eg 20180528071717
	DeployVersion   string `gorm:"column:deploy_version;size:32" json:"deploy_version"`
	PluginID        string `gorm:"column:plugin_id;size:32" json:"plugin_id"`
	Kind            string `gorm:"column:kind;size:24" json:"kind"`
	BaseImage       string `gorm:"column:base_image;size:200" json:"base_image"`
	BuildLocalImage string `gorm:"column:build_local_image;size:200" json:"build_local_image"`
	BuildTime       string `gorm:"column:build_time" json:"build_time"`
	Repo            string `gorm:"column:repo" json:"repo"`
	GitURL          string `gorm:"column:git_url" json:"git_url"`
	Info            string `gorm:"column:info" json:"info"`
	Status          string `gorm:"column:status;size:24" json:"status"`
	// container default cpu
	ContainerCPU int `gorm:"column:container_cpu;default:0" json:"container_cpu"`
	// container default memory
	ContainerMemory int `gorm:"column:container_memory;default:0" json:"container_memory"`
	// container args
	ContainerCMD string `gorm:"column:container_cmd;size:2048" json:"container_cmd"`
}

TenantEnvPluginBuildVersion plugin build version

func (*TenantEnvPluginBuildVersion) CreateShareImage added in v1.1.0

func (t *TenantEnvPluginBuildVersion) CreateShareImage(hubURL, namespace string) (string, error)

CreateShareImage CreateShareImage

func (*TenantEnvPluginBuildVersion) TableName added in v1.1.0

func (t *TenantEnvPluginBuildVersion) TableName() string

TableName table name

type TenantEnvPluginDefaultENV added in v1.1.0

type TenantEnvPluginDefaultENV struct {
	Model
	//plugin id
	PluginID string `gorm:"column:plugin_id" json:"plugin_id"`
	//plugin version
	VersionID string `gorm:"column:version_id;size:32" json:"version_id"`
	//env name
	ENVName string `gorm:"column:env_name" json:"env_name"`
	//env value
	ENVValue string `gorm:"column:env_value" json:"env_value"`
	//value is change
	IsChange bool `gorm:"column:is_change;default:false" json:"is_change"`
}

TenantEnvPluginDefaultENV plugin default env config

func (*TenantEnvPluginDefaultENV) TableName added in v1.1.0

func (t *TenantEnvPluginDefaultENV) TableName() string

TableName table name

type TenantEnvPluginVersionDiscoverConfig added in v1.1.0

type TenantEnvPluginVersionDiscoverConfig struct {
	Model
	PluginID  string `gorm:"column:plugin_id;size:32" json:"plugin_id"`
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id"`
	ConfigStr string `gorm:"column:config_str;" sql:"type:text;" json:"config_str"`
}

TenantEnvPluginVersionDiscoverConfig service plugin config that can be dynamic discovery

func (*TenantEnvPluginVersionDiscoverConfig) TableName added in v1.1.0

TableName table name

type TenantEnvPluginVersionEnv added in v1.1.0

type TenantEnvPluginVersionEnv struct {
	Model
	//VersionID string `gorm:"column:version_id;size:32"`
	PluginID  string `gorm:"column:plugin_id;size:32" json:"plugin_id"`
	EnvName   string `gorm:"column:env_name" json:"env_name"`
	EnvValue  string `gorm:"column:env_value" json:"env_value"`
	ServiceID string `gorm:"column:service_id" json:"service_id"`
}

TenantEnvPluginVersionEnv TenantEnvPluginVersionEnv

func (*TenantEnvPluginVersionEnv) TableName added in v1.1.0

func (t *TenantEnvPluginVersionEnv) TableName() string

TableName table name

type TenantEnvServiceAutoscalerRuleMetrics added in v1.1.0

type TenantEnvServiceAutoscalerRuleMetrics struct {
	Model
	RuleID            string `gorm:"column:rule_id;size:32;not null"`
	MetricsType       string `gorm:"column:metric_type;not null"`
	MetricsName       string `gorm:"column:metric_name;not null"`
	MetricTargetType  string `gorm:"column:metric_target_type;not null"`
	MetricTargetValue int    `gorm:"column:metric_target_value;not null"`
}

TenantEnvServiceAutoscalerRuleMetrics -

func (*TenantEnvServiceAutoscalerRuleMetrics) TableName added in v1.1.0

TableName -

type TenantEnvServiceAutoscalerRules added in v1.1.0

type TenantEnvServiceAutoscalerRules struct {
	Model
	RuleID      string `gorm:"column:rule_id;unique;size:32"`
	ServiceID   string `gorm:"column:service_id;size:32"`
	Enable      bool   `gorm:"column:enable"`
	XPAType     string `gorm:"column:xpa_type;size:3"`
	MinReplicas int    `gorm:"colume:min_replicas"`
	MaxReplicas int    `gorm:"colume:max_replicas"`
}

TenantEnvServiceAutoscalerRules -

func (*TenantEnvServiceAutoscalerRules) TableName added in v1.1.0

func (t *TenantEnvServiceAutoscalerRules) TableName() string

TableName -

type TenantEnvServiceConfigFile added in v1.1.0

type TenantEnvServiceConfigFile struct {
	Model
	ServiceID   string `gorm:"column:service_id;size:32" json:"service_id"`
	VolumeName  string `gorm:"column:volume_name;size:32" json:"volume_name"`
	FileContent string `gorm:"column:file_content;size:65535" json:"filename"`
}

TenantEnvServiceConfigFile represents a data in configMap which is one of the types of volumes

func (*TenantEnvServiceConfigFile) TableName added in v1.1.0

func (t *TenantEnvServiceConfigFile) TableName() string

TableName returns table name of TenantEnvServiceConfigFile.

type TenantEnvServiceEnvVar added in v1.1.0

type TenantEnvServiceEnvVar struct {
	Model
	TenantEnvID   string `gorm:"column:tenant_env_id;size:32" validate:"tenant_env_id|between:30,33" json:"tenant_env_id"`
	ServiceID     string `gorm:"column:service_id;size:32" validate:"service_id|between:30,33" json:"service_id"`
	ContainerPort int    `gorm:"column:container_port" validate:"container_port|numeric_between:1,65535" json:"container_port"`
	Name          string `gorm:"column:name;size:1024" validate:"name" json:"name"`
	AttrName      string `gorm:"column:attr_name;size:1024" validate:"env_name|required" json:"attr_name"`
	AttrValue     string `gorm:"column:attr_value;type:text" validate:"env_value|required" json:"attr_value"`
	IsChange      bool   `gorm:"column:is_change" validate:"is_change|bool" json:"is_change"`
	Scope         string `gorm:"column:scope;default:'outer'" validate:"scope|in:outer,inner,both" json:"scope"`
}

TenantEnvServiceEnvVar 应用环境变量

func (*TenantEnvServiceEnvVar) TableName added in v1.1.0

func (t *TenantEnvServiceEnvVar) TableName() string

TableName 表名

type TenantEnvServiceLBMappingPort added in v1.1.0

type TenantEnvServiceLBMappingPort struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32"`
	//负载均衡VS使用端口
	Port int `gorm:"column:port;unique_index"`
	//此字段废除
	//	IP string `gorm:"column:ip"`
	//应用原端口
	ContainerPort int `gorm:"column:container_port"`
}

TenantEnvServiceLBMappingPort stream应用端口映射情况

func (*TenantEnvServiceLBMappingPort) TableName added in v1.1.0

func (t *TenantEnvServiceLBMappingPort) TableName() string

TableName 表名

type TenantEnvServiceLabel added in v1.10.0

type TenantEnvServiceLabel struct {
	Model
	ServiceID  string `gorm:"column:service_id;size:32"`
	LabelKey   string `gorm:"column:label_key;size:50"`
	LabelValue string `gorm:"column:label_value;size:50"`
}

TenantEnvServiceLabel 应用高级标签

func (*TenantEnvServiceLabel) TableName added in v1.10.0

func (t *TenantEnvServiceLabel) TableName() string

TableName 表名

type TenantEnvServiceMonitor added in v1.1.0

type TenantEnvServiceMonitor struct {
	Model
	TenantEnvID     string `gorm:"column:tenant_env_id;size:40;unique_index:unique_tenant_env_id_name" json:"tenant_env_id"`
	ServiceID       string `gorm:"column:service_id;size:40" json:"service_id"`
	Name            string `gorm:"column:name;size:40;unique_index:unique_tenant_env_id_name" json:"name"`
	ServiceShowName string `gorm:"column:service_show_name" json:"service_show_name"`
	Port            int    `gorm:"column:port;size:5" json:"port"`
	Path            string `gorm:"column:path;size:255" json:"path"`
	Interval        string `gorm:"column:interval;size:20" json:"interval"`
}

TenantEnvServiceMonitor custom service monitor

func (TenantEnvServiceMonitor) TableName added in v1.1.0

func (TenantEnvServiceMonitor) TableName() string

TableName returns table name of TenantEnvServiceMonitor

type TenantEnvServiceMountRelation added in v1.1.0

type TenantEnvServiceMountRelation struct {
	Model
	TenantEnvID     string `gorm:"column:tenant_env_id;size:32" json:"tenant_env_id" validate:"tenant_env_id|between:30,33"`
	ServiceID       string `gorm:"column:service_id;size:32" json:"service_id" validate:"service_id|between:30,33"`
	DependServiceID string `gorm:"column:dep_service_id;size:32" json:"dep_service_id" validate:"dep_service_id|between:30,33"`
	//挂载路径(挂载应用可自定义)
	VolumePath string `gorm:"column:mnt_name" json:"volume_path" validate:"volume_path|required"`
	//主机路径(依赖应用的共享存储对应的主机路径)
	HostPath string `gorm:"column:mnt_dir" json:"host_path" validate:"host_path"`
	//存储名称(依赖应用的共享存储对应的名称)
	VolumeName string `gorm:"column:volume_name;size:40" json:"volume_name" validate:"volume_name|required"`
	VolumeType string `gorm:"column:volume_type" json:"volume_type" validate:"volume_type|required"`
}

TenantEnvServiceMountRelation 应用挂载依赖纪录

func (*TenantEnvServiceMountRelation) TableName added in v1.1.0

func (t *TenantEnvServiceMountRelation) TableName() string

TableName 表名

type TenantEnvServicePluginRelation added in v1.1.0

type TenantEnvServicePluginRelation struct {
	Model
	VersionID   string `gorm:"column:version_id;size:32" json:"version_id"`
	PluginID    string `gorm:"column:plugin_id;size:32" json:"plugin_id"`
	ServiceID   string `gorm:"column:service_id;size:32" json:"service_id"`
	PluginModel string `gorm:"column:plugin_model;size:24" json:"plugin_model"`
	// container default cpu  v3.5.1 add
	ContainerCPU int `gorm:"column:container_cpu;default:0" json:"container_cpu"`
	// container default memory  v3.5.1 add
	ContainerMemory int  `gorm:"column:container_memory;default:0" json:"container_memory"`
	Switch          bool `gorm:"column:switch;default:0" json:"switch"`
}

TenantEnvServicePluginRelation TenantEnvServicePluginRelation

func (*TenantEnvServicePluginRelation) TableName added in v1.1.0

func (t *TenantEnvServicePluginRelation) TableName() string

TableName table name

type TenantEnvServiceProbe added in v1.1.0

type TenantEnvServiceProbe struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id" validate:"service_id|between:30,33"`
	ProbeID   string `gorm:"column:probe_id;size:32" json:"probe_id" validate:"probe_id|between:30,33"`
	Mode      string `gorm:"column:mode;default:'liveness'" json:"mode" validate:"mode"`
	Scheme    string `gorm:"column:scheme;default:'scheme'" json:"scheme" validate:"scheme"`
	Path      string `gorm:"column:path" json:"path" validate:"path"`
	Port      int    `gorm:"column:port;size:5;default:80" json:"port" validate:"port|required|numeric_between:1,65535"`
	Cmd       string `gorm:"column:cmd;size:150" json:"cmd" validate:"cmd"`
	//http请求头,key=value,key2=value2
	HTTPHeader string `gorm:"column:http_header;size:300" json:"http_header" validate:"http_header"`
	//初始化等候时间
	InitialDelaySecond int `gorm:"column:initial_delay_second;size:2;default:4" json:"initial_delay_second" validate:"initial_delay_second"`
	//检测间隔时间
	PeriodSecond int `gorm:"column:period_second;size:2;default:3" json:"period_second" validate:"period_second"`
	//检测超时时间
	TimeoutSecond int `gorm:"column:timeout_second;size:3;default:5" json:"timeout_second" validate:"timeout_second"`
	//是否启用
	IsUsed *int `gorm:"column:is_used;size:1;default:1" json:"is_used" validate:"is_used"`
	//标志为失败的检测次数
	FailureThreshold int `gorm:"column:failure_threshold;size:2;default:3" json:"failure_threshold" validate:"failure_threshold"`
	//标志为成功的检测次数
	SuccessThreshold int    `gorm:"column:success_threshold;size:2;default:1" json:"success_threshold" validate:"success_threshold"`
	FailureAction    string `gorm:"column:failure_action;" json:"failure_action" validate:"failure_action"`
}

TenantEnvServiceProbe 应用探针信息

func (*TenantEnvServiceProbe) TableName added in v1.1.0

func (t *TenantEnvServiceProbe) TableName() string

TableName 表名

type TenantEnvServiceRelation added in v1.1.0

type TenantEnvServiceRelation struct {
	Model
	TenantEnvID       string `gorm:"column:tenant_env_id;size:32" validate:"tenant_env_id" json:"tenant_env_id"`
	ServiceID         string `gorm:"column:service_id;size:32" validate:"service_id" json:"service_id"`
	DependServiceID   string `gorm:"column:dep_service_id;size:32" validate:"depend_service_id" json:"depend_service_id"`
	DependServiceType string `gorm:"column:dep_service_type" validate:"dep_service_type" json:"dep_service_type"`
	DependOrder       int    `gorm:"column:dep_order" validate:"dep_order" json:"dep_order"`
}

TenantEnvServiceRelation 应用依赖关系

func (*TenantEnvServiceRelation) TableName added in v1.1.0

func (t *TenantEnvServiceRelation) TableName() string

TableName 表名

type TenantEnvServiceScalingRecords added in v1.1.0

type TenantEnvServiceScalingRecords struct {
	Model
	ServiceID   string    `gorm:"column:service_id" json:"-"`
	RuleID      string    `gorm:"column:rule_id" json:"rule_id"`
	EventName   string    `gorm:"column:event_name;not null" json:"record_id"`
	RecordType  string    `gorm:"column:record_type" json:"record_type"`
	Reason      string    `gorm:"column:reason" json:"reason"`
	Count       int32     `gorm:"column:count" json:"count"`
	Description string    `gorm:"column:description;size:1023" json:"description"`
	Operator    string    `gorm:"column:operator" json:"operator"`
	LastTime    time.Time `gorm:"column:last_time" json:"last_time"`
}

TenantEnvServiceScalingRecords -

func (*TenantEnvServiceScalingRecords) TableName added in v1.1.0

func (t *TenantEnvServiceScalingRecords) TableName() string

TableName -

type TenantEnvServiceSchedulingLabel added in v1.10.0

type TenantEnvServiceSchedulingLabel struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id"`
	Key       string `gorm:"column:key;size:50" json:"key"`
	Value     string `gorm:"column:value;size:250" json:"value"`
}

func (*TenantEnvServiceSchedulingLabel) TableName added in v1.10.0

func (t *TenantEnvServiceSchedulingLabel) TableName() string

type TenantEnvServiceSchedulingNode added in v1.10.0

type TenantEnvServiceSchedulingNode struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id"`
	NodeName  string `gorm:"column:node_name;size:50" json:"node_name"`
}

func (*TenantEnvServiceSchedulingNode) TableName added in v1.10.0

func (t *TenantEnvServiceSchedulingNode) TableName() string

type TenantEnvServiceSchedulingToleration added in v1.10.0

type TenantEnvServiceSchedulingToleration struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id"`
	Key       string `gorm:"column:key;size:50" json:"key"`
	Operator  string `gorm:"column:operator;size:10" json:"operator"`
	Value     string `gorm:"column:value;size:250" json:"value"`
	Effect    string `gorm:"column:effect;size:20" json:"effect"`
}

func (*TenantEnvServiceSchedulingToleration) TableName added in v1.10.0

type TenantEnvServiceVolume added in v1.1.0

type TenantEnvServiceVolume struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id"`
	//服务类型
	Category string `gorm:"column:category;size:50" json:"category"`
	//存储类型(share,local,tmpfs)
	VolumeType string `gorm:"column:volume_type;size:64" json:"volume_type"`
	//存储名称
	VolumeName string `gorm:"column:volume_name;size:40" json:"volume_name"`
	//主机地址
	HostPath string `gorm:"column:host_path" json:"host_path"`
	//挂载地址
	VolumePath string `gorm:"column:volume_path" json:"volume_path"`
	//是否只读
	IsReadOnly bool `gorm:"column:is_read_only;default:0" json:"is_read_only"`
	// VolumeCapacity 存储大小
	VolumeCapacity int64 `gorm:"column:volume_capacity" json:"volume_capacity"`
	// AccessMode 读写模式(Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time. #https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
	AccessMode string `gorm:"column:access_mode" json:"access_mode"`
	// SharePolicy 共享模式
	SharePolicy string `gorm:"column:share_policy" json:"share_policy"`
	// BackupPolicy 备份策略
	BackupPolicy string `gorm:"column:backup_policy" json:"backup_policy"`
	// ReclaimPolicy 回收策略
	ReclaimPolicy string `json:"reclaim_policy"`
	// AllowExpansion 是否支持扩展
	AllowExpansion bool `gorm:"column:allow_expansion" json:"allow_expansion"`
	// VolumeProviderName 使用的存储驱动别名
	VolumeProviderName string `gorm:"column:volume_provider_name" json:"volume_provider_name"`
	Mode               *int32 `gorm:"column:mode" json:"mode"`
}

TenantEnvServiceVolume 应用持久化纪录

func (*TenantEnvServiceVolume) Key added in v1.1.0

func (t *TenantEnvServiceVolume) Key() string

Key returns the key of TenantEnvServiceVolume.

func (*TenantEnvServiceVolume) TableName added in v1.1.0

func (t *TenantEnvServiceVolume) TableName() string

TableName 表名

type TenantEnvServiceVolumeType added in v1.1.0

type TenantEnvServiceVolumeType struct {
	Model
	VolumeType         string `gorm:"column:volume_type; size:64" json:"volume_type"`
	NameShow           string `gorm:"column:name_show; size:64" json:"name_show"`
	CapacityValidation string `gorm:"column:capacity_validation; size:1024" json:"capacity_validation"`
	Description        string `gorm:"column:description; size:1024" json:"description"`
	AccessMode         string `gorm:"column:access_mode; size:128" json:"access_mode"`
	BackupPolicy       string `gorm:"column:backup_policy; size:128" json:"backup_policy"`
	ReclaimPolicy      string `gorm:"column:reclaim_policy; size:20" json:"reclaim_policy"`
	SharePolicy        string `gorm:"share_policy; size:128" json:"share_policy"`
	Provisioner        string `gorm:"provisioner; size:128" json:"provisioner"`
	StorageClassDetail string `gorm:"storage_class_detail; size:2048" json:"storage_class_detail"`
	Sort               int    `gorm:"sort; default:9999" json:"sort"`
	Enable             bool   `gorm:"enable" json:"enable"`
}

TenantEnvServiceVolumeType tenant env service volume type

func (*TenantEnvServiceVolumeType) TableName added in v1.1.0

func (t *TenantEnvServiceVolumeType) TableName() string

TableName 表名

type TenantEnvServices added in v1.1.0

type TenantEnvServices struct {
	Model
	TenantEnvID string `gorm:"column:tenant_env_id;size:32" json:"tenant_env_id"`
	ServiceID   string `gorm:"column:service_id;size:32" json:"service_id"`
	// 服务key
	ServiceKey string `gorm:"column:service_key;size:32" json:"service_key"`
	// 服务别名
	ServiceAlias string `gorm:"column:service_alias;size:30" json:"service_alias"`
	// service regist endpoint name(host name), used of statefulset
	ServiceName string `gorm:"column:service_name;size:100" json:"service_name"`
	// (This field is not currently used, use ExtendMethod)Service type now service support
	ServiceType string `gorm:"column:service_type;size:32" json:"service_type"`
	// 服务描述
	Comment string `gorm:"column:comment" json:"comment"`
	// 容器请求CPU
	// default is 10
	ContainerRequestCPU int `gorm:"column:container_request_cpu;default:0" json:"container_request_cpu"`
	// 容器CPU权重
	// default is 2000
	ContainerCPU int `gorm:"column:container_cpu;default:0" json:"container_cpu"`
	// 容器请求内存
	// default is 512
	ContainerRequestMemory int `gorm:"column:container_request_memory;default:0" json:"container_request_memory"`
	// 容器最大内存
	// default is 512
	ContainerMemory int `gorm:"column:container_memory;default:0" json:"container_memory"`
	// Container GPU Type
	// default is "", That means no GPU settings
	ContainerGPUType string `gorm:"column:container_gpu_type;size:100" json:"container_gpu_type"`
	// container GPU, The amount of video memory applied for GPU. The unit is MiB
	// default is 0, That means no GPU is required
	ContainerGPU int `gorm:"column:container_gpu;default:0" json:"container_gpu"`
	//UpgradeMethod service upgrade controller type
	//such as : `Rolling` `OnDelete`
	UpgradeMethod string `gorm:"column:upgrade_method;default:'Rolling'" json:"upgrade_method"`
	// 组件类型  component deploy type stateless_singleton/stateless_multiple/state_singleton/state_multiple
	ExtendMethod string `gorm:"column:extend_method;default:'stateless';" json:"extend_method"`
	// 节点数
	Replicas int `gorm:"column:replicas;default:1" json:"replicas"`
	// 部署版本
	DeployVersion string `gorm:"column:deploy_version" json:"deploy_version"`
	// 服务分类:application,cache,store
	Category string `gorm:"column:category" json:"category"`
	// 服务当前状态:undeploy,running,closed,unusual,starting,checking,stoping(deprecated)
	CurStatus string `gorm:"column:cur_status;default:'undeploy'" json:"cur_status"`
	// 计费状态 为1 计费,为0不计费 (deprecated)
	Status int `gorm:"column:status;default:0" json:"status"`
	// 最新操作ID
	EventID string `gorm:"column:event_id" json:"event_id"`
	// 租户ID
	Namespace string `gorm:"column:namespace" json:"namespace"`
	// 更新时间
	UpdateTime time.Time `gorm:"column:update_time" json:"update_time"`
	// 服务创建类型cloud云市服务,assistant云帮服务
	ServiceOrigin string `gorm:"column:service_origin;default:'assistant'" json:"service_origin"`
	// kind of service. option: internal, third_party, custom
	Kind string `gorm:"column:kind;default:'internal'" json:"kind"`
	// service bind appID
	AppID string `gorm:"column:app_id" json:"app_id"`
	// Component name in cluster
	K8sComponentName string `gorm:"column:k8s_component_name" json:"k8s_component_name"`
}

TenantEnvServices app service base info

func (*TenantEnvServices) ChangeDelete added in v1.1.0

func (t *TenantEnvServices) ChangeDelete() *TenantEnvServicesDelete

ChangeDelete ChangeDelete

func (*TenantEnvServices) CreateShareSlug added in v1.1.0

func (t *TenantEnvServices) CreateShareSlug(servicekey, namespace, version string) string

CreateShareSlug 生成源码包分享的地址

func (*TenantEnvServices) IsSingleton added in v1.1.0

func (t *TenantEnvServices) IsSingleton() bool

IsSingleton is singleton or multiple service

func (*TenantEnvServices) IsState added in v1.1.0

func (t *TenantEnvServices) IsState() bool

IsState is state service or stateless service TODO fanyangyang 根据组件简单判断是否是有状态

func (*TenantEnvServices) TableName added in v1.1.0

func (t *TenantEnvServices) TableName() string

TableName 表名

type TenantEnvServicesDelete added in v1.1.0

type TenantEnvServicesDelete struct {
	Model
	TenantEnvID string `gorm:"column:tenant_env_id;size:32" json:"tenant_env_id"`
	ServiceID   string `gorm:"column:service_id;size:32" json:"service_id"`
	// 服务key
	ServiceKey string `gorm:"column:service_key;size:32" json:"service_key"`
	// 服务别名
	ServiceAlias string `gorm:"column:service_alias;size:30" json:"service_alias"`
	// service regist endpoint name(host name), used of statefulset
	ServiceName string `gorm:"column:service_name;size:100" json:"service_name"`
	// Service type now service support stateless_singleton/stateless_multiple/state_singleton/state_multiple
	ServiceType string `gorm:"column:service_type;size:20" json:"service_type"`
	// 服务描述
	Comment string `gorm:"column:comment" json:"comment"`
	// 容器请求CPU
	ContainerRequestCPU int `gorm:"column:container_request_cpu" json:"container_request_cpu"`
	// 容器CPU权重
	ContainerCPU int `gorm:"column:container_cpu;default:2000" json:"container_cpu"`
	// 容器请求内存
	ContainerRequestMemory int `gorm:"column:container_request_memory" json:"container_request_memory"`
	// 容器最大内存
	ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory"`
	// Container GPU Type
	// default is "", That means no GPU settings
	ContainerGPUType string `gorm:"column:container_gpu_type;size:100" json:"container_gpu_type"`
	// container GPU, The amount of video memory applied for GPU. The unit is MiB
	// default is 0, That means no GPU is required
	ContainerGPU int `gorm:"column:container_gpu;default:0" json:"container_gpu"`
	//UpgradeMethod service upgrade controller type
	//such as : `Rolling` `OnDelete`
	UpgradeMethod string `gorm:"column:upgrade_method;default:'Rolling'" json:"upgrade_method"`
	// 扩容方式;0:无状态;1:有状态;2:分区
	ExtendMethod string `gorm:"column:extend_method;default:'stateless';" json:"extend_method"`
	// 节点数
	Replicas int `gorm:"column:replicas;default:1" json:"replicas"`
	// 部署版本
	DeployVersion string `gorm:"column:deploy_version" json:"deploy_version"`
	// 服务分类:application,cache,store
	Category string `gorm:"column:category" json:"category"`
	// 服务当前状态:undeploy,running,closed,unusual,starting,checking,stoping(deprecated)
	CurStatus string `gorm:"column:cur_status;default:'undeploy'" json:"cur_status"`
	// 计费状态 为1 计费,为0不计费 (deprecated)
	Status int `gorm:"column:status;default:0" json:"status"`
	// 最新操作ID
	EventID string `gorm:"column:event_id" json:"event_id"`
	// 租户ID
	Namespace string `gorm:"column:namespace" json:"namespace"`
	// 更新时间
	UpdateTime time.Time `gorm:"column:update_time" json:"update_time"`
	// 服务创建类型cloud云市服务,assistant云帮服务
	ServiceOrigin string `gorm:"column:service_origin;default:'assistant'" json:"service_origin"`
	// kind of service. option: internal, third_party
	Kind string `gorm:"column:kind;default:'internal'" json:"kind"`
	// service bind appID
	AppID string `gorm:"column:app_id" json:"app_id"`
	// Component name in cluster
	K8sComponentName string `gorm:"column:k8s_component_name" json:"k8s_component_name"`
}

TenantEnvServicesDelete 已删除的应用表

func (*TenantEnvServicesDelete) TableName added in v1.1.0

func (t *TenantEnvServicesDelete) TableName() string

TableName 表名

type TenantEnvServicesPort added in v1.1.0

type TenantEnvServicesPort struct {
	Model
	TenantEnvID    string `gorm:"column:tenant_env_id;size:32" validate:"tenant_env_id|between:30,33" json:"tenant_env_id"`
	ServiceID      string `gorm:"column:service_id;size:32" validate:"service_id|between:30,33" json:"service_id"`
	ContainerPort  int    `gorm:"column:container_port" validate:"container_port|required|numeric_between:1,65535" json:"container_port"`
	MappingPort    int    `gorm:"column:mapping_port" validate:"mapping_port|required|numeric_between:1,65535" json:"mapping_port"`
	Protocol       string `gorm:"column:protocol" validate:"protocol|required|in:http,https,tcp,grpc,udp,mysql" json:"protocol"`
	PortAlias      string `gorm:"column:port_alias" validate:"port_alias|required|alpha_dash" json:"port_alias"`
	IsInnerService *bool  `gorm:"column:is_inner_service" validate:"is_inner_service|bool" json:"is_inner_service"`
	IsOuterService *bool  `gorm:"column:is_outer_service" validate:"is_outer_service|bool" json:"is_outer_service"`
	K8sServiceName string `gorm:"column:k8s_service_name" json:"k8s_service_name"`
}

TenantEnvServicesPort 应用端口信息

func (*TenantEnvServicesPort) IsOpen added in v1.1.0

func (t *TenantEnvServicesPort) IsOpen() bool

IsOpen checks if the port is opened.

func (*TenantEnvServicesPort) Key added in v1.1.0

func (t *TenantEnvServicesPort) Key() string

Key returns the key of TenantEnvServicesPort.

func (*TenantEnvServicesPort) TableName added in v1.1.0

func (t *TenantEnvServicesPort) TableName() string

TableName 表名

type TenantEnvServicesStreamPluginPort added in v1.1.0

type TenantEnvServicesStreamPluginPort struct {
	Model
	TenantEnvID   string `gorm:"column:tenant_env_id;size:32" validate:"tenant_env_id|between:30,33" json:"tenant_env_id"`
	ServiceID     string `gorm:"column:service_id;size:32" validate:"service_id|between:30,33" json:"service_id"`
	PluginModel   string `gorm:"column:plugin_model;size:24" json:"plugin_model"`
	ContainerPort int    `gorm:"column:container_port" validate:"container_port|required|numeric_between:1,65535" json:"container_port"`
	PluginPort    int    `gorm:"column:plugin_port" json:"plugin_port"`
}

TenantEnvServicesStreamPluginPort 绑定stream类型插件后端口映射信息

func (*TenantEnvServicesStreamPluginPort) TableName added in v1.1.0

TableName 表名

type TenantEnvStatus added in v1.1.0

type TenantEnvStatus string

TenantEnvStatus -

var (
	// TenantEnvStatusNormal -
	TenantEnvStatusNormal TenantEnvStatus = "normal"
	// TenantEnvStatusDeleting -
	TenantEnvStatusDeleting TenantEnvStatus = "deleting"
	// TenantEnvStatusDeleteFailed -
	TenantEnvStatusDeleteFailed TenantEnvStatus = "delete_failed"
)

func (TenantEnvStatus) String added in v1.1.0

func (t TenantEnvStatus) String() string

type TenantEnvs added in v1.1.0

type TenantEnvs struct {
	Model
	Name        string `gorm:"column:name;size:31"`
	UUID        string `gorm:"column:uuid;size:33;unique_index"`
	TenantID    string `gorm:"column:tenant_id"`
	TenantName  string `gorm:"column:tenant_name;size:31"`
	LimitMemory int    `gorm:"column:limit_memory"`
	Status      string `gorm:"column:status;default:'normal'"`
	Namespace   string `gorm:"column:namespace;size:63;unique_index"`
}

TenantEnvs 租户环境信息

func (*TenantEnvs) TableName added in v1.1.0

func (t *TenantEnvs) TableName() string

TableName 返回租户表名称

type ThirdPartySvcDiscoveryCfg

type ThirdPartySvcDiscoveryCfg struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32"`
	Type      string `gorm:"column:type"`
	Servers   string `gorm:"column:servers"`
	Key       string `gorm:"key"`
	Username  string `gorm:"username"`
	Password  string `gorm:"password"`
	//for kubernetes service
	Namespace   string `gorm:"namespace"`
	ServiceName string `gorm:"serviceName"`
}

ThirdPartySvcDiscoveryCfg s a persistent object for table 3rd_party_svc_discovery_cfg. 3rd_party_svc_discovery_cfg contains service discovery center configuration for third party service.

func (ThirdPartySvcDiscoveryCfg) TableName

func (ThirdPartySvcDiscoveryCfg) TableName() string

TableName returns table name of ThirdPartySvcDiscoveryCfg.

type VersionInfo

type VersionInfo struct {
	Model
	BuildVersion string `gorm:"column:build_version;size:40" json:"build_version"` //唯一
	EventID      string `gorm:"column:event_id;size:40" json:"event_id"`
	ServiceID    string `gorm:"column:service_id;size:40" json:"service_id"`
	Kind         string `gorm:"column:kind;size:40" json:"kind"` //kind
	//DeliveredType app version delivered type
	//image: this is a docker image
	//slug: this is a source code tar file
	DeliveredType string `gorm:"column:delivered_type;size:40" json:"delivered_type"`  //kind
	DeliveredPath string `gorm:"column:delivered_path;size:250" json:"delivered_path"` //交付物path
	ImageName     string `gorm:"column:image_name;size:250" json:"image_name"`         //运行镜像名称
	Cmd           string `gorm:"column:cmd;size:2048" json:"cmd"`                      //启动命令
	RepoURL       string `gorm:"column:repo_url;size:2047" json:"repo_url"`
	CodeVersion   string `gorm:"column:code_version;size:40" json:"code_version"`
	CodeBranch    string `gorm:"column:code_branch;size:40" json:"code_branch"`
	CommitMsg     string `gorm:"column:code_commit_msg;size:1024" json:"code_commit_msg"`
	Author        string `gorm:"column:code_commit_author;size:40" json:"code_commit_author"`
	//FinalStatus app version status
	//success: version available
	//failure: build failure
	//lost: there is no delivered
	FinalStatus string    `gorm:"column:final_status;size:40" json:"final_status"`
	FinishTime  time.Time `gorm:"column:finish_time;" json:"finish_time"`
	PlanVersion string    `gorm:"column:plan_version;size:250" json:"plan_version"`
}

VersionInfo version info struct

func (*VersionInfo) CreateShareImage

func (t *VersionInfo) CreateShareImage(hubURL, namespace, appVersion string) (string, error)

CreateShareImage create share image name

func (*VersionInfo) TableName

func (t *VersionInfo) TableName() string

TableName 表名

type VolumeType

type VolumeType string

VolumeType 存储类型

var AliCloudVolumeType VolumeType = "alicloud-disk"

AliCloudVolumeType alicloud volume type

var CephRBDVolumeType VolumeType = "ceph-wt"

CephRBDVolumeType ceph wt volume type

var ConfigFileVolumeType VolumeType = "config-file"

ConfigFileVolumeType configuration file volume type

var LocalVolumeType VolumeType = "local"

LocalVolumeType 本地文件存储

var MemoryFSVolumeType VolumeType = "memoryfs"

MemoryFSVolumeType 内存文件存储

var ShareFileVolumeType VolumeType = "share-file"

ShareFileVolumeType 共享文件存储

func MakeNewVolume

func MakeNewVolume(name string) VolumeType

MakeNewVolume make volumeType

func (VolumeType) String

func (vt VolumeType) String() string

Jump to

Keyboard shortcuts

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