mjwt

package
v0.0.0-...-db40093 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Access int = iota
	Refresh
)

Enum untuk tipe jwt

View Source
const (
	CLAIMS = "claims"
)

Variables

This section is empty.

Functions

func Init

func Init()

Types

type CustomClaim

type CustomClaim struct {
	Identity    int
	Name        string
	Exp         int64
	ExtraMinute time.Duration
	Type        int
	Fresh       bool
	Roles       []string
}

type JWTAssumer

type JWTAssumer interface {
	GenerateToken(claims CustomClaim) (string, rest_err.APIError)
	ValidateToken(tokenString string) (*jwt.Token, rest_err.APIError)
	ReadToken(token *jwt.Token) (*CustomClaim, rest_err.APIError)
}

func NewJwt

func NewJwt() JWTAssumer

Jump to

Keyboard shortcuts

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