Documentation ¶
Index ¶
- func ArrayUniqueString(arr []string) (newArr []string)
- func InArray(argv interface{}, haystack interface{}) bool
- func InArrayString(arg string, args []string) bool
- func ParseBool(o interface{}) bool
- func ParseByte(i interface{}) byte
- func ParseBytes(o interface{}) []byte
- func ParseFloat32(o interface{}) float32
- func ParseFloat64(o interface{}) (res float64)
- func ParseInt(o interface{}) int
- func ParseInt16(o interface{}) (res int16)
- func ParseInt32(o interface{}) (res int32)
- func ParseInt64(o interface{}) (res int64)
- func ParseInt8(o interface{}) (res int8)
- func ParseReader(arg interface{}) *bufio.Reader
- func ParseRune(o interface{}) rune
- func ParseRunes(o interface{}) []rune
- func ParseString(o interface{}) string
- func ParseUint(o interface{}) uint
- func ParseUint16(o interface{}) uint16
- func ParseUint32(o interface{}) uint32
- func ParseUint64(o interface{}) uint64
- func ParseUint8(o interface{}) uint8
- func ParseWriter(arg interface{}) io.Writer
- func SetDefaultRecover(dr func(err error))
- func SplitAndTrimSpace(s, sep string) (res []string)
- func WithMutexContext(mu *sync.Mutex, fn func())
- func WithRWMutexContext(mur *sync.RWMutex, fn func())
- func WithRecover(h func(), errDefaultRecover ...func(err error))
- func WithRunTimeContext(closer func(), callback func(time.Duration))
- func WithTicker(duration time.Duration, fn func())
- type Map
- type MapIntT
- type MapIntT64T
- type MapInterfaceT
- type MapStringT
- type Slice
- type Type
- type TypeContext
- func (tc TypeContext) Bind(o interface{}) error
- func (tc TypeContext) Bool() bool
- func (tc TypeContext) Byte() byte
- func (tc TypeContext) Bytes() []byte
- func (tc TypeContext) Extract(keys ...interface{}) Type
- func (tc TypeContext) ExtractUrl() []string
- func (tc TypeContext) ExtractWithDefault(keys []interface{}, defaultVal interface{}) Type
- func (tc TypeContext) Float32() float32
- func (tc TypeContext) Float64() float64
- func (tc TypeContext) InArray(haystack interface{}) bool
- func (tc TypeContext) InArrayString(args []string) bool
- func (tc TypeContext) Int() int
- func (tc TypeContext) Int16() int16
- func (tc TypeContext) Int32() int32
- func (tc TypeContext) Int64() int64
- func (tc TypeContext) Int8() int8
- func (tc TypeContext) Interface() interface{}
- func (tc TypeContext) IsBetween(min, max interface{}) bool
- func (tc TypeContext) IsBetweenAlpha(min, max string) bool
- func (tc TypeContext) IsBetweenFloat64(min, max float64) bool
- func (tc TypeContext) IsChineseCharacters() bool
- func (tc TypeContext) IsChineseID() bool
- func (tc TypeContext) IsChineseMobile() bool
- func (tc TypeContext) IsChineseName() bool
- func (tc TypeContext) IsDate() bool
- func (tc TypeContext) IsDatetime() bool
- func (tc TypeContext) IsEmail() bool
- func (tc TypeContext) IsFloat() bool
- func (tc TypeContext) IsHost() bool
- func (tc TypeContext) IsInteger() bool
- func (tc TypeContext) IsIp() bool
- func (tc TypeContext) IsIpV4() bool
- func (tc TypeContext) IsIpV6() bool
- func (tc TypeContext) IsJson() bool
- func (tc TypeContext) IsJsonMap() bool
- func (tc TypeContext) IsJsonSlice() bool
- func (tc TypeContext) IsNumeric() bool
- func (tc TypeContext) IsUrl() bool
- func (tc TypeContext) IsXml() bool
- func (tc TypeContext) IsZero() bool
- func (tc TypeContext) Length() int
- func (tc TypeContext) Map() Map
- func (tc TypeContext) MapIntT() MapIntT
- func (tc TypeContext) MapIntT64T() MapIntT64T
- func (tc TypeContext) MapInterfaceT() MapInterfaceT
- func (tc TypeContext) MapStringInterface() map[string]interface{}
- func (tc TypeContext) MapStringT() MapStringT
- func (tc TypeContext) Reader() *bufio.Reader
- func (tc TypeContext) Rune() rune
- func (tc TypeContext) Runes() []rune
- func (tc TypeContext) Slice() Slice
- func (tc TypeContext) SliceFloat64() []float64
- func (tc TypeContext) SliceInt() []int
- func (tc TypeContext) SliceInt64() []int64
- func (tc TypeContext) SliceInterface() []interface{}
- func (tc TypeContext) SliceMapStringInterface() []map[string]interface{}
- func (tc TypeContext) SliceMapStringT() []MapStringT
- func (tc TypeContext) SliceString() []string
- func (tc TypeContext) SplitAndTrimSpace(sep string) (res []string)
- func (tc TypeContext) String() string
- func (tc TypeContext) Uint() uint
- func (tc TypeContext) Uint16() uint16
- func (tc TypeContext) Uint32() uint32
- func (tc TypeContext) Uint64() uint64
- func (tc TypeContext) Uint8() uint8
- func (tc TypeContext) Writer() io.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseReader ¶
func ParseWriter ¶
func SetDefaultRecover ¶
func SetDefaultRecover(dr func(err error))
func SplitAndTrimSpace ¶
SplitAndTrimSpace 字符串分割并且去掉两边的空格
func WithMutexContext ¶
func WithRWMutexContext ¶
func WithRecover ¶
func WithRecover(h func(), errDefaultRecover ...func(err error))
func WithRunTimeContext ¶
func WithTicker ¶
Types ¶
type TypeContext ¶
type TypeContext struct {
// contains filtered or unexported fields
}
TypeContext ...
func (TypeContext) Extract ¶
func (tc TypeContext) Extract(keys ...interface{}) Type
Extract 多层次抽取值 例: New(`{"a":1,"b":["c",{"d":2}]}`).Extract("b.1.d") // 2 或者 New(`{"a":1,"b":["c",{"d":2}]}`).Extract("b",1,"d") // 2 以上两种方式, 只能使用其中一种, 不能两种混用, 如果key中有点., 则可以使用第二种,不会按照点去分割的
func (TypeContext) ExtractUrl ¶
func (tc TypeContext) ExtractUrl() []string
func (TypeContext) ExtractWithDefault ¶
func (tc TypeContext) ExtractWithDefault(keys []interface{}, defaultVal interface{}) Type
ExtractWithDefault 多层次抽取值, 如果是零值, 则返回给定的默认值
func (TypeContext) InArray ¶
func (tc TypeContext) InArray(haystack interface{}) bool
InArray 是否存在给定的数组中
func (TypeContext) InArrayString ¶
func (tc TypeContext) InArrayString(args []string) bool
InArrayString 是否存在给定的字符串数组中
func (TypeContext) IsBetween ¶
func (tc TypeContext) IsBetween(min, max interface{}) bool
Between 是否在给定的两个整数之间
func (TypeContext) IsBetweenAlpha ¶
func (tc TypeContext) IsBetweenAlpha(min, max string) bool
BetweenFloat64 是否在给定的两个字母之间
func (TypeContext) IsBetweenFloat64 ¶
func (tc TypeContext) IsBetweenFloat64(min, max float64) bool
BetweenFloat64 是否在给定的两个浮点数字之间
func (TypeContext) IsChineseCharacters ¶
func (tc TypeContext) IsChineseCharacters() bool
IsChineseCharacters 是否汉字
func (TypeContext) IsChineseName ¶
func (tc TypeContext) IsChineseName() bool
IsChineseCharacters 是否中国的名字
func (TypeContext) IsDatetime ¶
func (tc TypeContext) IsDatetime() bool
IsDateTime 是否日期时间 yyyy-mm-dd HH:ii:ss 格式
func (TypeContext) IsZero ¶
func (tc TypeContext) IsZero() bool
func (TypeContext) MapInterfaceT ¶
func (tc TypeContext) MapInterfaceT() MapInterfaceT
MapInterfaceT ...
func (TypeContext) MapStringInterface ¶
func (tc TypeContext) MapStringInterface() map[string]interface{}
MapStringInterface ...
func (TypeContext) Reader ¶
func (tc TypeContext) Reader() *bufio.Reader
func (TypeContext) SliceInterface ¶
func (tc TypeContext) SliceInterface() []interface{}
SliceInterface ...
func (TypeContext) SliceMapStringInterface ¶
func (tc TypeContext) SliceMapStringInterface() []map[string]interface{}
SliceMapStringInterface ...
func (TypeContext) SliceMapStringT ¶
func (tc TypeContext) SliceMapStringT() []MapStringT
SliceMapStringT ...
func (TypeContext) SplitAndTrimSpace ¶
func (tc TypeContext) SplitAndTrimSpace(sep string) (res []string)
SplitAndTrimSpace 字符串分割并且去掉两边的空格
func (TypeContext) Writer ¶
func (tc TypeContext) Writer() io.Writer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.