adapter

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements Storage interface from storage package.

func New

func New(db *pg.DB) *Adapter

New returns new storage adapter.

func (*Adapter) Healthy

func (adapter *Adapter) Healthy() bool

Healthy performs storage health check.

func (*Adapter) Insert

func (adapter *Adapter) Insert(
	model interface{},
) error

Insert creates new record in the storage.

func (*Adapter) Select

func (adapter *Adapter) Select(
	model interface{},
	limit int,
	condition string,
	params ...interface{},
) error

Select returns set of objects searched by SQL SELECT.

func (*Adapter) Update

func (adapter *Adapter) Update(
	model interface{},
) error

Update changes state of existing model.

Jump to

Keyboard shortcuts

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