users

package
v0.0.0-...-e7b361f Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password []byte, cost int) ([]byte, error)

HashPassword hashes a password with bcrypt. cost is in interval [bcrypt.MinCost, bcrypt.MaxCost], i.e. [4, 31]. Use bcrypt.DefaultCost, or 10, if unsure.

func IsPassword

func IsPassword(password, hash []byte) (bool, error)

IsPassword returns whether password is the plaintext equivalent of hash.

Types

type User

type User interface {
	EmailAddress() string
	ID() string
	Name() string
	PasswordHash() []byte
	Role() roles.Role
	Username() string
}

User represents a user.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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