jwt

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestFailed = "JwtRequestFailed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	sptty.BaseConfig

	Expiry time.Duration `yaml:"expiry"`
}

func (*Config) ConfigName

func (s *Config) ConfigName() string

func (*Config) Default

func (s *Config) Default() interface{}

type Request

type Request struct {
	Token  string        `json:"token"`
	Claims jwt.MapClaims `json:"claims"`
}

type Response

type Response struct {
	Token string `json:"token"`
}

type Service

type Service struct {
	sptty.BaseService
	// contains filtered or unexported fields
}

func (*Service) Auther

func (s *Service) Auther(ctx iris.Context)

func (*Service) Init

func (s *Service) Init(app sptty.ISptty) error

func (*Service) Parse

func (s *Service) Parse(tokenStr string) (jwt.MapClaims, error)

func (*Service) Parser

func (s *Service) Parser(ctx iris.Context)

func (*Service) Refresh

func (s *Service) Refresh(tokenStr string) (string, error)

func (*Service) ServiceName

func (s *Service) ServiceName() string

func (*Service) SetSecret

func (s *Service) SetSecret(secret string)

func (*Service) Sign

func (s *Service) Sign(claims jwt.MapClaims) (string, error)

func (*Service) Signer

func (s *Service) Signer(ctx iris.Context)

func (*Service) Validate

func (s *Service) Validate(myClaims jwt.MapClaims, tokenStr string) (jwt.MapClaims, error)

Jump to

Keyboard shortcuts

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