utils

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRefreshToken

func CreateRefreshToken(secret string, method string, token string) (string, error)

func CreateToken

func CreateToken(secret string, method string, claims jwt.MapClaims, expire int) (string, error)

func Validate

func Validate(v interface{}) (string, error)

func ValidateRefreshToken

func ValidateRefreshToken(secret string, method string, tokenString string) (jwt.MapClaims, error)

func ValidateToken

func ValidateToken(secret string, signing string, bearerToken string) (jwt.MapClaims, error)

Types

type Cache

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

func NewCache

func NewCache(lifetime time.Duration) *Cache

func (*Cache) Get

func (c *Cache) Get(key string) ([]byte, bool)

func (*Cache) Invalidate

func (c *Cache) Invalidate(key string)

func (*Cache) Set

func (c *Cache) Set(key string, value []byte)

type Type

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

func NewType

func NewType() Type

func (Type) List

func (t Type) List() map[string]string

func (Type) Value

func (t Type) Value(key string) string

Jump to

Keyboard shortcuts

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