models

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricStatusDisabled = 0
	MetricStatusNormal   = 1
	MetricStatusDeleted  = 2
)
View Source
const (
	MetricNodeDBStatusNormal  = 1
	MetricNodeDBStatusDeleted = 2
)
View Source
const (
	NodeStatusOffline = 0
	NodeStatusOnline  = 1
	NodeStatusDeleted = 2
)
View Source
const (
	NodeDBStatusNormal  = 1
	NodeDBStatusDeleted = 2
)
View Source
const (
	TaskTypeMigrateMetric = 1

	TaskStatusReady   = 1
	TaskStatusRunning = 2
	TaskStatusDone    = 3
	TaskStatusError   = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	ID          int64  `db:"id" gorm:"primaryKey"`
	Name        string `db:"name" validate:"min=1,max=63"`
	SeriesNum   int    `db:"series_num"`
	SeriesLimit int    `db:"series_limit"`
	Status      int    `db:"status"`
	CreatedAt   int64  `db:"created_at" gorm:"autoCreateTime"`
	UpdatedAt   int64  `db:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt   int64  `db:"deleted_at"`

	DBMap sync.Map `gorm:"-"` // map[nodeDBId]*nodeDB
}

func (*Metric) TableName

func (*Metric) TableName() string

type MetricNodeDB

type MetricNodeDB struct {
	ID        int64 `db:"id" gorm:"primaryKey"`
	MetricID  int64 `db:"metric_id"`
	NodeDBID  int64 `db:"node_db_id"`
	Status    int   `db:"status"`
	CreatedAt int64 `db:"created_at" gorm:"autoCreateTime"`
	UpdatedAt int64 `db:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt int64 `db:"deleted_at"`
}

func (*MetricNodeDB) TableName

func (*MetricNodeDB) TableName() string

type MigrateMetricTaskContent added in v0.0.2

type MigrateMetricTaskContent struct {
	FromNodeDBID int64 `json:"from_node_db_id"`
	ToNodeDBID   int64 `json:"to_node_db_id"`
}

type Node

type Node struct {
	ID        int64  `db:"id" gorm:"primaryKey"`
	IP        string `db:"ip" validate:"ip"`
	Port      string `db:"port" validate:"min=1,max=127"`
	Status    int32  `db:"status"`
	DataPath  string `db:"data_path" validate:"min=1,max=127"`
	CreatedAt int64  `db:"created_at" gorm:"autoCreateTime"`
	UpdatedAt int64  `db:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt int64  `db:"deleted_at"`
}

func (*Node) TableName

func (*Node) TableName() string

type NodeDB

type NodeDB struct {
	ID        int64  `db:"id" gorm:"primaryKey"`
	NodeID    int64  `db:"node_id"`
	DBName    string `db:"db_name" validate:"min=1,max=63"`
	Status    int    `db:"status"`
	CreatedAt int64  `db:"created_at" gorm:"autoCreateTime"`
	UpdatedAt int64  `db:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt int64  `db:"deleted_at"`
}

func (*NodeDB) TableName

func (*NodeDB) TableName() string

type Task

type Task struct {
	ID        int64  `db:"id" gorm:"primaryKey"`
	Name      string `db:"name" validate:"min=1,max=63"`
	Type      int    `db:"type"`
	Content   string `db:"content" validate:"min=1,max=2047"`
	Status    int    `db:"status"`
	CreatedAt int64  `db:"created_at" gorm:"autoCreateTime"`
	UpdatedAt int64  `db:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt int64  `db:"deleted_at"`
}

func (*Task) TableName

func (*Task) TableName() string

Jump to

Keyboard shortcuts

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