token

package
v0.0.0-...-3898045 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware func(Service) Service

func NewLoggingMiddleware

func NewLoggingMiddleware(logger log.Logger) Middleware

type Option

type Option func(svc *service)

Option is input options for new service

func SetPrivatePEM

func SetPrivatePEM(privatePEM []byte) Option

SetPrivatePEM sets private pem data for the service

func SetPublicPEM

func SetPublicPEM(publicPEM []byte) Option

SetPublicPEM sets public pem data for the service

type Service

type Service interface {
	GenerateToken(ctx context.Context, expiresIn time.Duration, claims map[string]interface{}) (token string, err error)
	ValidateToken(ctx context.Context, token string) (claims map[string]interface{}, err error)
}

Service is token service interface

func NewService

func NewService(options ...Option) Service

NewService returns new token service

Jump to

Keyboard shortcuts

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