server

package
v0.0.0-...-0e0368c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBFlags

func DBFlags() (db, dsn *string)

Types

type Bcrypt

type Bcrypt struct{}

func (Bcrypt) Compare

func (_ Bcrypt) Compare(hashedPassword []byte, password string) error

func (Bcrypt) Generate

func (_ Bcrypt) Generate(password string) ([]byte, error)

func (Bcrypt) Name

func (_ Bcrypt) Name() string

type Database

type Database struct {
	*sql.DB
	// contains filtered or unexported fields
}

func OpenDatabase

func OpenDatabase(backend, connStr string) (*Database, error)

func (*Database) All

func (db *Database) All() ([]string, error)

func (*Database) Authenticate

func (db *Database) Authenticate(username, password string) error

func (*Database) Delete

func (db *Database) Delete(username string) error

func (*Database) Insert

func (db *Database) Insert(username, password string) error

func (*Database) Reset

func (db *Database) Reset(username, password string) error

type Scheme

type Scheme interface {
	Compare(hashedPassword []byte, password string) error
	Generate(password string) ([]byte, error)
	Name() string
}

func GetScheme

func GetScheme(scheme string) (Scheme, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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