util

package
v0.0.0-...-15b0c83 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultString

func DefaultString(val, def string) string

func GenerateToken

func GenerateToken(appKey, appSecret, issuer string, expire time.Duration) (string, error)

func GetJWTSecret

func GetJWTSecret(secret string) []byte

func If

func If(b bool, fn func())

func MD5

func MD5(value string) string

Types

type Claims

type Claims struct {
	AppKey    string `json:"app_key"`
	AppSecret string `json:"app_secret"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token, appSecret string) (*Claims, error)

Jump to

Keyboard shortcuts

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