Documentation ¶
Overview ¶
Package zutil daily development helper functions
Index ¶
- Variables
- func CheckErr(err error, exit ...bool)deprecated
- func GOROOT() string
- func GetAllMethod(s interface{}, fn func(numMethod int, m reflect.Method) error) error
- func GetBuff(ss ...int) *bytes.Buffer
- func GetGid() uint64
- func GetOs() string
- func GetParentProcessName() (string, error)
- func Getenv(name string, def ...string) string
- func IfVal(condition bool, trueVal, falseVal interface{}) interface{}
- func IsDoubleClickStartUp() bool
- func IsLinux() bool
- func IsMac() bool
- func IsWin() bool
- func MaxRlimit() (int, error)
- func Once(fn func() interface{}) func() interface{}
- func PutBuff(buffer *bytes.Buffer)
- func ReflectForNumField(v reflect.Value, ...) error
- func ReflectStructField(v reflect.Type, ...) error
- func RunAllMethod(st interface{}, args ...interface{}) (err error)
- func RunAssignMethod(st interface{}, filter func(methodName string) bool, args ...interface{}) (err error)
- func SetValue(vTypeOf reflect.Kind, vValueOf reflect.Value, value interface{}) (err error)
- func Try(fn func(), catch func(e interface{}), finally ...func())deprecated
- func TryCatch(fn func() error) (err error)
- func UnescapeHTML(s string) string
- func WithRunContext(handler func()) (time.Duration, uint64)
- type Bool
- type Int32
- type Int64
- type Nocmp
- type Stack
Constants ¶
This section is empty.
Variables ¶
View Source
var (
BuffSize = bufTypes[3]
)
Functions ¶
func GetAllMethod ¶ added in v0.1.42
GetAllMethod get all methods of struct
func GetParentProcessName ¶ added in v1.1.15
func IfVal ¶
func IfVal(condition bool, trueVal, falseVal interface{}) interface{}
IfVal Simulate ternary calculations, pay attention to handling no variables or indexing problems
func IsDoubleClickStartUp ¶ added in v1.1.15
func IsDoubleClickStartUp() bool
func MaxRlimit ¶ added in v1.1.21
MaxRlimit tries to set the resource limit RLIMIT_NOFILE to the max (hard limit)
func Once ¶ added in v1.1.25
func Once(fn func() interface{}) func() interface{}
Once initialize the singleton
func ReflectForNumField ¶
func ReflectStructField ¶ added in v0.1.43
func RunAllMethod ¶ added in v0.0.26
func RunAllMethod(st interface{}, args ...interface{}) (err error)
RunAllMethod run all methods of struct
func RunAssignMethod ¶ added in v0.1.48
func RunAssignMethod(st interface{}, filter func(methodName string) bool, args ...interface{}) (err error)
RunAssignMethod run assign methods of struct
func Try
deprecated
func Try(fn func(), catch func(e interface{}), finally ...func())
Deprecated: please use zerror.TryCatch Try exception capture
func UnescapeHTML ¶ added in v1.2.0
func WithRunContext ¶ added in v1.1.24
WithRunContext function execution time and memory
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.