repository

package
v0.0.0-...-35a342c Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PasswordKey = "passwd"
	TokenKey    = "token"
)

Variables

This section is empty.

Functions

func NewBoltAuthRepository

func NewBoltAuthRepository(db *bolt.DB, bucket string) auth.Repository

NewBoltAuthRepository returns instance of the BoltAuthRepository implementing repository interface defined in auth package.

Types

type BoltAuthRepository

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

func (*BoltAuthRepository) CleanUp

func (b *BoltAuthRepository) CleanUp()

CleanUp iterates through the repository and deletes expired tokens

func (*BoltAuthRepository) DeleteToken

func (b *BoltAuthRepository) DeleteToken(tknvalue string) error

DeleteToken deletes token from the repository with token value as a key

func (*BoltAuthRepository) GetPassword

func (b *BoltAuthRepository) GetPassword() (models.Password, error)

GetPassword gets password from the repository

func (*BoltAuthRepository) GetToken

func (b *BoltAuthRepository) GetToken(tknvalue string) (models.Token, error)

GetToken gets token from the repository with token value as a key

func (*BoltAuthRepository) SetPassword

func (b *BoltAuthRepository) SetPassword(pwd models.Password) error

SetPassword sets password to the repository

func (*BoltAuthRepository) SetToken

func (b *BoltAuthRepository) SetToken(tkn models.Token) error

SetToken sets token to the repository with token value as a key

Jump to

Keyboard shortcuts

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