history

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupHistory

func SetupHistory(ctx context.Context, conn *pgxpool.Conn) error

SetupHistory sets all required history functions and validation checks that it can run cleanly.

Types

type Config

type Config struct {
	// Retention of data in days, defaults to 7
	Retention int `default:"7" hcl:"retention,optional"`
	// TimeInterval defines how chunks are split by time defaults to one chunk per 24 hours.
	TimeInterval int `default:"24" hcl:"interval,optional"`
	// TimeTruncation truncates fetch time by hour, for example if we fetch with TimeTruncation = 1 at 11:25 the fetch date will truncate to 11:00
	// defaults to 24 hours, which means one set of fetch data per day.
	TimeTruncation int `default:"24" hcl:"truncation,optional"`
}

func (Config) FetchDate

func (c Config) FetchDate() time.Time

type CreateHyperTableResult

type CreateHyperTableResult struct {
	HypertableId int    `db:"hypertable_id"`
	SchemaName   string `db:"schema_name"`
	TableName    string `db:"table_name"`
	Created      bool   `db:"created"`
}

type TableCreator

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

func NewHistoryTableCreator

func NewHistoryTableCreator(cfg *Config, l hclog.Logger) (*TableCreator, error)

func (TableCreator) CreateTable

func (h TableCreator) CreateTable(ctx context.Context, conn *pgxpool.Conn, t, p *schema.Table) error

Jump to

Keyboard shortcuts

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