Documentation
¶
Index ¶
- Constants
- Variables
- func Base64(input string) string
- func BirthdayToAge(birthday time.Time) uint8
- func ConvertToBin(num int) string
- func DateTimeToTime(datetime string) time.Time
- func DateToTime(date string) time.Time
- func DbFieldJoin(fields []string) string
- func Decrement() uint64
- func EmptySliceStruct() []struct{}
- func EmptyStruct() struct{}
- func FileExists(path string) bool
- func FileExt(f string) string
- func FileMTime(file string) (int64, error)
- func FileSize(file string) (int64, error)
- func FiledDbType2GoType(fieldType string) string
- func GeneratePassword(userPassword string) ([]byte, error)
- func GeneratePasswordNew(password, salt string) string
- func GetArgsValue(idx int, def string) string
- func GetBoolEnv(key string) bool
- func GetBoolEnvDefault(key string, def bool) bool
- func GetFreePort() (int, error)
- func GetIntEnv(key string) int
- func GetIntEnvDefault(key string, def int) int
- func GetIntranceIp() (string, error)
- func GetStringEnv(key string) string
- func GetStringEnvDefault(key string, def string) string
- func GetStringSliceEnv(key string) []string
- func Hmacsha256(s, key string) string
- func HttpRequest(queryUrl string, method string, params map[string]string, ...) ([]byte, error)
- func InSliceInt(v int, sl []int) bool
- func InSliceString(v string, sl []string) bool
- func Increment() uint64
- func IntSliceDiff(slice1, slice2 []int) (diffSlice []int)
- func IntSliceIntersect(slice1, slice2 []int) (diffslice []int)
- func IntSliceJoin(a []int, delim string) string
- func IntSliceToArgs(ids []int) []interface{}
- func IntSliceUnique(a []int) (ret []int)
- func IpInt2String(ipInt int) string
- func IpString2Int(ipString string) int64
- func IsDir(path string) bool
- func IsEmail(email string) bool
- func IsFile(path string) bool
- func IsValidTime(start, end time.Time) bool
- func MarkBankCard(str string) string
- func MarkEmail(str string) string
- func MarkIDCard(str string) string
- func MarkMobile(str string) string
- func MarkPassWord() string
- func MarkRealName(str string) string
- func Md5(str string) string
- func NowDatetime() string
- func NowTime() time.Time
- func NowTimestamp() int64
- func OpenFile(filename string) (*os.File, error)
- func RandNumString(n int) string
- func RandString(n int) string
- func RandomRangeInt(min, max int) int
- func RemoveSliceElement(sl []int, v int) []int
- func SetZipHeader(headerSetter HeaderSetter, topic string)
- func Sha256(s string) string
- func StringSliceToArgs(strs []string) []interface{}
- func StringSliceUnique(a []string) (ret []string)
- func TimestampToTime(timestamp int64) time.Time
- func ToCamel(s string) string
- func ToLowerCamel(s string) string
- func TodayStartEndTime() (time.Time, time.Time)
- func ValidatePassword(userPassword string, hashed string) (isOk bool, err error)
- func ValidatePasswordNew(password, hashed, salt string) bool
- func WFormatDuration(t int) string
- func ZipFile(files []File, filename string)
- type File
- type HeaderSetter
Constants ¶
View Source
const ( DefaultLocal = "Asia/Shanghai" DefaultDataTime = "2006-01-02 15:04:05" DefaultData = "2006-01-02" DefaultErrData = "1000-01-01" DefaultErrDataTime = "1000-01-01 00:00:00" )
View Source
const HOUR = 3600
View Source
const MINUTE = 60
Variables ¶
View Source
var Visits uint64
记录访问次数
Functions ¶
func DbFieldJoin ¶ added in v1.0.17
DbFieldJoin sql字段加引号和分隔号
func EmptySliceStruct ¶
func EmptySliceStruct() []struct{}
func FiledDbType2GoType ¶ added in v1.0.17
FiledDbType2GoType db字段类型转go类型
func GeneratePassword ¶
Deprecated 加密密码(太耗时,逐步废弃)
func GetArgsValue ¶
func GetBoolEnvDefault ¶
func GetIntEnvDefault ¶
func GetStringEnvDefault ¶
func Hmacsha256 ¶
func HttpRequest ¶
func HttpRequest(queryUrl string, method string, params map[string]string, headers map[string]string) ([]byte, error)
HttpRequest Deprecated 请调用request.NewHttpRequest()
func IntSliceDiff ¶
比较slice,返回差集,slice1 在 slice2中没有的值
func IntSliceIntersect ¶
比较slice,返回交集
func StringSliceToArgs ¶
func StringSliceToArgs(strs []string) []interface{}
[]string to []interface{}
func ValidatePassword ¶
Deprecated 验证密码(太耗时,逐步废弃)
Types ¶
type HeaderSetter ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.