helper

package
v0.0.0-...-04efeb6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIdKey = "X-Oneapi-Request-Id"
)

Variables

This section is empty.

Functions

func AssignOrDefault

func AssignOrDefault(value string, defaultValue string) string

func Bytes2Size

func Bytes2Size(num int64) string

func CalcElapsedTime

func CalcElapsedTime(start time.Time) int64

CalcElapsedTime return the elapsed time in milliseconds (ms)

func Float64PtrMax

func Float64PtrMax(p *float64, maxValue float64) *float64

func Float64PtrMin

func Float64PtrMin(p *float64, minValue float64) *float64

func GenRequestID

func GenRequestID() string

func GetIp

func GetIp() (ip string)

func GetRequestID

func GetRequestID(ctx context.Context) string

func GetResponseID

func GetResponseID(c *gin.Context) string

func GetTimeString

func GetTimeString() string

func GetTimestamp

func GetTimestamp() int64

func IntMax

func IntMax(a int, b int) int

func Interface2String

func Interface2String(inter interface{}) string

func Max

func Max(a int, b int) int

func MessageWithRequestId

func MessageWithRequestId(message string, id string) string

func OpenBrowser

func OpenBrowser(url string)

func Password2Hash

func Password2Hash(password string) (string, error)

func SetRequestID

func SetRequestID(ctx context.Context, id string) context.Context

func String2Int

func String2Int(str string) int

func UnescapeHTML

func UnescapeHTML(x string) interface{}

func ValidatePasswordAndHash

func ValidatePasswordAndHash(password string, hash string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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