model

package
v0.0.0-...-a3a5c94 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 7 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"
)
View Source
const (
	AppTypeKato = "kato"
	AppTypeHelm = "helm"
)

app type

View Source
const ASYNEVENTTYPE = 0

ASYNEVENTTYPE

View Source
const SYNEVENTTYPE = 1

SYNEVENTTYPE

View Source
const TargetTypePod = "pod"

TargetTypePod

View Source
const TargetTypeService = "service"

TargetTypeService

View Source
const TargetTypeTenant = "tenant"

TargetTypeTenant

View Source
const UsernameSystem = "system"

UsernameSystem

Variables

View Source
var ALLPOWER = "all_power"

ALLPOWER

View Source
var GeneralPlugin = "general-plugin"

GeneralPlugin - general plugin, default classification, lowest priority

View Source
var HTTPGROUP = "http"

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 node affinity label

View Source
var LabelKeyNodeSelector = "node-selector"

LabelKeyNodeSelector node selection label

View Source
var LabelKeyServiceAffinity = "service-affinity"

LabelKeyServiceAffinity application affinity label

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

LabelKeyServiceAntyAffinity applies anti-affinity label

View Source
var LabelKeyServicePrivileged = "privileged"

LabelKeyServicePrivileged -

View Source
var LabelKeyServiceType = "service-type"

LabelKeyServiceType application deployment type label TODO gdevs is to be deleted, and the component type is recorded in the tenant_service table

View Source
var MYSQLPROTOCOL = "mysql"

MYSQLPROTOCOL

View Source
var NODEMANAGER = "node_manager"

NODEMANAGERGER

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

OutBoundNetPlugin

View Source
var SERVERSOURCE = "server_source"

SERVERSOURCE

View Source
var STREAMGROUP = "stream"

STREAMGROUP

View Source
var TCPPROTOCOL = "tcp"

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

View Source
var V2VERSION = "v2"

V2VERSION region version

Functions

func IsGovernanceModeValid

func IsGovernanceModeValid(governanceMode string) bool

IsGovernanceModeValid checks if the governanceMode is valid.

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

AppBackup 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 kato-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

func (*AppStatus) TableName

func (t *AppStatus) TableName() string

TableName

type Application

type Application struct {
	Model
	EID             string `gorm:"column:eid" json:"eid"`
	TenantID        string `gorm:"column:tenant_id" json:"tenant_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:'kato'" 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"`
}

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"`
	//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) 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 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"`
	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 default ID field

type Image

type Image struct {
	Host      string
	Namespace string
	Name      string
}

Image Mirror image

func ParseImage

func ParseImage(name string) (image Image)

ParseImage simply parse the image name

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 returns the name of the license table

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 default field

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

func (*NotificationEvent) TableName

func (n *NotificationEvent) TableName() string

TableName

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

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

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

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;index:tenant_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"`
	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"`
	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,InBoundNetPlugin,OutBoundNetPlugin
	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 model

func (*TenantPlugin) TableName

func (t *TenantPlugin) TableName() string

TableName

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

func (*TenantPluginBuildVersion) TableName

func (t *TenantPluginBuildVersion) TableName() string

TableName

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

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

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

func (*TenantPluginVersionEnv) TableName

func (t *TenantPluginVersionEnv) TableName() string

TableName

type TenantServiceAutoscalerRuleMetrics

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

TenantServiceAutoscalerRuleMetrics -

func (*TenantServiceAutoscalerRuleMetrics) TableName

TableName -

type TenantServiceAutoscalerRules

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

TenantServiceAutoscalerRules -

func (*TenantServiceAutoscalerRules) TableName

func (t *TenantServiceAutoscalerRules) TableName() string

TableName -

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

TenantServiceEnvVar application environment variables

func (*TenantServiceEnvVar) TableName

func (t *TenantServiceEnvVar) TableName() string

TableName table name

type TenantServiceLBMappingPort

type TenantServiceLBMappingPort struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32"`
	//Load balancing VS use port
	Port int `gorm:"column:port;unique_index"`
	//This field is abolished
	//	IP string `gorm:"column:ip"`
	//Apply the original port
	ContainerPort int `gorm:"column:container_port"`
}

TenantServiceLBMappingPort stream application port mapping situation

func (*TenantServiceLBMappingPort) TableName

func (t *TenantServiceLBMappingPort) TableName() string

TableName table name

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 application advanced label

func (*TenantServiceLable) TableName

func (t *TenantServiceLable) TableName() string

TableName table name

type TenantServiceMonitor

type TenantServiceMonitor struct {
	Model
	TenantID        string `gorm:"column:tenant_id;size:40;unique_index:unique_tenant_id_name" json:"tenant_id"`
	ServiceID       string `gorm:"column:service_id;size:40" json:"service_id"`
	Name            string `gorm:"column:name;size:40;unique_index:unique_tenant_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"`
}

TenantServiceMonitor custom service monitor

func (TenantServiceMonitor) TableName

func (TenantServiceMonitor) TableName() string

TableName returns table name of TenantServiceMonitor

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"`
	//Mount path (mount application can be customized)
	VolumePath string `gorm:"column:mnt_name" json:"volume_path" validate:"volume_path|required"`
	//Host path (depending on the host path corresponding to the shared storage of the application)
	HostPath string `gorm:"column:mnt_dir" json:"host_path" validate:"host_path"`
	//Storage name (depending on the name corresponding to the shared storage of the application)
	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 application mount dependency record

func (*TenantServiceMountRelation) TableName

func (t *TenantServiceMountRelation) TableName() string

TableName table name

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

func (*TenantServicePluginRelation) TableName

func (t *TenantServicePluginRelation) TableName() string

TableName

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 request header, key=value,key2=value2
	HTTPHeader string `gorm:"column:http_header;size:300" json:"http_header" validate:"http_header"`
	//Initialize waiting time
	InitialDelaySecond int `gorm:"column:initial_delay_second;size:2;default:4" json:"initial_delay_second" validate:"initial_delay_second"`
	//Detection interval time
	PeriodSecond int `gorm:"column:period_second;size:2;default:3" json:"period_second" validate:"period_second"`
	//Detection timeout
	TimeoutSecond int `gorm:"column:timeout_second;size:3;default:5" json:"timeout_second" validate:"timeout_second"`
	//Whether to enable
	IsUsed *int `gorm:"column:is_used;size:1;default:1" json:"is_used" validate:"is_used"`
	//The number of detections marked as failed
	FailureThreshold int `gorm:"column:failure_threshold;size:2;default:3" json:"failure_threshold" validate:"failure_threshold"`
	//The number of successful detections marked
	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 application probe information

func (*TenantServiceProbe) TableName

func (t *TenantServiceProbe) TableName() string

TableName table name

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 application dependency

func (*TenantServiceRelation) TableName

func (t *TenantServiceRelation) TableName() string

TableName table name

type TenantServiceScalingRecords

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

TenantServiceScalingRecords -

func (*TenantServiceScalingRecords) TableName

func (t *TenantServiceScalingRecords) TableName() string

TableName -

type TenantServiceVolume

type TenantServiceVolume struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id"`
	//Service type
	Category string `gorm:"column:category;size:50" json:"category"`
	//Storage type (share, local, tmpfs)
	VolumeType string `gorm:"column:volume_type;size:64" json:"volume_type"`
	//Storage name
	VolumeName string `gorm:"column:volume_name;size:40" json:"volume_name"`
	//Host address
	HostPath string `gorm:"column:host_path" json:"host_path"`
	//Mount address
	VolumePath string `gorm:"column:volume_path" json:"volume_path"`
	//Whether it is read-only
	IsReadOnly bool `gorm:"column:is_read_only;default:0" json:"is_read_only"`
	// VolumeCapacity storage size
	VolumeCapacity int64 `gorm:"column:volume_capacity" json:"volume_capacity"`
	// AccessMode Read and write mode(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 sharing mode
	SharePolicy string `gorm:"column:share_policy" json:"share_policy"`
	// BackupPolicy backup policy
	BackupPolicy string `gorm:"column:backup_policy" json:"backup_policy"`
	// ReclaimPolicy recycling strategy
	ReclaimPolicy string `json:"reclaim_policy"`
	// Whether AllowExpansion supports expansion
	AllowExpansion bool `gorm:"column:allow_expansion" json:"allow_expansion"`
	// The storage driver alias used by VolumeProviderName
	VolumeProviderName string `gorm:"column:volume_provider_name" json:"volume_provider_name"`
	Mode               *int32 `gorm:"column:mode" json:"mode"`
}

TenantServiceVolume application persistent record

func (*TenantServiceVolume) Key

func (t *TenantServiceVolume) Key() string

Key returns the key of TenantServiceVolume.

func (*TenantServiceVolume) TableName

func (t *TenantServiceVolume) TableName() string

TableName table name

type TenantServiceVolumeType

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

TenantServiceVolumeType tenant service volume type

func (*TenantServiceVolumeType) TableName

func (t *TenantServiceVolumeType) TableName() string

TableName Table Name

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"`
	// service key
	ServiceKey string `gorm:"column:service_key;size:32" json:"service_key"`
	// service alias
	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"`
	// Service description
	Comment string `gorm:"column:comment" json:"comment"`
	// Container CPU weight
	ContainerCPU int `gorm:"column:container_cpu;default:500" json:"container_cpu"`
	// Maximum memory of the container
	ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory"`
	// 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 type  component deploy type stateless_singleton/stateless_multiple/state_singleton/state_multiple
	ExtendMethod string `gorm:"column:extend_method;default:'stateless';" json:"extend_method"`
	// number of nodes
	Replicas int `gorm:"column:replicas;default:1" json:"replicas"`
	// Deployment version
	DeployVersion string `gorm:"column:deploy_version" json:"deploy_version"`
	// Service category: application, cache, store
	Category string `gorm:"column:category" json:"category"`
	// Current status of the service: undeploy,running,closed,unusual,starting,checking,stoping(deprecated)
	CurStatus string `gorm:"column:cur_status;default:'undeploy'" json:"cur_status"`
	// The billing status is 1 billing, 0 is not billed (deprecated)
	Status int `gorm:"column:status;default:0" json:"status"`
	// Latest operation ID
	EventID string `gorm:"column:event_id" json:"event_id"`
	// Tenant ID
	Namespace string `gorm:"column:namespace" json:"namespace"`
	// update time
	UpdateTime time.Time `gorm:"column:update_time" json:"update_time"`
	// Service creation type cloud cloud city service, assistant cloud help service
	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"`
}

TenantServices app service base info

func (*TenantServices) Autodomain

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

Autodomain builds the default domain name

func (*TenantServices) ChangeDelete

func (t *TenantServices) ChangeDelete() *TenantServicesDelete

ChangeDelete ChangeDelete

func (*TenantServices) CreateShareSlug

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

CreateShareSlug generates source code package sharing address

func (*TenantServices) IsSingleton

func (t *TenantServices) IsSingleton() bool

IsSingleton is singleton or multiple service

func (*TenantServices) IsState

func (t *TenantServices) IsState() bool

IsState is state service or stateless service TODO gdevs simply judges whether it is stateful according to the component

func (*TenantServices) TableName

func (t *TenantServices) TableName() string

TableName table name

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"`
	// service key
	ServiceKey string `gorm:"column:service_key;size:32" json:"service_key"`
	// service alias
	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"`
	// Service description
	Comment string `gorm:"column:comment" json:"comment"`
	// Container CPU weight
	ContainerCPU int `gorm:"column:container_cpu;default:500" json:"container_cpu"`
	// Maximum memory of the container
	ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory"`
	// 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"`
	// Expansion method; 0: stateless; 1: stateful; 2: partition
	ExtendMethod string `gorm:"column:extend_method;default:'stateless';" json:"extend_method"`
	// number of nodes
	Replicas int `gorm:"column:replicas;default:1" json:"replicas"`
	// Deployment version
	DeployVersion string `gorm:"column:deploy_version" json:"deploy_version"`
	// Service category: application, cache, store
	Category string `gorm:"column:category" json:"category"`
	// Current status of the service: undeploy,running,closed,unusual,starting,checking,stoping(deprecated)
	CurStatus string `gorm:"column:cur_status;default:'undeploy'" json:"cur_status"`
	// The billing status is 1 billing, 0 is not billed (deprecated)
	Status int `gorm:"column:status;default:0" json:"status"`
	// Latest operation ID
	EventID string `gorm:"column:event_id" json:"event_id"`
	// Tenant ID
	Namespace string `gorm:"column:namespace" json:"namespace"`
	// update time
	UpdateTime time.Time `gorm:"column:update_time" json:"update_time"`
	// Service creation type cloud cloud city service, assistant cloud help service
	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"`
}

TenantServicesDelete deleted application table

func (*TenantServicesDelete) TableName

func (t *TenantServicesDelete) TableName() string

TableName table name

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"`
	K8sServiceName string `gorm:"column:k8s_service_name" json:"k8s_service_name"`
}

TenantServicesPort application port information

func (*TenantServicesPort) IsOpen

func (t *TenantServicesPort) IsOpen() bool

IsOpen checks if the port is opened.

func (*TenantServicesPort) Key

func (t *TenantServicesPort) Key() string

Key returns the key of TenantServicesPort.

func (*TenantServicesPort) TableName

func (t *TenantServicesPort) TableName() string

TableName table name

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 - port mapping information after binding the stream type plug-in

func (*TenantServicesStreamPluginPort) TableName

func (t *TenantServicesStreamPluginPort) TableName() string

TableName

type TenantStatus

type TenantStatus string

TenantStatus -

var (
	// TenantStatusNormal -
	TenantStatusNormal TenantStatus = "normal"
	// TenantStatusDeleting -
	TenantStatusDeleting TenantStatus = "deleting"
	// TenantStatusDeleteFailed -
	TenantStatusDeleteFailed TenantStatus = "delete_failed"
)

func (TenantStatus) String

func (t TenantStatus) String() string

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"`
	Status      string `gorm:"column:status;default:'normal'"`
}

Tenants tenant information

func (*Tenants) TableName

func (t *Tenants) TableName() string

TableName returns the name of the tenant table

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"` //unique
	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"` //deliverable path
	ImageName     string `gorm:"column:image_name;size:250" json:"image_name"`         //run image name
	Cmd           string `gorm:"column:cmd;size:2048" json:"cmd"`                      //start command
	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 nothing 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

func (*VersionInfo) CreateShareImage

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

CreateShareImage

func (*VersionInfo) TableName

func (t *VersionInfo) TableName() string

TableName

type VolumeType

type VolumeType string

VolumeType storage type

var AliCloudVolumeType VolumeType = "alicloud-disk"

AliCloudVolumeType alicloud volume type

var CephRBDVolumeType VolumeType = "ceph-rbd"

CephRBDVolumeType ceph rbd volume type

var ConfigFileVolumeType VolumeType = "config-file"

ConfigFileVolumeType configuration file volume type

var LocalVolumeType VolumeType = "local"

LocalVolumeType local file storage

var MemoryFSVolumeType VolumeType = "memoryfs"

MemoryFSVolumeType memory file storage

var ShareFileVolumeType VolumeType = "share-file"

ShareFileVolumeType shared file storage

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