db

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TableInstance           = "tb_tmc_instance"
	TableInstanceTenant     = "tb_tmc_instance_tenant"
	TableTmc                = "tb_tmc"
	TableTmcVersion         = "tb_tmc_version"
	TableRequestRelation    = "tb_tmc_request_relation"
	TableTmcIni             = "tb_tmc_ini"
	TableProject            = "sp_project"
	TableLogDeployment      = "sp_log_deployment"
	TableLogInstance        = "sp_log_instance"
	TableLogServiceInstance = "sp_log_service_instance"
)

tables name

View Source
const EngineMenuJumpKeyPrefix = "MK_JUMP_"
View Source
const LogTypeLogAnalytics = LogType("log-analytics")
View Source
const LogTypeLogService = LogType("log-service")

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	ID         string    `gorm:"column:id;primary_key"`
	Engine     string    `gorm:"column:engine"`
	Version    string    `gorm:"column:version"`
	ReleaseID  string    `gorm:"column:release_id"`
	Status     string    `gorm:"column:status"`
	Az         string    `gorm:"column:az"`
	Config     string    `gorm:"column:config"`
	Options    string    `gorm:"column:options"`
	IsCustom   string    `gorm:"column:is_custom;default:'N'"`
	IsDeleted  string    `gorm:"column:is_deleted;default:'N'"`
	CreateTime time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP"`
	UpdateTime time.Time `gorm:"column:update_time;default:CURRENT_TIMESTAMP"`
}

Instance .

func (Instance) TableName

func (Instance) TableName() string

TableName .

type InstanceDB

type InstanceDB struct {
	*gorm.DB
}

InstanceDB .

func (*InstanceDB) GetByEngineAndTenantGroup

func (db *InstanceDB) GetByEngineAndTenantGroup(engine string, tenantGroup string) (*Instance, error)

func (*InstanceDB) GetByEngineAndVersionAndAz

func (db *InstanceDB) GetByEngineAndVersionAndAz(engine string, version string, az string) (*Instance, error)

func (*InstanceDB) GetByFields

func (db *InstanceDB) GetByFields(fields map[string]interface{}) (*Instance, error)

func (*InstanceDB) GetByID

func (db *InstanceDB) GetByID(id string) (*Instance, error)

type InstanceTenant

type InstanceTenant struct {
	ID          string    `gorm:"column:id;primary_key"`
	InstanceID  string    `gorm:"column:instance_id"`
	Config      string    `gorm:"column:config"`
	Options     string    `gorm:"column:options"`
	TenantGroup string    `gorm:"column:tenant_group"`
	Engine      string    `gorm:"column:engine"`
	Az          string    `gorm:"column:az"`
	CreateTime  time.Time `gorm:"column:create_time"`
	UpdateTime  time.Time `gorm:"column:update_time"`
	IsDeleted   string    `gorm:"column:is_deleted"`
}

InstanceTenant .

func (InstanceTenant) TableName

func (InstanceTenant) TableName() string

TableName .

type InstanceTenantDB

type InstanceTenantDB struct {
	*gorm.DB
}

InstanceTenantDB .

func (*InstanceTenantDB) GetByEngineAndTenantGroup

func (db *InstanceTenantDB) GetByEngineAndTenantGroup(engine string, tenantGroup string) (*InstanceTenant, error)

func (*InstanceTenantDB) GetByFields

func (db *InstanceTenantDB) GetByFields(fields map[string]interface{}) (*InstanceTenant, error)

func (*InstanceTenantDB) GetByID

func (db *InstanceTenantDB) GetByID(id string) (*InstanceTenant, error)

func (*InstanceTenantDB) GetByTenantGroup

func (db *InstanceTenantDB) GetByTenantGroup(group string) ([]*InstanceTenant, error)

func (*InstanceTenantDB) GetClusterNameByTenantGroup

func (db *InstanceTenantDB) GetClusterNameByTenantGroup(group string) (string, error)

func (*InstanceTenantDB) GetInstanceByTenantGroup added in v1.3.0

func (db *InstanceTenantDB) GetInstanceByTenantGroup(group string) (*InstanceTenant, error)

type LogDeployment

type LogDeployment struct {
	ID           int       `gorm:"column:id;primary_key"`
	OrgId        string    `gorm:"column:org_id"`
	ClusterName  string    `gorm:"column:cluster_name"`
	ClusterType  int       `gorm:"column:cluster_type"`
	EsUrl        string    `gorm:"column:es_url"`
	EsConfig     string    `gorm:"column:es_config"`
	KafkaServers string    `gorm:"column:kafka_servers"`
	KafkaConfig  string    `gorm:"column:kafka_config"`
	CollectorUrl string    `gorm:"column:collector_url"`
	Domain       string    `gorm:"column:domain"`
	Created      time.Time `gorm:"column:created"`
	Updated      time.Time `gorm:"column:updated"`
	LogType      string    `gorm:"column:log_type;default:'log-analytics'"`
}

func (LogDeployment) TableName

func (LogDeployment) TableName() string

type LogDeploymentDB

type LogDeploymentDB struct {
	*gorm.DB
}

func (*LogDeploymentDB) GetByClusterName

func (db *LogDeploymentDB) GetByClusterName(clusterName string, logType LogType) (*LogDeployment, error)

func (*LogDeploymentDB) GetByClusterNameAndOrgId

func (db *LogDeploymentDB) GetByClusterNameAndOrgId(clusterName, orgId string, logType LogType) (*LogDeployment, error)

func (*LogDeploymentDB) GetByOrgId added in v1.3.0

func (db *LogDeploymentDB) GetByOrgId(orgId string, logType LogType) (*LogDeployment, error)

type LogInstance

type LogInstance struct {
	ID              int       `gorm:"column:id;primary_key"`
	LogKey          string    `gorm:"column:log_key"`
	OrgId           string    `gorm:"column:org_id"`
	OrgName         string    `gorm:"column:org_name"`
	ClusterName     string    `gorm:"column:cluster_name"`
	ProjectId       string    `gorm:"column:project_id"`
	ProjectName     string    `gorm:"column:project_name"`
	Workspace       string    `gorm:"column:workspace"`
	ApplicationId   string    `gorm:"column:application_id"`
	ApplicationName string    `gorm:"column:application_name"`
	RuntimeId       string    `gorm:"column:runtime_id"`
	RuntimeName     string    `gorm:"column:runtime_name"`
	Config          string    `gorm:"column:config"`
	Version         string    `gorm:"column:version"`
	Plan            string    `gorm:"column:plan"`
	IsDelete        int       `gorm:"column:is_delete"`
	Created         time.Time `gorm:"column:created"`
	Updated         time.Time `gorm:"column:updated"`
	LogType         string    `gorm:"column:log_type;default:'log-analytics'"`
}

func (LogInstance) TableName

func (LogInstance) TableName() string

type LogInstanceDB

type LogInstanceDB struct {
	*gorm.DB
}

func (*LogInstanceDB) GetLatestByLogKey

func (db *LogInstanceDB) GetLatestByLogKey(logKey string, logType LogType) (*LogInstance, error)

type LogServiceInstance added in v1.3.0

type LogServiceInstance struct {
	ID       string `gorm:"column:id;primary_key"`
	EsUrls   string `gorm:"column:es_urls"`
	EsConfig string `gorm:"column:es_config"`
}

func (LogServiceInstance) TableName added in v1.3.0

func (LogServiceInstance) TableName() string

type LogServiceInstanceDB added in v1.3.0

type LogServiceInstanceDB struct {
	*gorm.DB
}

func (*LogServiceInstanceDB) AddOrUpdateEsUrls added in v1.3.0

func (db *LogServiceInstanceDB) AddOrUpdateEsUrls(instanceId, esUrls, esConfig string) error

func (*LogServiceInstanceDB) GetFirst added in v1.3.0

func (db *LogServiceInstanceDB) GetFirst() (*LogServiceInstance, error)

type LogType added in v1.3.0

type LogType string

type Project

type Project struct {
	ID          int       `gorm:"column:id;primary_key"`
	Identity    string    `gorm:"column:identity"`
	Name        string    `gorm:"column:name"`
	Description string    `gorm:"column:description"`
	Ats         string    `gorm:"column:ats"`
	Callback    string    `gorm:"column:callback"`
	ProjectId   string    `gorm:"column:project_id"`
	CreateTime  time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP"`
	UpdateTime  time.Time `gorm:"column:update_time;default:CURRENT_TIMESTAMP"`
	IsDeleted   string    `gorm:"column:is_deleted;default:'N'"`
}

func (Project) TableName

func (Project) TableName() string

type ProjectDB

type ProjectDB struct {
	*gorm.DB
}

func (*ProjectDB) GetByProjectId

func (db *ProjectDB) GetByProjectId(projectId string) (*Project, error)

type Tmc

type Tmc struct {
	ID          int       `gorm:"column:id;primary_key"`
	Name        string    `gorm:"column:name"`
	Engine      string    `gorm:"column:engine"`
	ServiceType string    `gorm:"column:service_type"`
	DeployMode  string    `gorm:"column:deploy_mode"`
	IsDeleted   string    `gorm:"column:is_deleted"`
	CreateTime  time.Time `gorm:"column:create_time"`
	UpdateTime  time.Time `gorm:"column:update_time"`
}

Tmc .

func (Tmc) TableName

func (Tmc) TableName() string

TableName .

type TmcDB

type TmcDB struct {
	*gorm.DB
}

TmcDB .

func (*TmcDB) GetByEngine

func (db *TmcDB) GetByEngine(engine string) (*Tmc, error)

type TmcIni

type TmcIni struct {
	ID         int       `gorm:"column:id,primary_key"`
	IniName    string    `gorm:"column:ini_name"`
	IniDesc    string    `gorm:"column:ini_desc"`
	IniValue   string    `gorm:"column:ini_value"`
	CreateTime time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP"`
	UpdateTime time.Time `gorm:"column:update_time;default:CURRENT_TIMESTAMP"`
	IsDeleted  string    `gorm:"column:is_deleted;default:'N'"`
}

func (TmcIni) TableName

func (TmcIni) TableName() string

type TmcIniDB

type TmcIniDB struct {
	*gorm.DB
}

func (TmcIniDB) GetMicroServiceEngineJumpKey

func (db TmcIniDB) GetMicroServiceEngineJumpKey(engine string) (string, error)

type TmcRequestRelation

type TmcRequestRelation struct {
	ID              int       `gorm:"column:id;primary_key;"`
	ParentRequestId string    `gorm:"column:parent_request_id"`
	ChildRequestId  string    `gorm:"column:child_request_id"`
	CreateTime      time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP"`
	UpdateTime      time.Time `gorm:"column:update_time;default:CURRENT_TIMESTAMP"`
	IsDeleted       string    `gorm:"column:is_deleted;default:'N'"`
}

func (TmcRequestRelation) TableName

func (TmcRequestRelation) TableName() string

type TmcRequestRelationDB

type TmcRequestRelationDB struct {
	*gorm.DB
}

TmcRequestRelationDB .

func (*TmcRequestRelationDB) DeleteRequestRelation

func (db *TmcRequestRelationDB) DeleteRequestRelation(parentId string, childId string) error

func (*TmcRequestRelationDB) GetChildRequestIdsByParentId

func (db *TmcRequestRelationDB) GetChildRequestIdsByParentId(parentId string) ([]string, error)

type TmcVersion

type TmcVersion struct {
	ID         int       `gorm:"column:id;primary_key"`
	Engine     string    `gorm:"column:engine"`
	Version    string    `gorm:"column:version"`
	ReleaseId  string    `gorm:"column:release_id"`
	CreateTime time.Time `gorm:"column:create_time"`
	UpdateTime time.Time `gorm:"column:update_time"`
	IsDeleted  string    `gorm:"column:is_deleted"`
}

TmcVersion .

func (TmcVersion) TableName

func (TmcVersion) TableName() string

type TmcVersionDB

type TmcVersionDB struct {
	*gorm.DB
}

func (*TmcVersionDB) GetByEngine

func (db *TmcVersionDB) GetByEngine(engine string, version string) (*TmcVersion, error)

func (*TmcVersionDB) GetLatestVersionByEngine

func (db *TmcVersionDB) GetLatestVersionByEngine(engine string) (*TmcVersion, error)

func (*TmcVersionDB) UpdateReleaseId

func (db *TmcVersionDB) UpdateReleaseId(engine string, version string, releaseId string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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