Documentation
¶
Index ¶
- type Config
- type DB
- func (db *DB) AddMetric(metric *Metric) error
- func (db *DB) AddMetricNodeDB(metricNodeDB *MetricNodeDB) error
- func (db *DB) AddNode(node *Node) error
- func (db *DB) AddNodeDB(nodeDB *NodeDB) error
- func (db *DB) AddTask(task *Task) error
- func (db *DB) Close() error
- func (db *DB) GetMetricByID(id int64) (*Metric, error)
- func (db *DB) GetNodeByID(id int64) (*Node, error)
- func (db *DB) GetNodeDBByID(id int64) (*NodeDB, error)
- func (db *DB) GetTaskByID(taskID int64) (*Task, error)
- func (db *DB) ListMetricNodeDB() ([]*MetricNodeDB, error)
- func (db *DB) ListMetricNodeDBByMetricID(metricID int64) ([]*MetricNodeDB, error)
- func (db *DB) ListMetrics() ([]*Metric, error)
- func (db *DB) ListNodeDB() ([]*NodeDB, error)
- func (db *DB) ListNodeDBByNodeID(nodeID int64) ([]*NodeDB, error)
- func (db *DB) ListNodes() ([]*Node, error)
- func (db *DB) ListTask() ([]*Task, error)
- func (db *DB) Open() error
- func (db *DB) UpdateMetric(metric *Metric, columns ...string) (int64, error)
- func (db *DB) UpdateNode(node *Node, columns ...string) (int64, error)
- func (db *DB) UpdateNodeDB(nodeDB *NodeDB, columns ...string) (int64, error)
- func (db *DB) UpdateTask(task *Task, columns ...string) (int64, error)
- func (db *DB) UpdatedMetricNodeDB(metricNodeDB *MetricNodeDB, columns ...string) (int64, error)
- func (db *DB) WithLogger(logger *zap.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Username string `yaml:"Username" mapstructure:"Username"`
Password string `yaml:"Password" mapstructure:"Password"`
IP string `yaml:"IP" mapstructure:"IP"`
Port int `yaml:"Port" mapstructure:"Port"`
Database string `yaml:"Database" mapstructure:"Database"`
Charset string `yaml:"Charset" mapstructure:"Charset"`
}
type DB ¶
type DB struct {
Config Config
DB *util.DB
Logger *zap.Logger
Closing chan struct{}
Closed chan struct{}
}
func (*DB) AddMetricNodeDB ¶
func (*DB) GetMetricByID ¶
func (*DB) GetNodeByID ¶
func (*DB) GetNodeDBByID ¶
func (*DB) GetTaskByID ¶
func (*DB) ListMetricNodeDB ¶
func (*DB) ListMetricNodeDBByMetricID ¶
func (*DB) ListMetrics ¶
func (*DB) ListNodeDB ¶
func (*DB) ListNodeDBByNodeID ¶
func (*DB) UpdateMetric ¶
func (*DB) UpdateNodeDB ¶
func (*DB) UpdatedMetricNodeDB ¶
func (*DB) WithLogger ¶
Click to show internal directories.
Click to hide internal directories.