jwt

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Secret string `yaml:"secret"`
	TTL    int    `yaml:"ttl"`
	Name   string `yaml:"name"`
	Domain string `yaml:"domain"`
}

type ConfigJWT

type ConfigJWT struct {
	Base Base `yaml:"jwt"`
}

type JWT

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

func New

func New(c *ConfigJWT) *JWT

func (*JWT) Cookie

func (s *JWT) Cookie(t []byte) *http.Cookie

func (*JWT) IsExpired

func (s *JWT) IsExpired(err error) bool

func (*JWT) IsNeedUpdate

func (s *JWT) IsNeedUpdate(err error) bool

func (*JWT) Read

func (s *JWT) Read(r *http.Request) []byte

func (*JWT) Sign

func (s *JWT) Sign(d interface{}) ([]byte, error)

func (*JWT) Verify

func (s *JWT) Verify(token []byte) (interface{}, string, error)

Jump to

Keyboard shortcuts

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