Documentation ¶
Index ¶
- Constants
- func AddStr(input ...interface{}) string
- func AesDecrypt(c, k string) string
- func AesEncrypt(c, k string) string
- func AnyToStr(any interface{}) string
- func Base64Decode(input string) string
- func Base64Encode(input string) string
- func Base64URLDecode(input string) string
- func Base64URLEncode(input string) string
- func CheckInt(c int, vs ...int) bool
- func CheckInt64(c int64, vs ...int64) bool
- func CheckStr(c string, vs ...string) bool
- func DeepCopy(dst, src interface{}) error
- func Error(input ...interface{}) error
- func GetAnyMonthFirstAndLast(month int) (int64, int64)
- func GetDataID(data interface{}) int64
- func GetDayFirstAndLast() (int64, int64)
- func GetDbAndTb(model interface{}) (string, error)
- func GetJsonTag(field reflect.StructField) (string, error)
- func GetLocalIP() string
- func GetMonthFirstAndLast() (int64, int64)
- func GetPath() string
- func GetUUID(sec ...int64) string
- func GetUUIDInt64(sec ...int64) int64
- func GetWeekFirstAndLast() (int64, int64)
- func HasStr(s1 string, s2 string) bool
- func Int2Time(t int64) time.Time
- func IsAccount(s string) bool
- func IsEmail(s string) bool
- func IsFloat(s string) bool
- func IsIPV4(s string) bool
- func IsInt(s string) bool
- func IsMobil(s string) bool
- func IsPassword(s string) bool
- func JsonToAny(src interface{}, target interface{}) error
- func JsonToAny2(src interface{}, target interface{}) error
- func JsonToObject(src string, target interface{}) error
- func JsonToObject2(src string, target interface{}) error
- func LowerFirst(str string) string
- func MD5(s string, salt ...string) string
- func Nano() int64
- func NewInstance(data interface{}) interface{}
- func ObjectToJson(src interface{}) (string, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(data []byte) []byte
- func Pow(x, n int64) int64
- func PowString(n int) string
- func Random6str() string
- func ReadFile(path string) (string, error)
- func ReadJsonConfig(conf []byte, result interface{}) error
- func ReadLocalJsonConfig(path string, result interface{}) error
- func SHA256(s string, salt ...string) string
- func Str2Time(s string) (int64, error)
- func StrToFloat(str string) (float64, error)
- func StrToInt(str string) (int, error)
- func StrToInt16(str string) (int16, error)
- func StrToInt32(str string) (int32, error)
- func StrToInt64(str string) (int64, error)
- func StrToInt8(str string) (int8, error)
- func Substr(str string, start int, length int) string
- func Substr2(str string, start int, end int) string
- func Time(t ...time.Time) int64
- func Time2Str(t int64) string
- func TypeOf(data interface{}) reflect.Type
- func UpperFirst(str string) string
- func ValidDate(field reflect.StructField) bool
- func ValidIgnore(field reflect.StructField) bool
- func ValidPattern(content, pattern string) bool
- func ValidSyncMongo(model interface{}) (bool, error)
- func ValueOf(data interface{}) reflect.Value
Constants ¶
View Source
const ( Mobile = `^1[3|4|5|6|7|8|9][0-9]{9}$` IPV4 = `^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$` INTEGER = `(^[1-9]*[1-9][0-9]*$)|0$` FLOAT = `(^[1-9]+(.[0-9]+)?$)|(^[0]+(.[0-9]+)?$)` EMAIL = `^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$` ACCOUNT = `^[a-zA-Z][a-zA-Z0-9_]{5,14}$` PASSWORD = `^.{6,18}?` URL = `^((ht|f)tps?):\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+([\\w\\-\\.,@?^=%&:\\/~\\+#]*[\\w\\-\\@?^=%&\\/~\\+#])?$` )
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶ added in v1.0.55
func AesEncrypt ¶ added in v1.0.55
func GetAnyMonthFirstAndLast ¶ added in v1.0.50
获取指定月份开始和结束时间
func GetMonthFirstAndLast ¶ added in v1.0.50
获取当月份开始和结束时间
func GetUUIDInt64 ¶
func IsPassword ¶
func JsonToObject2 ¶ added in v1.0.39
JSON字符串转对象
func PKCS5Padding ¶ added in v1.0.55
func PKCS5UnPadding ¶ added in v1.0.55
func ReadLocalJsonConfig ¶
读取本地JSON配置文件
func ValidPattern ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.