storage

package module
v0.0.0-...-142e2d6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 4 Imported by: 0

README

Soon available.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoResultFound = errors.New("no result has been found")
)

Error messages.

Functions

This section is empty.

Types

type Params

type Params struct {
	Limit  uint64
	Offset uint64
	Where  builder.Where
}

Params is the default parameters for a resource.

type Storage

type Storage interface {
	Connection() database.Connection
	Context(...string) Storage
	Tx(...sql.IsolationLevel) (Storage, error)
	Commit() error
	Rollback() error
	Done()
}

Storage abstract a client.

func NewEnv

func NewEnv(env string) (Storage, error)

NewEnv create a new Storage based on given env variable. Note: it create a new connection.

func NewOnceEnv

func NewOnceEnv(env string) (Storage, error)

NewOnceEnv create a new Storage (with an unique connection) based on given variable. Note: it create a new connection if there is none available.

func NewWith

func NewWith(db database.Connection) Storage

NewWith create a new Storage with the given connection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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