user

package
v0.0.0-...-85aba21 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotExist

func IsNotExist(e error) bool

Types

type DefaultUser

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

func (*DefaultUser) Email

func (u *DefaultUser) Email() string

func (*DefaultUser) Id

func (u *DefaultUser) Id() string

func (*DefaultUser) Password

func (u *DefaultUser) Password() password.Password

func (*DefaultUser) Username

func (u *DefaultUser) Username() string

type ErrNoUser

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

func (*ErrNoUser) String

func (e *ErrNoUser) String() string

type User

type User interface {
	Id() string
	Username() string
	Email() string // mail.Address
	Password() password.Password
}

func NewDefaultUser

func NewDefaultUser(username string, email string, password password.Password) (User, error)

func NewDefaultUserRaw

func NewDefaultUserRaw(udb UserDB, username string, email string, pswd password.Password) (User, error)

func NewDefaultUserWithID

func NewDefaultUserWithID(id string, username string, email string, password password.Password) (User, error)

type UserDB

type UserDB interface {
	GetUserById(string) (User, error)
	GetUserByEmail(string) (User, error)
	GetUserByUsername(string) (User, error)
	AddUser(User) error
}

Jump to

Keyboard shortcuts

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