Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertArrToMap(list []string) map[string]bool
- func ConvertBool(obj interface{}) (bool, bool)
- func ConvertDataType(obj interface{}, dataType string) (interface{}, error)
- func ConvertFloat64(obj interface{}) (float64, bool)
- func ConvertInt64(obj interface{}) (int64, bool)
- func ConvertMSToUnit(t int64) (value int64, unit string)
- func ConvertString(obj interface{}) (string, bool)
- func ConvertStringArr(obj interface{}) ([]string, bool)
- func ConvertStringArrToInterfaceArr(list []string) []interface{}
- func ConvertStringToMS(value string, now int64) (int64, error)
- func ConvertStructToMap(obj interface{}) map[string]interface{}
- func ConvertTimeToMS(t time.Time) int64
- func ConvertUint64(obj interface{}) (uint64, bool)
- func ConvertUnitToMS(value int64, unit string) int64
- func GetMD5Base64(bytes []byte) string
- func GetMD5Base64WithLegth(bytes []byte, maxLength int) string
- func GetMapValue(key string, data map[string]interface{}) interface{}
- func GetMapValueArr(m map[string]interface{}, key string) ([]interface{}, bool)
- func GetMapValueBool(m map[string]interface{}, key string) (bool, bool)
- func GetMapValueFloat64(m map[string]interface{}, key string) (float64, bool)
- func GetMapValueInt64(m map[string]interface{}, key string) (int64, bool)
- func GetMapValueMap(m map[string]interface{}, key string) (map[string]interface{}, bool)
- func GetMapValueString(m map[string]interface{}, key string) (string, bool)
- func GetMapValueUint64(m map[string]interface{}, key string) (uint64, bool)
- func GetPath(s string) string
- func IsMobile(ua string) bool
- func IsNil(val interface{}) bool
- func NewContextWithHeader(ctx context.Context) context.Context
- func ParseInt64(value string, def int64) int64
- func ParseInt64WithRadix(value string, def int64, radix int) int64
- func RandomString(n int) string
- func ReadLine(fileName string, handler func(string)) error
- func ReplaceNumber(path string) string
- func StringToBytes(s string) []byte
- func TypeOf(obj interface{}) string
- func UUID() (string, error)
- type Duration
- type LocationInfo
- type Locator
Constants ¶
View Source
const ( StringType = "string" NumberType = "number" BoolType = "bool" Unknown = "unknown" )
View Source
const ( Seconds = "seconds" Minutes = "minutes" Hours = "hours" )
Variables ¶
View Source
var ( APPLICATION_CONFIG_PATH = "conf/application.yml" TEMPLATE_JSON_PATH = "conf/template.json" IPDB_PATH = "conf/ipdata.dat" TA_JS_PATH = "static/ta.js" TRANSLATE_PATH = "conf/translate.yml" )
View Source
var ( // ErrInvalidIP invalid ip format ErrInvalidIP = errors.New("invalid ip format") )
Functions ¶
func ConvertArrToMap ¶
func ConvertBool ¶
func ConvertDataType ¶
func ConvertFloat64 ¶
func ConvertInt64 ¶
func ConvertMSToUnit ¶
func ConvertString ¶
func ConvertStringArr ¶
ConvertStringArr interface转字符串数组
func ConvertStringArrToInterfaceArr ¶
func ConvertStringArrToInterfaceArr(list []string) []interface{}
func ConvertStructToMap ¶
func ConvertStructToMap(obj interface{}) map[string]interface{}
func ConvertTimeToMS ¶
func ConvertUint64 ¶
func ConvertUnitToMS ¶
func GetMD5Base64 ¶
func GetMD5Base64WithLegth ¶
func GetMapValue ¶
func GetMapValueArr ¶
func GetMapValueFloat64 ¶
func GetMapValueMap ¶
func GetMapValueString ¶
func GetMapValueUint64 ¶
func NewContextWithHeader ¶ added in v1.1.0
func ParseInt64WithRadix ¶
ParseInt64WithRadix .
func RandomString ¶
func StringToBytes ¶
Types ¶
type Duration ¶
func (Duration) FormatDuration ¶
Keep the specified decimal places.
func (Duration) MarshalYAML ¶
func (*Duration) UnmarshalYAML ¶
type LocationInfo ¶
LocationInfo .
type Locator ¶
type Locator struct {
// contains filtered or unexported fields
}
Locator .
func (*Locator) FindByUint ¶
func (loc *Locator) FindByUint(ip uint32) (*LocationInfo, error)
FindByUint .
Click to show internal directories.
Click to hide internal directories.