db

package
v0.0.0-...-89bd3ed Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SupportedModel = "0.1.0"

SupportedModel stores the model that is supported by this application

Variables

This section is empty.

Functions

func Connect

func Connect(backend string, args ConnectionArgs) (internal.Storer, error)

Connect connects to a backend database

Types

type ConnectionArgs

type ConnectionArgs struct {
	DSN                    string
	MaxIdleConns           int
	MaxOpenConns           int
	MaxConnLifetimeSeconds int
}

ConnectionArgs required to create a MySQL connection

type MySQLDB

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

MySQLDB A database that does nothing

func (MySQLDB) CheckModel

func (d MySQLDB) CheckModel() error

CheckModel implements Storer interface

func (MySQLDB) Ping

func (d MySQLDB) Ping() error

Ping implements Storer interface

func (MySQLDB) Save

func (d MySQLDB) Save(data *internal.AlertGroup) error

Save implements Storer interface

func (MySQLDB) String

func (MySQLDB) String() string

type NullDB

type NullDB struct{}

NullDB A database that does nothing

func (NullDB) CheckModel

func (NullDB) CheckModel() error

CheckModel implements Storer interface

func (NullDB) Ping

func (NullDB) Ping() error

Ping implements Storer interface

func (NullDB) Save

func (NullDB) Save(data *internal.AlertGroup) error

Save implements Storer interface

func (NullDB) String

func (NullDB) String() string

type PostgresDB

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

PostgresDB A database that does nothing

func (PostgresDB) CheckModel

func (d PostgresDB) CheckModel() error

CheckModel implements Storer interface

func (PostgresDB) Ping

func (d PostgresDB) Ping() error

Ping implements Storer interface

func (PostgresDB) Save

func (d PostgresDB) Save(data *internal.AlertGroup) error

Save implements Storer interface

func (PostgresDB) String

func (PostgresDB) String() string

Jump to

Keyboard shortcuts

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