deerstore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimescaleDB

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

TimescaleDB store impl.

func NewTimescaleDB

func NewTimescaleDB(ctx context.Context, connURI string) (*TimescaleDB, error)

NewTimescaleDB creates new timescale db store.

func (*TimescaleDB) Close

func (m *TimescaleDB) Close(ctx context.Context)

Close closes connection to pg.

func (*TimescaleDB) Migrate

func (m *TimescaleDB) Migrate(ctx context.Context) error

Migrate creates metrics table and initialize prepared statements.

func (*TimescaleDB) Read

func (m *TimescaleDB) Read(ctx context.Context, filter *deer.ReadFilter) ([]*deer.Metric, error)

Read fetches metrics from database based on filter.

func (*TimescaleDB) Save

func (m *TimescaleDB) Save(ctx context.Context, result *deer.CheckResult)

Save inserts metrics to database.

func (*TimescaleDB) Truncate

func (m *TimescaleDB) Truncate(ctx context.Context) error

Truncate purges data from metrics table.

Jump to

Keyboard shortcuts

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