zutil

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 8 Imported by: 27

Documentation

Overview

Package zutil daily development helper functions

Index

Constants

View Source
const BuffSize = 10 * 1024

Variables

This section is empty.

Functions

func CanExpand

func CanExpand(t reflect.Type) bool

func CanInline

func CanInline(t reflect.Type) bool

func CheckErr

func CheckErr(err error, exit ...bool)

CheckErr CheckErr

func GetBuff

func GetBuff() *bytes.Buffer

func GetField

func GetField(v reflect.Value, i int) reflect.Value

func IfVal

func IfVal(condition bool, trueVal, falseVal interface{}) interface{}

IfVal Simulate ternary calculations, pay attention to handling no variables or indexing problems

func LabelType

func LabelType(t reflect.Type) bool

func Nonzero

func Nonzero(v reflect.Value) bool

func PutBuff

func PutBuff(buffer *bytes.Buffer)

func ReflectForNumField

func ReflectForNumField(v reflect.Value, fn func(fieldTag string, kind reflect.Kind, field reflect.Value) bool, tag ...string)

func RunAllMethod added in v0.0.26

func RunAllMethod(st interface{}, args ...interface{}) (err error)

func SetValue

func SetValue(vTypeOf reflect.Kind, vValueOf reflect.Value, value interface{}) (err error)

func Try

func Try(fn func(), catch func(e interface{}), finally ...func())

func WithLockContext

func WithLockContext(fn func())

func WithRunTimeContext

func WithRunTimeContext(closer func(), callback func(time.Duration))

Types

This section is empty.

Directories

Path Synopsis
Package daemon program is installed as a system service to achieve process daemon
Package daemon program is installed as a system service to achieve process daemon

Jump to

Keyboard shortcuts

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