token

package
v0.0.0-...-d451a21 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITokenService

type ITokenService interface {
	GenerateToken(interface{}) (string, error)
	ParseToken(string) (interface{}, bool)
	UpdateRequestContext(interface{}, *http.Request) *http.Request
	GetRequestContextInfo(*http.Request) interface{}
	RefreshToken(string) (string, error)
	RevokeToken(string) error
	RevokeOtherTokens(string) error
}

func NewJWTService

func NewJWTService() ITokenService

type JWTClaims

type JWTClaims struct {
	jwt.StandardClaims
	Info interface{}
}

type JWTService

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

func (*JWTService) GenerateToken

func (service *JWTService) GenerateToken(info interface{}) (string, error)

func (*JWTService) GetRequestContextInfo

func (service *JWTService) GetRequestContextInfo(
	request *http.Request,
) interface{}

func (*JWTService) ParseToken

func (service *JWTService) ParseToken(tokenString string) (interface{}, bool)

func (*JWTService) RefreshToken

func (service *JWTService) RefreshToken(string) (string, error)

TODO: need to implement

func (*JWTService) RevokeOtherTokens

func (service *JWTService) RevokeOtherTokens(string) error

TODO: need to implement

func (*JWTService) RevokeToken

func (service *JWTService) RevokeToken(string) error

TODO: need to implement

func (*JWTService) UpdateRequestContext

func (service *JWTService) UpdateRequestContext(
	token interface{},
	request *http.Request,
) *http.Request

Jump to

Keyboard shortcuts

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