Documentation ¶
Overview ¶
Package ldc implements lodash common util
Index ¶
- Constants
- Variables
- func AddWait(items []interface{}, call func(interface{}) (interface{}, error), ...) ([]interface{}, error)
- func ConvertType(source interface{}, target interface{})
- func DefaultToBool(value bool, target bool) bool
- func DefaultToByte(value byte, target byte) byte
- func DefaultToFloat32(value float32, target float32) float32
- func DefaultToFloat64(value float64, target float64) float64
- func DefaultToInt(value int, target int) int
- func DefaultToInt16(value int16, target int16) int16
- func DefaultToInt32(value int32, target int32) int32
- func DefaultToInt64(value int64, target int64) int64
- func DefaultToInt8(value int8, target int8) int8
- func DefaultToString(value string, target string) string
- func DefaultToUint(value uint, target uint) uint
- func DefaultToUint16(value uint16, target uint16) uint16
- func DefaultToUint32(value uint32, target uint32) uint32
- func DefaultToUint64(value uint64, target uint64) uint64
- func DefaultToUint8(value uint8, target uint8) uint8
- func DefaultToUintptr(value uintptr, target uintptr) uintptr
- func FormatTime(second int64, format string) string
- func Go(call func())
- func GoCatch(call func(), catch func(err interface{}))
- func IfBool(state bool, t bool, f bool) bool
- func IfByte(state bool, t byte, f byte) byte
- func IfFloat32(state bool, t float32, f float32) float32
- func IfFloat64(state bool, t float64, f float64) float64
- func IfInt(state bool, t int, f int) int
- func IfInt16(state bool, t int16, f int16) int16
- func IfInt32(state bool, t int32, f int32) int32
- func IfInt64(state bool, t int64, f int64) int64
- func IfInt8(state bool, t int8, f int8) int8
- func IfString(state bool, t string, f string) string
- func IfUint(state bool, t uint, f uint) uint
- func IfUint16(state bool, t uint16, f uint16) uint16
- func IfUint32(state bool, t uint32, f uint32) uint32
- func IfUint64(state bool, t uint64, f uint64) uint64
- func IfUint8(state bool, t uint8, f uint8) uint8
- func IfUintptr(state bool, t uintptr, f uintptr) uintptr
- func Length(str string) int
- func Location() string
- func Md5(str string) string
- func ParseBase64(str string) string
- func ParseBase64Err(str string) (string, error)
- func ParseHtml(htmlStr string) *goquery.Document
- func ParseHtmlErr(htmlStr string) (*goquery.Document, error)
- func ParseInt(str string) int
- func ParseIntErr(str string) (int, error)
- func ParseJwt(secret string, jwtStr string) (map[string]interface{}, error)
- func ParseObj(str string, obj interface{})
- func ParseObjErr(str string, obj interface{}) error
- func ParseStrMap(str string) map[string]string
- func ParseStrObjMap(str string) map[string]interface{}
- func ParseTime(date string) int
- func Substr(from string, length int) string
- func SubstrRange(from string, startStr string, endStr string) string
- func TemplateGen(text string, data interface{}) string
- func TemplateGenErr(text string, data interface{}) (string, error)
- func TimeSegment(start string, end string, seconds int) []string
- func ToBase64(str string) string
- func ToJson(obj interface{}) string
- func ToJsonErr(obj interface{}) (string, error)
- func ToJwt(secret string, args map[string]interface{}) string
- func ToPercent(i float64, precision int, suffix string) string
- func ToSliceBool(items []interface{}) []bool
- func ToSliceByte(items []interface{}) []byte
- func ToSliceFloat32(items []interface{}) []float32
- func ToSliceFloat64(items []interface{}) []float64
- func ToSliceInt(items []interface{}) []int
- func ToSliceInt16(items []interface{}) []int16
- func ToSliceInt32(items []interface{}) []int32
- func ToSliceInt64(items []interface{}) []int64
- func ToSliceInt8(items []interface{}) []int8
- func ToSliceObj(items interface{}) []interface{}
- func ToSliceString(items []interface{}) []string
- func ToSliceUint(items []interface{}) []uint
- func ToSliceUint16(items []interface{}) []uint16
- func ToSliceUint32(items []interface{}) []uint32
- func ToSliceUint64(items []interface{}) []uint64
- func ToSliceUint8(items []interface{}) []uint8
- func ToSliceUintptr(items []interface{}) []uintptr
- func ToStr(obj interface{}) string
- type Node
- type TP
- type WaitGroupT
Constants ¶
Variables ¶
var Log *zap.SugaredLogger
Functions ¶
func AddWait ¶
func AddWait(items []interface{}, call func(interface{}) (interface{}, error), duration time.Duration) ([]interface{}, error)
add items then wait group call item timeout
func DefaultToBool ¶
default to target if value is zero
func DefaultToByte ¶
default to target if value is zero
func DefaultToFloat32 ¶
default to target if value is zero
func DefaultToFloat64 ¶
default to target if value is zero
func DefaultToInt16 ¶
default to target if value is zero
func DefaultToInt32 ¶
default to target if value is zero
func DefaultToInt64 ¶
default to target if value is zero
func DefaultToInt8 ¶
default to target if value is zero
func DefaultToString ¶
default to target if value is zero
func DefaultToUint ¶
default to target if value is zero
func DefaultToUint16 ¶
default to target if value is zero
func DefaultToUint32 ¶
default to target if value is zero
func DefaultToUint64 ¶
default to target if value is zero
func DefaultToUint8 ¶
default to target if value is zero
func DefaultToUintptr ¶
default to target if value is zero
func FormatTime ¶
format unix time second, now => time.Now().Unix()
func ParseHtmlErr ¶
parse html with err
func ParseStrObjMap ¶
parse str-obj map silence
func SubstrRange ¶
substr range
func TemplateGenErr ¶
text template gen with err
func TimeSegment ¶
TimeSegment format 2006-01-02 15:04:05
Types ¶
type WaitGroupT ¶
type WaitGroupT struct {
// contains filtered or unexported fields
}
wait group for timeout
func NewWaitGroupSize ¶
func NewWaitGroupSize(size int) *WaitGroupT
new wait group timeout with size