Documentation ¶
Overview ¶
Package zutil daily development helper functions
Index ¶
- Variables
- func CanExpand(t reflect.Type) bool
- func CanInline(t reflect.Type) bool
- func CheckErr(err error, exit ...bool)
- func GetAllMethod(st interface{}, fn func(numMethod int, m reflect.Method) error) error
- func GetBuff(ss ...int) *bytes.Buffer
- func GetField(v reflect.Value, i int) reflect.Value
- 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 LabelType(t reflect.Type) bool
- func Nonzero(v reflect.Value) bool
- 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 WithLockContext(mu *sync.Mutex, fn func())
- func WithRunMemContext(handler func()) uint64
- func WithRunTimeContext(handler func()) time.Duration
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 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 TryCatch Try exception capture
func WithLockContext ¶
func WithRunMemContext ¶ added in v0.1.61
func WithRunMemContext(handler func()) uint64
func WithRunTimeContext ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.