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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	InstanceTenantTable = "tb_tmc_instance_tenant"
	MonitorTable        = "sp_monitor"
)

table name

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*gorm.DB
	Monitor        MonitorDb
	InstanceTenant InstanceTenantDb
}

DB .

func New

func New(db *gorm.DB) *DB

New .

func (*DB) Begin

func (db *DB) Begin() *DB

Begin .

type InstanceTenant

type InstanceTenant struct {
	Id          string    `json:"id"`
	InstanceId  string    `json:"instance_id"`
	Config      string    `json:"config"`
	Options     string    `json:"options"`
	CreateTime  time.Time `json:"create_time"`
	UpdateTime  time.Time `json:"update_time"`
	IsDeleted   string    `json:"is_deleted"`
	TenantGroup string    `json:"tenant_group"`
	Engine      string    `json:"engine"`
	Az          string    `json:"az"`
}

func (InstanceTenant) TableName

func (InstanceTenant) TableName() string

type InstanceTenantDb

type InstanceTenantDb struct {
	*gorm.DB
}

func (*InstanceTenantDb) QueryTkByTenantGroup

func (db *InstanceTenantDb) QueryTkByTenantGroup(tenantGroup string) (string, error)

type Monitor

type Monitor struct {
	Id          string    `gorm:"column:id;primary_key"`
	MonitorId   string    `gorm:"column:monitor_id"`
	TerminusKey string    `gorm:"column:terminus_key"`
	Workspace   string    `gorm:"column:workspace"`
	ProjectId   string    `gorm:"column:project_id"`
	ProjectName string    `gorm:"column:project_name"`
	OrgId       string    `gorm:"column:org_id"`
	OrgName     string    `gorm:"column:org_name"`
	ClusterName string    `gorm:"column:cluster_name"`
	Created     time.Time `gorm:"column:created;default:CURRENT_TIMESTAMP"`
	Updated     time.Time `gorm:"column:updated;default:CURRENT_TIMESTAMP"`
}

func (Monitor) TableName

func (Monitor) TableName() string

type MonitorDb

type MonitorDb struct {
	*gorm.DB
}

func (*MonitorDb) GetInstanceByTk

func (db *MonitorDb) GetInstanceByTk(tk string) (Monitor, error)

func (*MonitorDb) GetTkByProjectIdAndWorkspace

func (db *MonitorDb) GetTkByProjectIdAndWorkspace(projectId string, workspace string) (string, error)

func (*MonitorDb) SelectProjectIdByTk

func (db *MonitorDb) SelectProjectIdByTk(tk string) (string, error)

Jump to

Keyboard shortcuts

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