Documentation ¶
Index ¶
- func AddCommonFlags(cmdline *pflag.FlagSet) *bool
- func ArrayUnique(a interface{}) (ret []interface{})
- func CalSliceDiff(oldslice, newslice []string) (subs, plugs []string)
- func CalSliceInt64Diff(oldslice, newslice []int64) (subs, inter, plugs []int64)
- func CheckLen(sInput string, min, max int) bool
- func Contains(set []string, substr string) bool
- func ContainsInt64(set []int64, sub int64) bool
- func ConvParamsTime(data interface{}) interface{}
- func FileExists(name string) bool
- func GetActionLanguage(req *restful.Request) string
- func GetActionOnwerID(req *restful.Request) string
- func GetActionOnwerIDAndUser(req *restful.Request) (string, string)
- func GetActionUser(req *restful.Request) string
- func GetCurrentTimeStr() string
- func GetInt64ByInterface(a interface{}) (int64, error)
- func GetIntByInterface(a interface{}) (int, error)
- func GetMapInterfaceByInerface(data interface{}) ([]interface{}, error)
- func GetObjIDByType(objType string) string
- func InArray(obj interface{}, target interface{}) bool
- func InitFlags()
- func IsChar(sInput string) bool
- func IsDate(sInput string) bool
- func IsNumChar(sInput string) bool
- func IsTime(sInput string) bool
- func IsTimeZone(sInput string) bool
- func MapMatch(src, tar interface{}) bool
- func NewMapFromJSON(data string) map[string]interface{}
- func RemoveDuplicatesAndEmpty(slice []string) (ret []string)
- func SliceStrToInt(sliceStr []string) ([]int, error)
- func Str2Time(timeStr string) time.Time
- func StrArrDiff(slice1 []string, slice2 []string) []string
- func StrArrayUnique(a []string) (ret []string)
- func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
- func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
- type MapBuiler
- type ParseInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommonFlags ¶
AddCommonFlags add common flags that is needed by all modules
func ArrayUnique ¶
func ArrayUnique(a interface{}) (ret []interface{})
func CalSliceDiff ¶
func CalSliceInt64Diff ¶
func ContainsInt64 ¶
func ConvParamsTime ¶
func ConvParamsTime(data interface{}) interface{}
func FileExists ¶
func GetActionLanguage ¶
GetActionLanguage returns language form hender
func GetActionOnwerID ¶
GetActionOnwerID returns owner_uin form hender
func GetActionOnwerIDAndUser ¶
GetActionOnwerID returns owner_uin and user form hender
func GetActionUser ¶
GetActionLanguage returns user form hender
func GetCurrentTimeStr ¶
func GetCurrentTimeStr() string
func GetInt64ByInterface ¶
func GetIntByInterface ¶
func GetMapInterfaceByInerface ¶
func GetMapInterfaceByInerface(data interface{}) ([]interface{}, error)
func GetObjIDByType ¶
func MapMatch ¶
func MapMatch(src, tar interface{}) bool
MapMatch return whether src is partial match to tar, means src is smaller than tar
func NewMapFromJSON ¶
func SliceStrToInt ¶
SliceStrToInt: 将字符串切片转换为整型切片
func StrArrDiff ¶
func StrArrayUnique ¶
StrArrayUnique get unique string array
func WarnWordSepNormalizeFunc ¶
func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators
func WordSepNormalizeFunc ¶
func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
WordSepNormalizeFunc changes all flags that contain "_" separators
Types ¶
type MapBuiler ¶
type MapBuiler struct {
// contains filtered or unexported fields
}
func NewMapBuilder ¶
func NewMapBuilder(kvpairs ...interface{}) *MapBuiler
type ParseInterface ¶
type ParseInterface struct {
// contains filtered or unexported fields
}
ParseInterface parse interface use struct
func NewParseInterface ¶
func NewParseInterface(data interface{}) *ParseInterface
NewParseInterface return a struct
func (*ParseInterface) ArrayInterface ¶
func (p *ParseInterface) ArrayInterface() ([]interface{}, error)
ArrayInterface return interface val
func (*ParseInterface) Get ¶
func (p *ParseInterface) Get(key string) *ParseInterface
Get get key from interface to ParseInterface
func (*ParseInterface) Interface ¶
func (p *ParseInterface) Interface() (interface{}, error)
Interface return interface val
func (*ParseInterface) String ¶
func (p *ParseInterface) String() (string, error)
String return string val