sql

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoRow returns if rows is not found
	ErrNoRow = errors.New("not found")
)

Functions

This section is empty.

Types

type PostgresAlert

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

PostgresAlert represent Postgres implementation for Alert storage

func (*PostgresAlert) CreateTable added in v0.8.2

func (p *PostgresAlert) CreateTable() error

func (*PostgresAlert) Get

func (p *PostgresAlert) Get(alertName string) (*alert.Alert, error)

Get is an implementation of the storage interface

func (*PostgresAlert) Index

func (p *PostgresAlert) Index(levels []alert.Level) (alert.Alerts, error)

Index is an implementation of the storage interface

func (*PostgresAlert) Update

func (p *PostgresAlert) Update(name string, level alert.Level) (*alert.Alert, bool, error)

Update is an implementation of the storage interface

type PostgresKV

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

PostgresKV represent the Postgres implementation of the KV storage

func (*PostgresKV) All

func (p *PostgresKV) All() (map[string]string, error)

All is an implementation of the storage interface

func (*PostgresKV) CreateTable added in v0.8.2

func (p *PostgresKV) CreateTable() error

func (*PostgresKV) Delete

func (p *PostgresKV) Delete(key string) error

Delete is an implementation of the storage interface

func (*PostgresKV) Get

func (p *PostgresKV) Get(key string) (string, error)

Get is an implementation of the storage interface

func (*PostgresKV) Put

func (p *PostgresKV) Put(key, value string) error

Put is an implementation of the storage interface

func (*PostgresKV) Upsert

func (p *PostgresKV) Upsert(key, value string) error

Upsert is an implementation of the storage interface

type SQL

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

SQL implements CoreStorage with the SQL as a storage backend

func New

func New(name, driver, connectionString string, alertsCfg tables.TableAlerts, kvCfg tables.TableKV, timeout time.Duration, logger *zap.Logger) (*SQL, error)

New creates new SQL storage provider

func (*SQL) Alert

func (p *SQL) Alert() corestorage.Alert

Alert returns Alert storage

func (*SQL) KV

func (p *SQL) KV() corestorage.KV

KV returns KV storage

func (*SQL) Name

func (p *SQL) Name() string

Name returns the storage name

func (*SQL) Stop

func (p *SQL) Stop() error

Stop the storage

Jump to

Keyboard shortcuts

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