configdb

package
v0.0.0-...-a23bd61 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadPassword = errors.New("bad password")
View Source
var ErrNoPassword = errors.New("user has no password")
View Source
var ErrNoUsername = errors.New("username does not exist")

Functions

This section is empty.

Types

type ConfigDB

type ConfigDB struct {
	DB       *sql.DB
	InMemory bool
}

func NewConfigDB

func NewConfigDB(directory string) (*ConfigDB, error)

type UserStore

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

func NewUserStore

func NewUserStore(db *sql.DB) *UserStore

func (*UserStore) AddUser

func (s *UserStore) AddUser(user core.User, password string) (string, error)

func (*UserStore) DeleteByUsername

func (s *UserStore) DeleteByUsername(username string) error

func (*UserStore) FindAll

func (s *UserStore) FindAll() ([]core.User, error)

func (*UserStore) FindByUsername

func (s *UserStore) FindByUsername(username string) (core.User, error)

func (*UserStore) FindByUsernamePassword

func (s *UserStore) FindByUsernamePassword(username string, password string) (core.User, error)

Given a username and password, return a user only if the user exists with the given password.

func (*UserStore) UpdatePassword

func (s *UserStore) UpdatePassword(username string, password string) error

Jump to

Keyboard shortcuts

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