Documentation
¶
Index ¶
- Constants
- func Apply(obj_func interface{}, args []interface{}) []reflect.Value
- func Assign(a, b interface{}) interface{}
- func B2S(b []byte) string
- func Call(obj_func interface{}, args ...interface{}) []reflect.Value
- func CallMethod(obj interface{}, methodName string, args ...interface{}) []reflect.Value
- func FmtString(src string, data map[string]interface{}) string
- func GetField(obj interface{}, name string) (reflect.StructField, bool)
- func GetKind(v interface{}) reflect.Kind
- func GetReflectType(v interface{}) reflect.Type
- func GetStructTypeName(v interface{}) string
- func GetTag(obj struct{}, name, tagName string) string
- func GetType(v interface{}) string
- func GoFns(num int, fns []func()) (wg *sync.WaitGroup)
- func GoFnsGroupBy(count int, num int, fns []func()) *sync.WaitGroup
- func Has(obj interface{}, name string) bool
- func IsBool(v interface{}) bool
- func IsInt(v interface{}) bool
- func IsMap(v interface{}) bool
- func IsPtr(v interface{}) bool
- func IsString(v interface{}) bool
- func IsStringBlank(str string) bool
- func IsStringEmail(value string) bool
- func IsStringNumber(str string) bool
- func IsStringURL(str string) bool
- func Map2Struct(m map[string]interface{}, s struct{}) error
- func New(v interface{}) interface{}
- func NewSlice(v interface{}) interface{}
- func ParseBool(str string) bool
- func ParseFloat32(str string) float32
- func ParseFloat64(str string) float64
- func ParseHex(str string) uint64
- func ParseInt(str string) int
- func ParseInt16(str string) int16
- func ParseInt32(str string) int32
- func ParseInt64(str string) int64
- func ParseInt8(str string) int8
- func ParseUint(str string) uint
- func ParseUint64(str string) uint64
- func RandBool() bool
- func RandBytes(num int) []byte
- func RandCaps() string
- func RandLowerCase() string
- func RandString(num int) string
- func S2B(s string) []byte
- func SetSleep(action func() bool, delay int)
- func StringReverse(s string) string
- func StringReverseOffset(s string, offset rune) string
- func StructToMap(s interface{}, tag string, methodName string) (res map[string]interface{}, err error)
- func TimeCost() func(name string)
- func ToCamelCase(val string) string
- func ToSliceReflectValue(args []interface{}) []reflect.Value
- func ToSnakeCase(val string) string
- func Unicode2ZH(from string) string
- type GoFnStruct
Constants ¶
View Source
const ( OptIgnore = "-" // 忽略当前这个域 OptOmitempty = "omitempty" // 当这个域的值为空,忽略这个域 OptDive = "dive" // 递归地遍历这个结构体,将所有字段作为键 OptWildcard = "wildcard" // 只适用于字符串类型,返回"%"+值+"%",这是为了方便数据库的模糊查询 )
Variables ¶
This section is empty.
Functions ¶
func CallMethod ¶
CallMethod @param obj 为结构体指针
func FmtString ¶
FmtString @param str @param data @example FmtString("{a}",map[string]interfacle{}{"a":1})
func GetType ¶
func GetType(v interface{}) string
GetType(string) == "string" GetType(int) == "int" GetType(int32) == "int32" GetType(int64) == "int64"
func GoFnsGroupBy ¶
GoFnsGroupBy
func ParseBool ¶
ParseBool 将字符串转换为布尔值 它接受真值:1, t, T, TRUE, true, True 它接受假值:0, f, F, FALSE, false, False. 其它任何值都返回一个错误
func ParseFloat64 ¶
类似于javascript,全局的parseInt、parseFloat ParseFloat64
func StringReverseOffset ¶
StringReverseOffset
func StructToMap ¶
func StructToMap(s interface{}, tag string, methodName string) (res map[string]interface{}, err error)
StructToMap 结构体转map fn.StructToMap(struct, "map", "")
func ToCamelCase ¶
ToCamelCase ToCamelCase("camel-case") == "camelCase"
func ToSliceReflectValue ¶
ToSliceReflectValue
func ToSnakeCase ¶
ToSnakeCase ToSnakeCase("snakeCase") == "snake-case"
Types ¶
type GoFnStruct ¶
func (GoFnStruct) Go ¶
func (m GoFnStruct) Go(fn func(args ...interface{}), args ...interface{})
Source Files
¶
- apply.go
- assign.go
- b2s.go
- getKind.go
- getStructTypeName.go
- gofn.go
- gofns.go
- gofns_groupby.go
- has.go
- isBool.go
- isInt.go
- isMap.go
- isPtr.go
- isString.go
- isStringBlank.go
- isStringEmail.go
- isStringNumber.go
- isStringURL.go
- map2struct.go
- max.go
- new.go
- rand.go
- s2b.go
- sleep.go
- string.go
- string_fmt.go
- string_reverse.go
- struct2map.go
- timecost.go
- toCamelCase.go
- toSnakeCase.go
- unicode2zh.go
Click to show internal directories.
Click to hide internal directories.