utils

package
v0.0.0-...-b8d1666 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToIntSlice

func ConvertToIntSlice(s string) ([]int, error)

func EncodeMD5

func EncodeMD5(value string) string

EncodeMD5 md5 encryption

func GenerateToken

func GenerateToken(password string, id, level int) (string, error)

GenerateToken generate tokens used for auth

func GetPage

func GetPage(page int) int

func MustInt

func MustInt(s string) (int, error)

func Setup

func Setup()

Types

type Claims

type Claims struct {
	Id        int    `json:"id"`
	Password  string `json:"password"`
	RoleLevel int    `json:"level"`
	jwt.StandardClaims
}

func ParseToken

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

ParseToken parsing token

Jump to

Keyboard shortcuts

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