Documentation ¶
Index ¶
- Variables
- func AmountDiv1e12UInt64(amount string, str string) (uint64, bool)
- func AmountMul1e12(amount string, str string) (string, bool)
- func Camel2Case(name string) string
- func Camel2Case2(name string) string
- func Case2Camel(name string) string
- func ClickLoginPwdStr(ss string, str string) bool
- func Explicit(v reflect.Value, depth int)
- func FixThPhone(phone string) string
- func GenUUID() uint64
- func GenValidateCode(width int) string
- func Get16MD5Encode(data string) string
- func GetBeforeToDayTimeStampRangeByDay(day int) (int64, int64)
- func GetClientIP(req *http.Request) string
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetFirstDateOfWeek(now time.Time) time.Time
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetLoginPwdStr(str string) string
- func GetMD5Encode(data string) string
- func GetSha1Str(str string) string
- func GetTimeStampByString(str string, loc *time.Location) int64
- func GetToDayTimeStampRangeByDay(t time.Time) (int64, int64)
- func GetToDayTimeStampRangeByMonth(t time.Time) (int64, int64)
- func GetToDayTimeStampRangeByWeek(t time.Time) (int64, int64)
- func GetVIPLevel(VIP string) (bool, int)
- func GetVIPUpdate(VIP string) (bool, int)
- func GetZeroTime(d time.Time) time.Time
- func GetZeroTimeStampToDay() int64
- func Int64ToStr(num int64) string
- func Int64ToString(num int64) string
- func IntInSlice(num int, slice []int) (exists bool)
- func IntToStr(num int) string
- func IsThPhone(phone string) bool
- func Lcfirst(str string) string
- func Print(str string, data ...interface{})
- func QuitSignal(quitFunc func())
- func RandInt64(min, max int64) int64
- func RandStringRunes(n int) string
- func Recover()
- func RemoveRep(slc []int) []int
- func RemoveRepByLoop(slc []int) []int
- func RemoveRepByMap(slc []int) []int
- func RemoveRepeatedForString(s []string) []string
- func RemoveStringRepeatedByString(slice, repeatedSlice []string) []string
- func SetMachineID(mid int64)
- func To2Decimal(value float64) float64
- func ToYYYYMMDD(t time.Time) int64
- func Ucfirst(str string) string
- func Uint32ToString(num uint32) string
- func Uint64ToString(num uint64) string
- func WeekByDate(t time.Time) int64
- type BitMap
- type Bitmap
- type Buffer
- type Heap
- type HeapInfo
- type JsonCamelCase
- type JsonSnakeCase
- type Maps
- type Switch
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Epoch 2021年3月3号0:00时刻的毫秒级时间戳 Epoch int64 = 1614700800000 )
View Source
var (
ErrOutOfMaps = errors.New("位图越界")
)
View Source
var (
IST, _ = time.LoadLocation("Asia/Kolkata")
)
Functions ¶
func Camel2Case2 ¶
************************************** 其他方法 **************************************
func ClickLoginPwdStr ¶
ClickLoginPwdStr 校验密码 ss 用户输入密码 str 数据库用户密码
func FixThPhone ¶
func GenValidateCode ¶
func Get16MD5Encode ¶
func GetBeforeToDayTimeStampRangeByDay ¶
获取当前天n天钱0点时间戳和当天24点时间戳, 传0即为当前天的0点和24点
func GetClientIP ¶
func GetFirstDateOfMonth ¶
获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetLastDateOfMonth ¶
获取传入的时间所在月份的最后一天,即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func GetLoginPwdStr ¶
func GetSha1Str ¶
func GetToDayTimeStampRangeByDay ¶
获取当前天的0点和24点
func GetToDayTimeStampRangeByMonth ¶
获取t月第一天0点时间戳和本周最后一天24点时间戳
func GetToDayTimeStampRangeByWeek ¶
获取t周第一天0点时间戳和本周最后一天24点时间戳
func GetVIPLevel ¶
func GetVIPUpdate ¶
func Int64ToStr ¶
func Int64ToString ¶
func IntInSlice ¶
func QuitSignal ¶
func QuitSignal(quitFunc func())
func RandStringRunes ¶
func RemoveStringRepeatedByString ¶
返回第一列表不包含第二个列表内容
func ToYYYYMMDD ¶
func Uint32ToString ¶
func Uint64ToString ¶
Types ¶
type BitMap ¶
type BitMap struct {
// contains filtered or unexported fields
}
位图
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
本例为最大堆 最小堆只需要修改less函数即可
func (*Heap) RemoveByIndex ¶
删除堆中位置为i的元素 返回被删元素的值
type JsonCamelCase ¶
type JsonCamelCase struct {
Value interface{}
}
************************************** 驼峰json **************************************
func (JsonCamelCase) MarshalJSON ¶
func (c JsonCamelCase) MarshalJSON() ([]byte, error)
type JsonSnakeCase ¶
type JsonSnakeCase struct {
Value interface{}
}
************************************** 下划线json **************************************
func (JsonSnakeCase) MarshalJSON ¶
func (c JsonSnakeCase) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.