util

package
v0.0.0-...-928417b Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenInvalid error = errors.New("Couldn't handle this token \r")
)

Functions

func Base64Decode

func Base64Decode(src []byte) ([]byte, error)

func Base64Encode

func Base64Encode(src []byte) []byte

func EncodeMD5

func EncodeMD5(str string) string

md5 encode a string

func GenerateToken

func GenerateToken(email, password string) (string, error)

generate a token

func GetPage

func GetPage(c *gin.Context) int

func RefreshToken

func RefreshToken(refreshToken string, expireTime time.Duration) (string, error)

func Sha1Encode

func Sha1Encode(data string) string

Types

type Claims

type Claims struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	jwt.StandardClaims
}

func ParseToken

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

parse token

Jump to

Keyboard shortcuts

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