auth

package
v0.0.0-...-291e031 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) ([]byte, error)

func TestPassword

func TestPassword(possible string, hash []byte) bool

Types

type AuthenticatedUser

type AuthenticatedUser interface {
	ID() string
	IsAuthenticated() bool
	Authenticate(password string) bool
}

type DefaultUserRepo

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

func (DefaultUserRepo) Save

func (r DefaultUserRepo) Save(username string, hash []byte) error

func (DefaultUserRepo) User

func (r DefaultUserRepo) User(username string) (AuthenticatedUser, bool)

type UserRepo

type UserRepo interface {
	User(username string) (AuthenticatedUser, bool)
	Save(username string, hash []byte) error
}

func LoadUserRepo

func LoadUserRepo(users map[string][]byte) UserRepo

func NewUserRepo

func NewUserRepo() UserRepo

Jump to

Keyboard shortcuts

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