auth

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(cnf Config, lg *clog.Logger) (*AuthService, error)

NewAuthService creates a new AuthService

func (*AuthService) AddToken

func (a *AuthService) AddToken(token string)

AddToken adds passed token into storage

func (AuthService) CheckToken

func (a AuthService) CheckToken(token string) bool

CheckToken returns true if token is in storage

func (*AuthService) DeleteToken

func (a *AuthService) DeleteToken(token string)

DeleteToken deletes token from a storage

func (AuthService) GenerateToken

func (a AuthService) GenerateToken() string

GenerateToken generates a new token. GenerateToken doesn't add new token, just return it!

func (*AuthService) Shutdown

func (a *AuthService) Shutdown() error

Shutdown gracefully shutdowns AuthService

func (*AuthService) StartBackgroundJobs

func (a *AuthService) StartBackgroundJobs()

StartBackgroundJobs starts all background jobs

type Config

type Config struct {
	Debug bool

	TokensJSONFile string
	Encrypt        bool
	PassPhrase     [32]byte

	MaxTokenLife time.Duration
}

Jump to

Keyboard shortcuts

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