users

package
v0.0.0-...-9960df0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type Postgres

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

func NewPostgres

func NewPostgres(db *sql.DB) *Postgres

func (*Postgres) GetByToken

func (p *Postgres) GetByToken(token string) (User, error)

func (*Postgres) GetByUsername

func (p *Postgres) GetByUsername(username string) (User, error)

type StaticUserEntry

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

func (*StaticUserEntry) Password

func (u *StaticUserEntry) Password() string

func (*StaticUserEntry) Token

func (u *StaticUserEntry) Token() string

func (*StaticUserEntry) Username

func (u *StaticUserEntry) Username() string

type StaticUsersDatabase

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

func NewStaticUsersDatabase

func NewStaticUsersDatabase(configuredUsers []*config.User) *StaticUsersDatabase

func (*StaticUsersDatabase) GetByToken

func (d *StaticUsersDatabase) GetByToken(token string) (User, error)

func (*StaticUsersDatabase) GetByUsername

func (d *StaticUsersDatabase) GetByUsername(username string) (User, error)

type User

type User interface {
	Username() string
	Token() string
	Password() string
}

Jump to

Keyboard shortcuts

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