Documentation ¶
Index ¶
- func ArrayInArray(min []string, max []string) (has bool, msg string)
- func ArrayInMapKey(min []string, m map[string]string) (has bool, msg string)
- func ArrayInMapValue(min []string, m map[string]string) (has bool, msg string)
- func ArrayStringIndex(item string, max []string) (index int)
- func B2S(b []byte) string
- func ChunkJoin(str, sub string, length int) string
- func CopyMapString(m map[string]string) map[string]string
- func DeleteCache(key string) bool
- func EmptyObject(obj interface{})
- func EncodeTag(tag string) (data map[string]string)
- func EqualFloatString(f1, f2 string, point int) bool
- func FilterEmpty(m map[string]string)
- func FilterMapByFun(m map[string]string, fun func(s string) string, keys ...string)
- func FilterMapString(m map[string]string, keys ...string)
- func GetCache(key string) (has bool, obj interface{})
- func GetElemInterface(v reflect.Value) interface{}
- func GetMapKey(m map[string]string) (keys []string)
- func GetNotEmptyFields(obj interface{}, inFields ...string) (fields []string)
- func HexStrHead2ByteArr(hexString string) ([]byte, error)
- func HexStrHead2String(hexString string) string
- func Interface2Bool(value interface{}, strict bool) (v bool, ok bool)
- func Interface2Float(value interface{}, strict bool) (v float64, ok bool)
- func Interface2Int(value interface{}, strict bool) (v int64, ok bool)
- func Interface2String(value interface{}, strict bool) (v string, ok bool)
- func Interface2StringWithType(value interface{}, strict bool) (v string, ok bool)
- func Interface2UInt(value interface{}, strict bool) (v uint64, ok bool)
- func IntersectionSlice(s1 []interface{}, s2 []interface{}) []interface{}
- func IsEmptyValue(value interface{}) bool
- func ItemInArray(item string, max []string) (has bool)
- func ItemInArrayInt(item int, max []int) (has bool)
- func Map2UrlValues(m map[string]string) url.Values
- func MapInterface2MapString(m map[string]interface{}) map[string]string
- func MapListToObjList(obj interface{}, mappers []map[string]interface{}, useTag string) (errInfo string)
- func MapStringToObj(obj interface{}, mapper map[string]string, useTag string) (fields []string, errInfo string)
- func MapToObj(obj interface{}, mapper map[string]interface{}, useTag string) (fields []string, errInfo string)
- func ObjListToMapList(obj interface{}, useTag string) (mappers []map[string]interface{})
- func ObjToMap(obj interface{}, useTag string) map[string]interface{}
- func PackRsaPrivateKey(s string) string
- func PackRsaPublicKey(s string) string
- func Rand(min int, max int) int
- func ReverseMap(ma map[string]string) (data map[string]string)
- func S2B(s string) []byte
- func SaveFormFile(root string, mFile multipart.File, fHeader *multipart.FileHeader) (hashCode, filePath string, err error)
- func SetCache(key string, obj interface{}, exp time.Duration)
- func SheXing2TuoFeng(src []byte) (out []byte)
- func SortMap(m map[string]string) (key []string, value []string)
- func TuoFeng2SheXing(src []byte) (out []byte)
- func UnDuplicatesSlice(is *[]interface{})
- func VersionCompareBigger(big, small string) bool
- func WalkDir(dirPth string, suffixs []string) (files []string, err error)
- type Data
- type FieldTagMapper
- type FieldsUtil
- type Mail
- type OrderKV
- func (p *OrderKV) Add(key, value string)
- func (p *OrderKV) Encode() []byte
- func (p *OrderKV) EncodePhp() []byte
- func (p *OrderKV) EncodeString() string
- func (p *OrderKV) EncodeStringWithoutEscape() string
- func (p *OrderKV) Keys() []string
- func (p *OrderKV) Map() map[string]string
- func (p *OrderKV) MapMulti() map[string][]string
- func (p *OrderKV) Set(key, value string)
- func (p *OrderKV) Sort()
- func (p OrderKV) String() string
- func (p *OrderKV) UrlValue() url.Values
- func (p *OrderKV) Values() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayInMapKey ¶
判断一个array每一个元素是不是都在map的key里
func ArrayInMapValue ¶
判断一个array每一个原始是不是都在map的value里
func ArrayStringIndex ¶
func B2S ¶
b2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
Note it may break if string and/or slice header will change in the future go versions.
func DeleteCache ¶
func EmptyObject ¶
func EmptyObject(obj interface{})
func EqualFloatString ¶
两个字串的float值是否相同 point 表示精确到第几个小数点后
func FilterEmpty ¶
func FilterMapByFun ¶
func FilterMapString ¶
func GetElemInterface ¶
func GetNotEmptyFields ¶
获取不为空的在inFields中的 结构体中的字段
func HexStrHead2ByteArr ¶
Hex string, high nibble first
func HexStrHead2String ¶
func Interface2Bool ¶
func Interface2Float ¶
func Interface2Int ¶
func Interface2String ¶
func Interface2UInt ¶
func IntersectionSlice ¶
func IntersectionSlice(s1 []interface{}, s2 []interface{}) []interface{}
求交集
func IsEmptyValue ¶
func IsEmptyValue(value interface{}) bool
func ItemInArray ¶
判断item是否在数组里 如果数组为空则返回false
func ItemInArrayInt ¶
判断item是否在数组里 如果数组为空则返回false
func MapInterface2MapString ¶
func MapListToObjList ¶
func MapStringToObj ¶
func ObjListToMapList ¶
根据map的key=>value设置Obj的field=>fieldValue 如果传了useTag,那么就会根据obj的Tag的useTag的值获取mapValue并填充到field上, 返回设置成功的Fields列表字段
func ReverseMap ¶
将map[string'key']string'value' 转换为map[value]key
func S2B ¶
s2b converts string to a byte slice without memory allocation.
Note it may break if string and/or slice header will change in the future go versions.
func SaveFormFile ¶
func SaveFormFile(root string, mFile multipart.File, fHeader *multipart.FileHeader) (hashCode, filePath string, err error)
保存上传文件
func SheXing2TuoFeng ¶
func TuoFeng2SheXing ¶
func VersionCompareBigger ¶
Types ¶
type FieldTagMapper ¶
type FieldTagMapper struct {
// contains filtered or unexported fields
}
func GetTagMapperFromPool ¶
func GetTagMapperFromPool(i interface{}) FieldTagMapper
func (*FieldTagMapper) GetFieldMapByTagName ¶
func (p *FieldTagMapper) GetFieldMapByTagName(tag string) (data map[string]string)
type FieldsUtil ¶
type FieldsUtil struct {
// contains filtered or unexported fields
}
完整版的字段判断工具
func NewFieldsUtil ¶
func NewFieldsUtil(obj interface{}) *FieldsUtil
func (*FieldsUtil) Exclude ¶
func (p *FieldsUtil) Exclude(fields ...string) *FieldsUtil
func (*FieldsUtil) Fields ¶
func (p *FieldsUtil) Fields() []string
func (*FieldsUtil) Filter ¶
func (p *FieldsUtil) Filter(fields ...string) *FieldsUtil
func (*FieldsUtil) GetNotEmptyFields ¶
func (p *FieldsUtil) GetNotEmptyFields() *FieldsUtil
func (*FieldsUtil) Must ¶
func (p *FieldsUtil) Must(fields ...string) *FieldsUtil
type OrderKV ¶
type OrderKV struct {
// contains filtered or unexported fields
}