Documentation
¶
Index ¶
- Constants
- func Apply(obj_func interface{}, args []interface{}) []reflect.Value
- func Assign(a, b interface{}) interface{}
- func AssignMap(m1 ts.Map, m2 ts.Map) ts.Map
- func Bytes2String(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 GetKind(v interface{}) reflect.Kind
- func GetReflectType(v interface{}) reflect.Type
- func GetStructTypeName(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{}, key string) bool
- func IsBlank(str string) bool
- func IsEmail(value string) bool
- func IsNumeric(str string) bool
- func IsPtr(v interface{}) bool
- func IsString(v interface{}) bool
- func IsURL(str string) bool
- func Load(url string) ([]byte, error)
- func LoadAndSave(url string, filePath string) error
- func MapToStruct(m map[string]interface{}, s interface{}) error
- func New(v interface{}) interface{}
- func NewSlice(v interface{}) interface{}
- func ParseBool(str string) (bool, error)
- func ParseFloat32(str string) (float32, error)
- func ParseFloat64(str string) (float64, error)
- func ParseHex(str string) (uint64, error)
- func ParseInt(str string) (int, error)
- func ParseInt16(str string) (int16, error)
- func ParseInt32(str string) (int32, error)
- func ParseInt64(str string) (int64, error)
- func ParseInt8(str string) (int8, error)
- func ParseUint(str string) (uint, error)
- func ParseUint64(str string) (uint64, error)
- func ReverseString(s string) string
- func ReverseStringOffset(s string, offset rune) string
- func String2Bytes(s string) []byte
- func StructToMap(s interface{}, tag string, methodName string) (res map[string]interface{}, err error)
- func ToCamelCase(val string) string
- func ToSliceReflectValue(args []interface{}) []reflect.Value
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 GoFnsGroupBy ¶
GoFnsGroupBy
func MapToStruct ¶
ToStruct 用map填充结构
func ParseBool ¶
Bool 将字符串转换为布尔值 它接受真值:1, t, T, TRUE, true, True 它接受假值:0, f, F, FALSE, false, False. 其它任何值都返回一个错误
func ReverseStringOffset ¶
ReverseStringOffset
func StructToMap ¶
func StructToMap(s interface{}, tag string, methodName string) (res map[string]interface{}, err error)
StructToMap 结构体转map fn.StructToMap(struct, "map", "")
func ToSliceReflectValue ¶
ToSliceReflectValue
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.