Documentation ¶
Index ¶
- Constants
- func NewBoltAuthRepository(db *bolt.DB, bucket string) auth.Repository
- type BoltAuthRepository
- func (b *BoltAuthRepository) CleanUp()
- func (b *BoltAuthRepository) DeleteToken(tknvalue string) error
- func (b *BoltAuthRepository) GetPassword() (models.Password, error)
- func (b *BoltAuthRepository) GetToken(tknvalue string) (models.Token, error)
- func (b *BoltAuthRepository) SetPassword(pwd models.Password) error
- func (b *BoltAuthRepository) SetToken(tkn models.Token) error
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
Click to show internal directories.
Click to hide internal directories.