security

package
v0.0.0-...-aee3e03 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(tag string, in []byte) string

Hash ...

Types

type Identity

type Identity struct {
	ID   string `json:"id"`
	Hash []byte `json:"hash"`
}

Identity ...

func NewIdentity

func NewIdentity(user, pass string) *Identity

NewIdentity ...

func (*Identity) HasEqualPasswordHash

func (i *Identity) HasEqualPasswordHash(pass string) bool

HasEqualsPasswordHash ...

type Repository

type Repository interface {
	GetAll() (identities []*Identity, err error)
	FindByID(id string) (identity *Identity, err error)
	Put(identity *Identity) (err error)
}

Repository ...

func NewFileRepository

func NewFileRepository(filename string) Repository

NewFileRepository ..

type Service

type Service interface {
	AddIdentity(user string, pass string) (err error)
	CheckIdentity(user string, pass string) (isValid bool, err error)
}

Service ...

func NewDefaultService

func NewDefaultService(repo Repository) Service

NewDefaultService ...

Jump to

Keyboard shortcuts

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