Documentation ¶
Overview ¶
Package zutil daily development helper functions
Index ¶
- Constants
- 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() *bytes.Buffer
- func GetField(v reflect.Value, i int) reflect.Value
- func IfVal(condition bool, trueVal, falseVal interface{}) interface{}
- 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())
- func WithLockContext(fn func())
- func WithRunTimeContext(closer func(), callback func(time.Duration))
Constants ¶
View Source
const BuffSize = 10 * 1024
Variables ¶
This section is empty.
Functions ¶
func GetAllMethod ¶ added in v0.1.42
GetAllMethod get all methods of struct
func IfVal ¶
func IfVal(condition bool, trueVal, falseVal interface{}) interface{}
IfVal Simulate ternary calculations, pay attention to handling no variables or indexing problems
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 WithLockContext ¶
func WithLockContext(fn func())
func WithRunTimeContext ¶
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package daemon program is installed as a system service to achieve process daemon * @Author: seekwe * @Date: 2020-06-06 17:03:53 * @Last Modified by:: seekwe * @Last Modified time: 2020-06-09 16:39:23
|
Package daemon program is installed as a system service to achieve process daemon * @Author: seekwe * @Date: 2020-06-06 17:03:53 * @Last Modified by:: seekwe * @Last Modified time: 2020-06-09 16:39:23 |
Click to show internal directories.
Click to hide internal directories.