auth

package
v0.0.0-...-e6b7f3d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimsCtx = contextKey("claims")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	ParseToken(string) (*claims.Claims, error)
	GenerateToken(*claims.Claims) (string, error)
}

type Mock

type Mock struct{}

func NewMock

func NewMock() *Mock

func (*Mock) GenerateToken

func (m *Mock) GenerateToken(newClaims *claims.Claims) (string, error)

func (*Mock) ParseToken

func (m *Mock) ParseToken(token string) (*claims.Claims, error)

type Production

type Production struct {
	Secret string
	Expire time.Duration
}

func NewProduction

func NewProduction(secret string) *Production

func (*Production) GenerateToken

func (p *Production) GenerateToken(newClaims *claims.Claims) (string, error)

func (*Production) ParseToken

func (p *Production) ParseToken(token string) (*claims.Claims, error)

Jump to

Keyboard shortcuts

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