db

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const LogDeploymentTable = "sp_log_deployment"

LogDeploymentTable .

View Source
const LogServiceInstanceTable = "sp_log_service_instance"

LogServiceInstanceTable .

View Source
const TableLogInstance = "sp_log_instance"

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*gorm.DB
	LogDeployment        LogDeploymentDB
	LogServiceInstanceDB LogServiceInstanceDB
	LogInstanceDB        LogInstanceDB
}

DB .

func New

func New(db *gorm.DB) *DB

New .

func (*DB) Begin

func (db *DB) Begin() *DB

Begin .

type LogDeployment

type LogDeployment struct {
	ID           int64  `gorm:"column:id" json:"id"`
	OrgID        string `gorm:"column:org_id" json:"org_id"`
	ClusterName  string `gorm:"column:cluster_name" json:"cluster_name"`
	ClusterType  int    `gorm:"column:cluster_type" json:"cluster_type"`
	ESURL        string `gorm:"column:es_url" json:"es_url"`
	ESConfig     string `gorm:"column:es_config" json:"es_config"`
	CollectorURL string `gorm:"column:collector_url" json:"collector_url"`
	Domain       string `gorm:"column:domain" json:"domain"`
	LogType      string `gorm:"column:log_type" json:"log_type"`
}

LogDeployment .

func (LogDeployment) TableName

func (LogDeployment) TableName() string

TableName .

type LogDeploymentDB

type LogDeploymentDB struct {
	*gorm.DB
}

LogDeploymentDB .

func (*LogDeploymentDB) List added in v1.3.0

func (db *LogDeploymentDB) List() ([]*LogDeployment, error)

List .

func (*LogDeploymentDB) QueryByClusters

func (db *LogDeploymentDB) QueryByClusters(clusters ...string) ([]*LogDeployment, error)

QueryByClusters .

func (*LogDeploymentDB) QueryByOrgID

func (db *LogDeploymentDB) QueryByOrgID(orgID int64) ([]*LogDeployment, error)

QueryByOrgID .

func (*LogDeploymentDB) QueryByOrgIDAndClusters added in v1.3.0

func (db *LogDeploymentDB) QueryByOrgIDAndClusters(orgID int64, clusters ...string) ([]*LogDeployment, error)

QueryByOrgIDAndClusters .

type LogInstance added in v1.3.0

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 added in v1.3.0

func (LogInstance) TableName() string

type LogInstanceDB added in v1.3.0

type LogInstanceDB struct {
	*gorm.DB
}

func (*LogInstanceDB) GetByLogKey added in v1.3.0

func (db *LogInstanceDB) GetByLogKey(logKey string) (*LogInstance, error)

func (*LogInstanceDB) GetListByClusterAndProjectIdAndWorkspace added in v1.3.0

func (db *LogInstanceDB) GetListByClusterAndProjectIdAndWorkspace(clusterName, projectId, workspace string) ([]LogInstance, error)

type LogServiceInstance added in v1.3.0

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

LogServiceInstance .

func (LogServiceInstance) TableName added in v1.3.0

func (LogServiceInstance) TableName() string

TableName .

type LogServiceInstanceDB added in v1.3.0

type LogServiceInstanceDB struct {
	*gorm.DB
}

LogServiceInstanceDB .

func (*LogServiceInstanceDB) GetFirst added in v1.3.0

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

Jump to

Keyboard shortcuts

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