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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const LogMetricConfigTable = "sp_log_metric_config"

LogMetricConfigTable .

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*gorm.DB
	LogMetricConfig LogMetricConfigDB
}

DB .

func New

func New(db *gorm.DB) *DB

New .

func (*DB) Begin

func (db *DB) Begin() *DB

Begin .

type LogMetricConfig

type LogMetricConfig struct {
	ID         int64     `gorm:"column:id" json:"id"`
	OrgID      int64     `gorm:"column:org_id" json:"org_id"`
	Scope      string    `gorm:"column:scope" json:"scope"`
	ScopeID    string    `gorm:"column:scope_id" json:"scope_id"`
	Name       string    `gorm:"column:name" json:"name"`
	Metric     string    `gorm:"column:metric" json:"metric"`
	Filters    string    `gorm:"column:filters" json:"filters"`
	Processors string    `gorm:"column:processors" json:"processors"`
	Enable     bool      `gorm:"column:enable" json:"enable"`
	CreateTime time.Time `gorm:"column:create_time" json:"create_time"`
	UpdateTime time.Time `gorm:"column:update_time" json:"update_time"`
}

LogMetricConfig .

func (LogMetricConfig) TableName

func (LogMetricConfig) TableName() string

TableName .

type LogMetricConfigDB

type LogMetricConfigDB struct {
	*gorm.DB
}

LogMetricConfigDB .

func (*LogMetricConfigDB) Delete

func (db *LogMetricConfigDB) Delete(scope, scopeID string, id int64) error

Delete .

func (*LogMetricConfigDB) Enable

func (db *LogMetricConfigDB) Enable(scope, scopeID string, id int64, enable bool) error

Enable .

func (*LogMetricConfigDB) Insert

func (db *LogMetricConfigDB) Insert(cfg *LogMetricConfig) error

Insert .

func (*LogMetricConfigDB) QueryByID

func (db *LogMetricConfigDB) QueryByID(scope, scopeID string, id int64) (*LogMetricConfig, error)

QueryByID .

func (*LogMetricConfigDB) QueryByScope

func (db *LogMetricConfigDB) QueryByScope(scope, scopeID string) ([]*LogMetricConfig, error)

QueryByScope .

func (*LogMetricConfigDB) QueryEnabledByScope

func (db *LogMetricConfigDB) QueryEnabledByScope(scope, scopeID string) (list []*LogMetricConfig, err error)

QueryEnabledByScope .

func (*LogMetricConfigDB) Update

func (db *LogMetricConfigDB) Update(cfg *LogMetricConfig) error

Update .

Jump to

Keyboard shortcuts

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