service

package
v0.0.0-...-b54c588 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppTokenClaims

type AppTokenClaims struct {
	Name string `json:"name"` // username
	jwt.StandardClaims
}

type IJWTService

type IJWTService interface {
	Sign(claims jwt.Claims) (string, error)
	Validate(tokenStr string, claims jwt.Claims) (*jwt.Token, error)
}

type ILoginService

type ILoginService interface {
	InvalidateToken(token *jwt.Token, tokenStr string)
	IsInvalidToken(tokenStr string) bool
	SetToken(res http.ResponseWriter, tokenStr string, exp time.Time)
	GetToken(req *http.Request) (string, error)
}

type JWTService

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

func (JWTService) Constructor

func (manager JWTService) Constructor() *JWTService

func (*JWTService) Sign

func (manager *JWTService) Sign(claims jwt.Claims) (string, error)

func (*JWTService) Validate

func (manager *JWTService) Validate(tokenStr string, claims jwt.Claims) (*jwt.Token, error)

type LoginService

type LoginService struct {
	RedisClient *db.RedisDB `dep:""`
}

func (LoginService) Constructor

func (ls LoginService) Constructor() *LoginService

func (*LoginService) GetToken

func (ls *LoginService) GetToken(req *http.Request) (string, error)

func (*LoginService) InvalidateToken

func (ls *LoginService) InvalidateToken(token *jwt.Token, tokenStr string)

func (*LoginService) IsInvalidToken

func (ls *LoginService) IsInvalidToken(tokenStr string) bool

func (*LoginService) SetToken

func (ls *LoginService) SetToken(res http.ResponseWriter, tokenStr string, exp time.Time)

Jump to

Keyboard shortcuts

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