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 ¶
NewHandler initializes and returns a new Handler
Click to show internal directories.
Click to hide internal directories.