store

package
v0.0.0-...-bb39121 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CREATE_SCHEMA_SQL = `` /* 1459-byte string literal not displayed */
View Source
const INSERT_DATA_STMT = `INSERT INTO data (time, metric, value, tags) VALUES (?, ?, ?, ?)`
View Source
const INSERT_METRIC_STMT = `INSERT INTO meta(name,desc) VALUES(?,?)`
View Source
const INSERT_TAG_STMT = `INSERT OR IGNORE INTO tags(metric,tag) VALUES(?,?)`
View Source
const SELECT_METRIC_STMT = `SELECT * FROM meta WHERE name = ? LIMIT 1`

Variables

This section is empty.

Functions

func NewStore

func NewStore(d *sql.DB) domain.Store

Types

type DataPoint

type DataPoint struct {
	Timestamp int64  `db:"time"`
	Metric    string `db:"metric"`
	Value     int64  `db:"value"`
	Tags      string `db:"tags"`
}

type Metric

type Metric struct {
	Name string `db:"name"`
	Desc string `db:"desc,omitempty"`
}

type MetricTags

type MetricTags struct {
	Metric string `db:"metric"`
	Tag    string `db:"tag"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func (*Store) CreateMetric

func (s *Store) CreateMetric(m domain.Metric) error

func (*Store) DeleteMetric

func (s *Store) DeleteMetric(name string) error

func (*Store) GetDataSet

func (s *Store) GetDataSet(dq domain.DataQuery) ([]domain.DataSet, error)

func (*Store) GetMetric

func (s *Store) GetMetric(name string) (domain.Metric, error)

func (*Store) SaveDataSet

func (s *Store) SaveDataSet(ds domain.DataSet) error

func (*Store) UpdateMetric

func (s *Store) UpdateMetric(m domain.Metric) error

Jump to

Keyboard shortcuts

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