common

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Zlib Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AToInt added in v1.3.40

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

func AToInt64 added in v1.3.40

func AToInt64(arr []interface{}) []int64

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 ExcludeElement added in v1.3.52

func ExcludeElement[T EleType](all []T, src ...T) []T

ExcludeElement 排除 找src不存在all

func FilterElement added in v1.3.52

func FilterElement[T EleType](all []T, cb FilterFunc[T]) []T

FilterElement 过滤某元素

func FindElement added in v1.3.54

func FindElement[T EleType](all []T, src T) bool

func IncludeElement added in v1.3.52

func IncludeElement[T EleType](all []T, src ...T) []T

IncludeElement 包含 找src在all

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

RemoveDuplicateElement 除重

func RemoveElement added in v1.3.52

func RemoveElement[T EleType](all []T, src T) []T

RemoveElement 移除某元素

func StructFields added in v1.1.36

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

func StructVal added in v1.3.40

func StructVal(s interface{}) reflect.Value

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 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 Bit added in v1.3.46

type Bit[T BitType] interface {
	Int() T
}

type BitType added in v1.3.46

type BitType interface {
	int8 | int | int32 | int64 | uint8 | uint | uint32 | uint64
}

type EleType added in v1.0.53

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

type FilterFunc added in v1.3.52

type FilterFunc[T EleType] func(v T) bool

type Flag added in v1.3.46

type Flag[T BitType] struct {
	FInt T `json:"flag,omitempty"`
}

func WithFlag added in v1.3.46

func WithFlag[T BitType](flag T) Flag[T]

func (Flag[T]) Int added in v1.3.46

func (f Flag[T]) Int() T

func (Flag[T]) IsBit added in v1.3.46

func (f Flag[T]) IsBit(bit Bit[T]) bool

type IntegerType added in v1.3.40

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

type RecoverFunc added in v1.1.21

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

type RunningCheck added in v1.3.58

type RunningCheck struct {
	// contains filtered or unexported fields
}

func (*RunningCheck) IsRunning added in v1.3.58

func (rc *RunningCheck) IsRunning() bool

func (*RunningCheck) TryGoRunning added in v1.3.58

func (rc *RunningCheck) TryGoRunning(fn func())

Jump to

Keyboard shortcuts

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