db

package
v0.0.0-...-1be5267 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultMaxIdleConns = 5

Variables

View Source
var ErrorNoConnectionString = errors.New("A connection string must be specified on the first call to Get")

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// GetUser gets a user from the database that matches constraints on the input user
	GetUser(u auth.User) (auth.User, error)
	// UpsertUser updates a user (if input user UUID matches one in the db) or inserts a user
	UpsertUser(u auth.User) error
	// GetAccountSecret gets a user's device secret
	GetAccountSecret(uuid uuid.UUID) (entities.AccountSecret, error)
	// InsertAccountSecret updates or inserts a device secret for the User
	InsertAccountSecret(uuid uuid.UUID, ds entities.AccountSecret) error
	// GetDB returns the Handler's underlying *gorm.DB
	GetDB() *gorm.DB
}

Handler abstracts away common persistence operations needed for this package

func NewHandler

func NewHandler(dbConnection string) (Handler, error)

NewHandler initializes and returns a new Handler

Jump to

Keyboard shortcuts

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