utils

package
v1.2.36 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

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

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 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 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