userdb

package module
v0.0.0-...-10de872 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = time.Second * 5

DefaultTimeout is the context timeout for DB requests

View Source
var Salt = "local_dev_secret"

Salt alters the bcrypt password hash (TODO: parameterize)

Functions

This section is empty.

Types

type User

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

User contains information about a user session

type UserDB

type UserDB interface {
	Get(context.Context, string) (User, error)
	Save(context.Context, *User, time.Duration) error
	Verify(context.Context) bool
	Login(context.Context, string, string) bool
	Register(context.Context, string, string) error
}

UserDB is

func NewConnection

func NewConnection(addr, password string) UserDB

NewConnection returns a UserDB interface

Jump to

Keyboard shortcuts

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