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

Documentation

Index

Constants

View Source
const (
	TableProject = "sp_project"
	TableMetric  = "sp_metric"
)

tables name

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckerDB

type CheckerDB struct {
	*gorm.DB
	ScopeInfoUpdateInterval time.Duration
	// contains filtered or unexported fields
}

CheckerDB .

func (*CheckerDB) FullList

func (db *CheckerDB) FullList() (checkers []*pb.Checker, deleted []int64, err error)

type JoinFields added in v1.3.2

type JoinFields struct {
	ID          int64  `gorm:"column:id"`
	Name        string `gorm:"column:name"`
	Mode        string `gorm:"column:mode"`
	URL         string `gorm:"column:url"`
	ProjectID   int64  `gorm:"column:project_id"`
	TenantId    string `gorm:"column:tenant_id"`
	ProjectName string `gorm:"column:project_name"`
	Env         string `gorm:"column:env"`
	Config      string `gorm:"column:config"`
	ScopeID     string `gorm:"column:scope_id"`
	IsDeleted   string `gorm:"column:is_deleted"`
}

JoinFields .

func (*JoinFields) Deleted added in v1.3.2

func (f *JoinFields) Deleted() bool

Deleted .

type Metric

type Metric struct {
	ID         int64     `gorm:"column:id;primary_key"`
	TenantId   string    `gorm:"column:tenant_id"`
	ProjectID  int64     `gorm:"column:project_id"`
	ServiceID  int64     `gorm:"column:service_id"`
	Name       string    `gorm:"column:name"`
	URL        string    `gorm:"column:url"`
	Mode       string    `gorm:"column:mode"`
	Extra      string    `gorm:"column:extra"`
	AccountID  int64     `gorm:"column:account_id"`
	Status     int64     `gorm:"column:status"`
	Env        string    `gorm:"column:env"`
	Config     string    `gorm:"config"`
	CreateTime time.Time `gorm:"column:create_time"`
	UpdateTime time.Time `gorm:"column:update_time"`
	IsDeleted  string    `gorm:"column:is_deleted"`
}

Metric .

func (Metric) TableName

func (Metric) TableName() string

TableName .

type MetricDB

type MetricDB struct {
	*gorm.DB
}

MetricDB .

func (*MetricDB) Create

func (db *MetricDB) Create(m *Metric) error

func (*MetricDB) Delete

func (db *MetricDB) Delete(id int64) error

func (*MetricDB) GetByFields

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

func (*MetricDB) GetByID

func (db *MetricDB) GetByID(id int64) (*Metric, error)

func (*MetricDB) ListByIDs

func (db *MetricDB) ListByIDs(ids ...int64) ([]*Metric, error)

func (*MetricDB) ListByProjectIDAndEnv

func (db *MetricDB) ListByProjectIDAndEnv(projectID int64, env string) ([]*Metric, error)

func (*MetricDB) ListIDs

func (db *MetricDB) ListIDs() ([]int64, error)

func (*MetricDB) Update

func (db *MetricDB) Update(m *Metric) error

type Project

type Project struct {
	ID          int64     `gorm:"column:id;primary_key"`
	Identity    string    `gorm:"column:identity"`
	Name        string    `gorm:"column:config"`
	Description string    `gorm:"column:description"`
	Ats         string    `gorm:"column:ats"`
	Callback    string    `gorm:"column:callback"`
	ProjectID   int64     `gorm:"column:project_id"`
	CreateTime  time.Time `gorm:"column:create_time"`
	UpdateTime  time.Time `gorm:"column:update_time"`
	IsDeleted   string    `gorm:"column:is_deleted"`
}

Project .

func (Project) TableName

func (Project) TableName() string

TableName .

type ProjectDB

type ProjectDB struct {
	*gorm.DB
}

ProjectDB .

func (*ProjectDB) GetByFields

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

func (*ProjectDB) GetByID

func (db *ProjectDB) GetByID(id int64) (*Project, error)

func (*ProjectDB) GetByProjectID

func (db *ProjectDB) GetByProjectID(projectID int64) (*Project, error)

Jump to

Keyboard shortcuts

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