model

package
v5.1.3-release+incompa... Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALLPOWER = "all_power"

ALLPOWER ALLPOWER

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

DownNetPlugin 下游网络插件

View Source
var GeneralPlugin = "general-plugin"

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

View Source
var HTTPGROUP = "http"

HTTPGROUP HTTPGROUP

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 LabelKeyServiceType = "service-type"

LabelKeyServiceType 应用部署类型标签

View Source
var MYSQLPROTOCOL = "mysql"

MYSQLPROTOCOL MYSQLPROTOCOL

View Source
var NODEMANAGER = "node_manager"

NODEMANAGER NODEMANAGER

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 UpNetPlugin = "net-plugin:up"

UpNetPlugin 上游网络插件

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 int    `gorm:"column:backup_size" json:"backup_size"`
	Deleted    bool   `gorm:"column:deleted" json:"deleted"`
}

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

func (*AppStatus) TableName

func (t *AppStatus) TableName() string

TableName 表名

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 DiscorveryType

type DiscorveryType string

DiscorveryType type of service discovery center.

var DiscorveryTypeEtcd DiscorveryType = "etcd"

DiscorveryTypeEtcd etcd

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"`
	//use pointer type, zero values won't be saved into database
	IsOnline *bool `gorm:"column:is_online;default:true" json:"is_online"`
}

Endpoint is a persistent object for table 3rd_party_svc_endpoints.

func (Endpoint) TableName

func (Endpoint) TableName() string

TableName returns table name of Endpoint.

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 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"`
	ContainerPort int    `gorm:"column:container_port"`
	Domain        string `gorm:"column:domain"`
	Path          string `gorm:"column:path"`
	Header        string `gorm:"column:header"`
	Cookie        string `gorm:"column:cookie"`
	Weight        int    `gorm:"column:weight"`
	IP            string `gorm:"column:ip"`
	CertificateID string `gorm:"column:certificate_id"`
}

HTTPRule contains http rule

func (HTTPRule) TableName

func (HTTPRule) TableName() string

TableName returns table name of HTTPRule

type IDModel

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

IDModel 默认ID字段

type IPPool

type IPPool struct {
	Model
	EID  string `gorm:"column:eid"`
	CIDR string `gorm:"column:cidr"`
}

IPPool is used to save information about the IP pool.

func (IPPool) TableName

func (IPPool) TableName() string

TableName returns table name of IPPool

type IPPort

type IPPort struct {
	Model
	UUID string `gorm:"column:uuid"`
	IP   string `gorm:"column:ip"`
	Port int    `gorm:"column:port"`
}

IPPort records ip addresses and ports that has been used.

func (IPPort) TableName

func (IPPort) TableName() string

TableName returns table name of IPPort

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

Model 默认字段

type NotificationEvent

type NotificationEvent struct {
	Model
	//Kind could be service, tenant, cluster, node
	Kind string `gorm:"column:kind;size:40"`
	//KindID could be service_id,tenant_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"`
	TenantName    string    `gorm:"column:tenant_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 RegionUserInfo

type RegionUserInfo struct {
	Model
	EID            string `gorm:"column:eid;size:34" json:"eid"`
	APIRange       string `gorm:"column:api_range;size:24" json:"api_range"`
	RegionTag      string `gorm:"column:region_tag;size:24" json:"region_tag"`
	ValidityPeriod int    `gorm:"column:validity_period;size:10" json:"validity_period"`
	Token          string `gorm:"column:token;size:32" json:"token"`
	CA             string `gorm:"column:ca;size:4096" json:"ca"`
	Key            string `gorm:"column:key;size:4096" json:"key"`
}

RegionUserInfo RegionUserInfo

func (*RegionUserInfo) TableName

func (t *RegionUserInfo) 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"`
	TenantID    string `gorm:"column:tenant_id;size:40"`
	ServiceID   string `gorm:"column:service_id;size:40"`
	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"`
	Status      string `gorm:"column:status;size:40"`
	FinalStatus string `gorm:"column:final_status;size:40"`
	Message     string `gorm:"column:message"`

	//abandoned
	DeployVersion string `gorm:"column:deploy_version;size:40"`
	//abandoned
	OldDeployVersion string `gorm:"column:old_deploy_version;size:40"`
	//abandoned
	CodeVersion string `gorm:"column:code_version;size:200"`
	//abandoned
	OldCodeVersion string `gorm:"column:old_code_version;size:200"`
}

ServiceEvent event struct

func (*ServiceEvent) TableName

func (t *ServiceEvent) TableName() string

TableName 表名

type ServiceKind

type ServiceKind string

ServiceKind kind of service

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 TCPRule

type TCPRule struct {
	Model
	UUID          string `gorm:"column:uuid"`
	ServiceID     string `gorm:"column:service_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 TenantPlugin

type TenantPlugin 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,UpNetPlugin,DownNetPlugin
	PluginModel string `gorm:"column:plugin_model" json:"plugin_model"`
	//tenant id
	TenantID string `gorm:"column:tenant_id" json:"tenant_id"`
	//tenant_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"`
}

TenantPlugin plugin model

func (*TenantPlugin) TableName

func (t *TenantPlugin) TableName() string

TableName table name

type TenantPluginBuildVersion

type TenantPluginBuildVersion 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:125" json:"container_cpu"`
	// container default memory
	ContainerMemory int `gorm:"column:container_memory;default:64" json:"container_memory"`
	// container args
	ContainerCMD string `gorm:"column:container_cmd;size:2048" json:"container_cmd"`
}

TenantPluginBuildVersion plugin build version

func (*TenantPluginBuildVersion) CreateShareImage

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

CreateShareImage CreateShareImage

func (*TenantPluginBuildVersion) TableName

func (t *TenantPluginBuildVersion) TableName() string

TableName table name

type TenantPluginDefaultENV

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

TenantPluginDefaultENV plugin default env config

func (*TenantPluginDefaultENV) TableName

func (t *TenantPluginDefaultENV) TableName() string

TableName table name

type TenantPluginVersionDiscoverConfig

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

TenantPluginVersionDiscoverConfig service plugin config that can be dynamic discovery

func (*TenantPluginVersionDiscoverConfig) TableName

TableName table name

type TenantPluginVersionEnv

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

TenantPluginVersionEnv TenantPluginVersionEnv

func (*TenantPluginVersionEnv) TableName

func (t *TenantPluginVersionEnv) TableName() string

TableName table name

type TenantServiceConfigFile

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

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

func (*TenantServiceConfigFile) TableName

func (t *TenantServiceConfigFile) TableName() string

TableName returns table name of TenantServiceConfigFile.

type TenantServiceEnvVar

type TenantServiceEnvVar struct {
	Model
	TenantID      string `gorm:"column:tenant_id;size:32" validate:"tenant_id|between:30,33" json:"tenant_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:100" validate:"name" json:"name"`
	AttrName      string `gorm:"column:attr_name" validate:"env_name|required" json:"attr_name"`
	AttrValue     string `gorm:"column:attr_value" 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"`
}

TenantServiceEnvVar 应用环境变量

func (*TenantServiceEnvVar) TableName

func (t *TenantServiceEnvVar) TableName() string

TableName 表名

type TenantServiceLBMappingPort

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

TenantServiceLBMappingPort stream应用端口映射情况

func (*TenantServiceLBMappingPort) TableName

func (t *TenantServiceLBMappingPort) TableName() string

TableName 表名

type TenantServiceLable

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

TenantServiceLable 应用高级标签

func (*TenantServiceLable) TableName

func (t *TenantServiceLable) TableName() string

TableName 表名

type TenantServiceMountRelation

type TenantServiceMountRelation struct {
	Model
	TenantID        string `gorm:"column:tenant_id;size:32" json:"tenant_id" validate:"tenant_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"`
}

TenantServiceMountRelation 应用挂载依赖纪录

func (*TenantServiceMountRelation) TableName

func (t *TenantServiceMountRelation) TableName() string

TableName 表名

type TenantServicePluginRelation

type TenantServicePluginRelation 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:125" json:"container_cpu"`
	// container default memory  v3.5.1 add
	ContainerMemory int  `gorm:"column:container_memory;default:64" json:"container_memory"`
	Switch          bool `gorm:"column:switch;default:false" json:"switch"`
}

TenantServicePluginRelation TenantServicePluginRelation

func (*TenantServicePluginRelation) TableName

func (t *TenantServicePluginRelation) TableName() string

TableName table name

type TenantServiceProbe

type TenantServiceProbe 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:1" 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:30" 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"`
}

TenantServiceProbe 应用探针信息

func (*TenantServiceProbe) TableName

func (t *TenantServiceProbe) TableName() string

TableName 表名

type TenantServiceRelation

type TenantServiceRelation struct {
	Model
	TenantID          string `gorm:"column:tenant_id;size:32" validate:"tenant_id" json:"tenant_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"`
}

TenantServiceRelation 应用依赖关系

func (*TenantServiceRelation) TableName

func (t *TenantServiceRelation) TableName() string

TableName 表名

type TenantServiceVolume

type TenantServiceVolume 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:20" 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:false" json:"is_read_only"`
}

TenantServiceVolume 应用持久化纪录

func (*TenantServiceVolume) TableName

func (t *TenantServiceVolume) TableName() string

TableName 表名

type TenantServices

type TenantServices struct {
	Model
	TenantID  string `gorm:"column:tenant_id;size:32" json:"tenant_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"`
	// 服务描述
	Comment string `gorm:"column:comment" json:"comment"`
	// 容器CPU权重
	ContainerCPU int `gorm:"column:container_cpu;default:500" json:"container_cpu"`
	// 容器最大内存
	ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory"`
	//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"`
}

TenantServices app service base info

func (*TenantServices) Autodomain

func (t *TenantServices) Autodomain(tenantName string, containerPort int) string

Autodomain 构建默认域名

func (*TenantServices) ChangeDelete

func (t *TenantServices) ChangeDelete() *TenantServicesDelete

ChangeDelete ChangeDelete

func (*TenantServices) CreateShareSlug

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

CreateShareSlug 生成源码包分享的地址

func (*TenantServices) TableName

func (t *TenantServices) TableName() string

TableName 表名

type TenantServicesDelete

type TenantServicesDelete struct {
	Model
	TenantID  string `gorm:"column:tenant_id;size:32" json:"tenant_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"`
	// 服务描述
	Comment string `gorm:"column:comment" json:"comment"`
	// 容器CPU权重
	ContainerCPU int `gorm:"column:container_cpu;default:500" json:"container_cpu"`
	// 容器最大内存
	ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory"`
	//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"`
}

TenantServicesDelete 已删除的应用表

func (*TenantServicesDelete) TableName

func (t *TenantServicesDelete) TableName() string

TableName 表名

type TenantServicesPort

type TenantServicesPort struct {
	Model
	TenantID       string `gorm:"column:tenant_id;size:32" validate:"tenant_id|between:30,33" json:"tenant_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"`
}

TenantServicesPort 应用端口信息

func (*TenantServicesPort) TableName

func (t *TenantServicesPort) TableName() string

TableName 表名

type TenantServicesStreamPluginPort

type TenantServicesStreamPluginPort struct {
	Model
	TenantID      string `gorm:"column:tenant_id;size:32" validate:"tenant_id|between:30,33" json:"tenant_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"`
}

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

func (*TenantServicesStreamPluginPort) TableName

func (t *TenantServicesStreamPluginPort) TableName() string

TableName 表名

type Tenants

type Tenants struct {
	Model
	Name        string `gorm:"column:name;size:40;unique_index"`
	UUID        string `gorm:"column:uuid;size:33;unique_index"`
	EID         string `gorm:"column:eid"`
	LimitMemory int    `gorm:"column:limit_memory"`
}

Tenants 租户信息

func (*Tenants) TableName

func (t *Tenants) 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"`
}

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"` //唯一
	EventID      string `gorm:"column:event_id;size:40"`
	ServiceID    string `gorm:"column:service_id;size:40"`
	Kind         string `gorm:"column:kind;size:40"` //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"`  //kind
	DeliveredPath string `gorm:"column:delivered_path;size:250"` //交付物path
	ImageName     string `gorm:"column:image_name;size:250"`     //运行镜像名称
	Cmd           string `gorm:"column:cmd;size:200"`            //启动命令
	RepoURL       string `gorm:"column:repo_url;size:100"`
	CodeVersion   string `gorm:"column:code_version;size:40"`
	CommitMsg     string `gorm:"column:code_commit_msg;size:200"`
	Author        string `gorm:"column:code_commit_author;size:40"`
	//FinalStatus app version status
	//success: version available
	//failure: build failure
	//lost: there is no delivered
	FinalStatus string `gorm:"column:final_status;size:40"`
}

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 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 (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