util

package
v0.0.0-...-a468dfb Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package util implements some simple tools function for the project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcryptAuth

func BcryptAuth(pw, hash string) bool

BcryptAuth util bcrypt_password authentification @param captain [description]

func CheckEmail

func CheckEmail(email string) (b bool)

CheckEmail util

func CheckNickName

func CheckNickName(nickname string) bool

CheckNickName util

func CreateJWTToken

func CreateJWTToken(secretKey, method string, claims jwt.Claims) (string, error)

CreateJWTToken util

func GetBcryptHash

func GetBcryptHash(pw string) string

GetBcryptHash util GetBcryptHash @param pw the password you need to encrypt

func GetGraphqlArgs

func GetGraphqlArgs(args map[string]FieldArg) graphql.FieldConfigArgument

GetGraphqlArgs util (已弃用,感觉写了也没变简洁)

func ValidateJWTToken

func ValidateJWTToken(tokenString, secretKey string, claims *CustomClaims) (bool, error)

ValidateJWTToken util

Types

type CustomClaims

type CustomClaims struct {
	UserID int    `json:"user_id"`
	Email  string `json:"email"`
	jwt.StandardClaims
}

CustomClaims util

type FieldArg

type FieldArg struct {
	Description string
	Type        graphql.Type
}

FieldArg util

Jump to

Keyboard shortcuts

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