utils

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormatYYYYMMDDHHMMSS = "20060102150405"
	TimeFormatYYYYMMDD       = "20060102"
	HttpContent              = "application/json"
)

Variables

This section is empty.

Functions

func AppendAsString

func AppendAsString(args ...interface{}) string

func ComparePassword

func ComparePassword(password, hash string) (bool, error)

ComparePassword compare password and hash

func DocInit

func DocInit(app *gin.Engine)

DocInit swagger documentation init

func GenerateHMAC

func GenerateHMAC(secret, data string) (sha string)

func GenerateHash

func GenerateHash(password string) (string, error)

GenerateHash password hash generate

func GetValidFloat

func GetValidFloat(source interface{}) float64

func GetValidString

func GetValidString(source interface{}) string

func Int32Pointer

func Int32Pointer(i int32) *int32

Int32Pointer Get int32 pointer

func JSONMarshal

func JSONMarshal(input interface{}) (result []byte, err error)

JSONMarshal Interface to json

func JSONUnmarshal

func JSONUnmarshal(input []byte) (result interface{}, err error)

JSONUnmarshal Json to interface

func RandStringBytesMaskImprSrcSB

func RandStringBytesMaskImprSrcSB(n int) string

func StrToUint

func StrToUint(value string) (uint, error)

StrToUint String to Uint parser

Types

type API

type API struct {
	Url    string `json:"url"`
	Method string `json:"method"`
}

type Claims

type Claims struct {
	Username string `json:"username"`
	IsActive bool   `json:"is_active"`
	jwt.StandardClaims
}

Claims ...

func ExtractJWTString

func ExtractJWTString(tokenString string) (*Claims, error)

ExtractJWTString Get claim from token string

Jump to

Keyboard shortcuts

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