mockdb

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

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

Go to latest
Published: Jul 16, 2017 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package mockdb contains a mock database interface suitable for testing or experimentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserDao

type UserDao struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UserDao stores and retrieves information on users.

func NewUserDao

func NewUserDao() *UserDao

NewUserDao is a convenience constructor.

func (*UserDao) Info

func (ud *UserDao) Info(username string) (*db.User, error)

Info returns information about a user in the database.

func (*UserDao) Login

func (ud *UserDao) Login(username, password string) (bool, *db.User, error)

Login authenticates a user with the given credentials or fails with an error.

func (*UserDao) Register

func (ud *UserDao) Register(info db.User, password string) (*db.User, error)

Register will create a new user account with the given information and credentials or fail with an error.

Jump to

Keyboard shortcuts

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