Documentation ¶
Index ¶
- Constants
- func AbsPath(targetPath string, basePath string) string
- func Assign(origin, target interface{}, excludes ...string) (err error)
- func Base32ToInt64(id string) (r int64)
- func BytesReplace(s, old, new []byte, n int) []byte
- func CamelString(inp string) string
- func CompareVersion(v1, v2 string) int
- func DateRange(s, e string) (r []string)
- func DeepCopy(dst, src interface{}) error
- func FindStringSubmatch(re *regexp.Regexp, inp string) (r map[string]string, err error)
- func FirstTimeOfDay(t time.Time) (r time.Time)
- func FirstTimeOfWeek(t time.Time) (r time.Time)
- func Float32ToStr(inp float32) string
- func Float64ToStr(inp float64) string
- func FloatIsEqual(f1, f2 float64) bool
- func GenRandomId(salt string) string
- func GetCurPath() (r string, err error)
- func GetLocalIP() (r string, err error)
- func GetRandomString(length int) string
- func GobDecode(d []byte, inp interface{}) error
- func GobEncode(inp interface{}) ([]byte, error)
- func Goid() int
- func GzipString(inp string) (r []byte, err error)
- func If(condition bool, trueVal, falseVal interface{}) interface{}
- func IfDo(condition bool, fn func())
- func InSlice(val interface{}, slice interface{}) (exist bool, index int)
- func Int32ToStr(inp int32) string
- func Int64ToBase32(id int64) (r string)
- func Int64ToStr(inp int64) string
- func IntDecode(inp string, salt int64) (r int64, err error)
- func IntEncode(inp int64, salt int64) (r string)
- func IntToStr(inp int) string
- func JoinMap(arr map[string]string, glue string, glue2 string) (r string)
- func JsonDecode(d []byte, inp interface{}) error
- func JsonEncode(inp interface{}) ([]byte, error)
- func LeftLower(s string) string
- func LeftUpper(s string) string
- func MapColumn(ms interface{}, col string) (r interface{})
- func MapKeys(inp map[string]interface{}) (r []string)
- func MapToQueryStr(inp map[string]string) (r string)
- func MaxInt32(x, y int32) int32
- func MaxInt64(x, y int64) int64
- func Md5File(file string) (string, error)
- func Md5String(inp string) string
- func MinInt32(x, y int32) int32
- func MinInt64(x, y int64) int64
- func MsgpackDecode(b []byte, inp interface{}) error
- func MsgpackEncode(inp interface{}) ([]byte, error)
- func PathExists(path string) (exists bool, isdir bool, err error)
- func PbDecode(b []byte, inp proto.Message) error
- func PbEncode(inp proto.Message) ([]byte, error)
- func QueryStrToMap(inp string) (r map[string]string)
- func ReadFile(file string) (string, error)
- func ReadLine(file string, fn func(line []byte)) (err error)
- func SHA1File(file string) (string, error)
- func SHA256File(file string) (string, error)
- func Sha1String(inp string) string
- func SliceColumn(slice interface{}, col string) (r interface{})
- func SliceDiff(slice1, slice2 interface{}) (r []interface{})
- func SliceShuffle(slice []int32) []int32
- func SliceSumInt(slice []int) (r int)
- func SliceTrim(slice interface{}, cutset ...interface{}) (r []interface{})
- func SliceUnique(slice interface{}) (r interface{})
- func SnakeString(inp string) string
- func StrToFloat32(inp string, defaultValue float32) float32
- func StrToFloat64(inp string, defaultValue float64) float64
- func StrToInt(inp string, defaultValue int) int
- func StrToInt32(inp string, defaultValue int32) int32
- func StrToInt64(inp string, defaultValue int64) int64
- func StructIsEqual(origin, target interface{}, excludes ...string) bool
- func ThriftDecode(b []byte, inp interface{}) error
- func ThriftEncode(inp interface{}) ([]byte, error)
- func Tprintf(format string, params map[string]string) string
- func UrlDecode(inp string) string
- func UrlEncode(inp string) string
- func VersionIntToString(inp int32) string
- func VersionStringToInt(inp string) int32
- func WalkDir(path string, suffixes []string) (files []string, err error)
- func WriteFile(data string, file string) error
- type SerializeValue
Constants ¶
View Source
const MIN = 0.000001
Variables ¶
This section is empty.
Functions ¶
func Assign ¶
*
- assign one struct to other struct
- @param: origin
- @param: target
- @params: excludes ... the attribute name exclude assign
func Base32ToInt64 ¶
func BytesReplace ¶
func CompareVersion ¶
func FindStringSubmatch ¶
regexp.Compile(`\[(?P<node>[\d_]+)\]$`) return {"node":val}
func Float32ToStr ¶
func Float64ToStr ¶
func FloatIsEqual ¶
func GenRandomId ¶
func GetCurPath ¶
func GetRandomString ¶
func GzipString ¶
func Int32ToStr ¶
func Int64ToBase32 ¶
func Int64ToStr ¶
func JsonDecode ¶
func JsonEncode ¶
func MapToQueryStr ¶
func MsgpackDecode ¶
func MsgpackEncode ¶
func QueryStrToMap ¶
func Sha1String ¶
func SliceColumn ¶
func SliceColumn(slice interface{}, col string) (r interface{})
func SliceShuffle ¶
func SliceSumInt ¶
func SliceUnique ¶
func SliceUnique(slice interface{}) (r interface{})
func StrToFloat32 ¶
func StrToFloat64 ¶
func StrToInt32 ¶
func StrToInt64 ¶
func StructIsEqual ¶
*
- assign one struct to other struct
- @param: origin
- @param: target
- @params: excludes ... the attribute name exclude check
func ThriftDecode ¶
func ThriftEncode ¶
func VersionIntToString ¶
func VersionStringToInt ¶
Types ¶
type SerializeValue ¶
type SerializeValue struct { Point []string Range []*struct { S int E int } Dict map[string]string }
serialize value
func NewSerializeValue ¶
func NewSerializeValue(inp []byte) (r *SerializeValue, err error)
func (*SerializeValue) Map ¶
func (this *SerializeValue) Map() (r map[string]string)
func (*SerializeValue) Slice ¶
func (this *SerializeValue) Slice() (r []string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.