util

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TimeLayout   = "2006-01-02 15:04:05"
	TimeLayoutMs = "2006-01-02 15:04:05.000"
)

Variables

This section is empty.

Functions

func CompressGzip added in v1.5.3

func CompressGzip(data []byte) ([]byte, error)

func DecompressGzip added in v1.5.3

func DecompressGzip(data []byte) ([]byte, error)

func First

func First[T any](defaultArg T, args []T) T

func GetBoolValue

func GetBoolValue(m map[string]any, key string) (bool, bool)

func GetFloatValue

func GetFloatValue(m map[string]any, key string) (float64, bool)

func GetIntValue

func GetIntValue(m map[string]any, key string) (int, bool)

func GetInterfaceSlice

func GetInterfaceSlice(m map[string]any, key string) ([]any, bool)

func GetStringSlice

func GetStringSlice(m map[string]any, key string) ([]string, bool)

func GetStringValue

func GetStringValue(m map[string]any, key string) (string, bool)

func JsonParse

func JsonParse[T any](data []byte) (T, error)

func JsonString

func JsonString(data any) string

func Max

func Max[T int | int32 | int64 | float32 | float64](a, b T) T

func Min

func Min[T int | int32 | int64 | float32 | float64](a, b T) T

func RandStr

func RandStr(ns ...int) string

func UUID

func UUID(ns ...int) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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