Documentation
¶
Index ¶
- Variables
- type Database
- func (d *Database) Close() error
- func (d *Database) DeleteAllDevices(userEmail string) error
- func (d *Database) DeleteAllDevicesReturningIDs(userEmail string) ([]string, error)
- func (d *Database) DeleteDevice(userEmail, deviceID string) error
- func (d *Database) GetDeviceSecret(deviceID string) (string, int, error)
- func (d *Database) SaveDeviceSecret(userEmail, deviceName, secret string) (string, error)
- func (d *Database) UpdateDeviceSecret(deviceID string) (int, error)
- type Option
- func WithAutoCreateSchema(enabled bool) Option
- func WithCleanupInterval(d time.Duration) Option
- func WithConnMaxIdleTime(d time.Duration) Option
- func WithConnMaxLifetime(d time.Duration) Option
- func WithMaxIdleConns(n int) Option
- func WithMaxOpenConns(n int) Option
- func WithUserEmailReference(reference string) (Option, error)
- type UserDevice
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedDriver = errors.New("database requires a *sql.DB backed by the pgx stdlib driver")
View Source
var ErrUserNotFound = errors.New("user not found")
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) DeleteAllDevices ¶
func (*Database) DeleteAllDevicesReturningIDs ¶
func (*Database) DeleteDevice ¶
func (*Database) GetDeviceSecret ¶
func (*Database) SaveDeviceSecret ¶
type Option ¶
type Option func(*options)
func WithAutoCreateSchema ¶
func WithCleanupInterval ¶
func WithConnMaxIdleTime ¶
func WithConnMaxLifetime ¶
func WithMaxIdleConns ¶
func WithMaxOpenConns ¶
func WithUserEmailReference ¶
Click to show internal directories.
Click to hide internal directories.