storage

package
v0.0.0-...-0b16ac2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DriverNamePostgres = "postgres"

DriverNamePostgres holds driver name for PostgreSQL

Variables

This section is empty.

Functions

func PostgresDSNTests

func PostgresDSNTests() string

PostgresDSNTests returns a postgresql DSN (DB access config string) for testing purposes

Types

type Keeper

type Keeper interface {
	Get(_type, data string) (*models.Param, error)
	Close() error // just for testing purposes
}

Keeper provides storage abstraction

type Postgres

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

Postgres implements Keeper for postgres

func NewPostgres

func NewPostgres() Postgres

NewPostgres creates a new PostgreSQL-based storage via GORM and default/loaded DB settings

func (Postgres) Close

func (s Postgres) Close() error

Close the link to storage

func (Postgres) DB

func (s Postgres) DB() *gorm.DB

DB provides to DB access

func (Postgres) Get

func (s Postgres) Get(_type, data string) (*models.Param, error)

Get a model by ID

Jump to

Keyboard shortcuts

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