common

package
v1.3.33 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Zlib Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToInt added in v1.1.36

func ArrayToInt(arr []interface{}) []int

func Defined added in v1.0.54

func Defined(data interface{}, field string) bool

Defined checks if variable is defined in a struct

func Dict added in v1.0.54

func Dict(values ...interface{}) (map[string]interface{}, error)

Dict allows to send more than one variable into a template

func IsMap added in v1.0.54

func IsMap(o interface{}) bool

IsMap checks if some variable is a map

func IsNil

func IsNil(o interface{}) bool

func IsSlice added in v1.0.54

func IsSlice(o interface{}) bool

IsSlice checks if some variable is a slice

func ParseTag added in v1.1.36

func ParseTag(tag string) (string, tagOptions)

func Recover added in v1.0.64

func Recover(cleanups ...func())

func RemoveDuplicateElement added in v1.0.53

func RemoveDuplicateElement[T EleType](values []T) []T

func StrctVal added in v1.1.36

func StrctVal(s interface{}) reflect.Value

func StructFields added in v1.1.36

func StructFields(value reflect.Value, tagName string) []reflect.StructField

func ToFloat64 added in v1.1.36

func ToFloat64(value interface{}) float64

func ToFloat64V2 added in v1.1.36

func ToFloat64V2(reflectValue reflect.Value) float64

func ToInt64 added in v1.1.36

func ToInt64(value interface{}) int64

func ToInt64V2 added in v1.1.36

func ToInt64V2(reflectValue reflect.Value) int64

func ToString added in v1.1.36

func ToString(value interface{}) string

func ToStringV2 added in v1.1.36

func ToStringV2(reflectValue reflect.Value) string

func ToUInt64 added in v1.1.36

func ToUInt64(value interface{}) uint64

func ToUInt64V2 added in v1.1.36

func ToUInt64V2(reflectValue reflect.Value) uint64

Types

type EleType added in v1.0.53

type EleType interface {
	string | int8 | int16 | int | int32 | int64 | float32 | float64 |
		uint8 | uint16 | uint | uint32 | uint64
}

type RecoverFunc added in v1.1.21

type RecoverFunc func(r any)
var DefRecoverFunc RecoverFunc = func(r any) {
}

Jump to

Keyboard shortcuts

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