Documentation ¶
Overview ¶
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2021-01-05 12:33:08
@LastEditors: moo
@LastEditTime: 2021-01-06 22:06:26
@Description:
@Author: moo
@Email: moo@163.com
@Date: 2021-01-04 23:22:43
@LastEditTime: 2021-01-04 23:27:28
@LastEditors: moo
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2021-01-06 14:22:20
@LastEditors: moo
@LastEditTime: 2021-05-28 15:16:07
* @Author: Miles * @Date: 2020-05-25 19:43:36 * @Last Modified by: Miles * @Last Modified time: 2020-05-25 21:10:32
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2021-01-11 13:56:53
@LastEditors: moo
@LastEditTime: 2021-01-11 15:50:00
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2021-01-09 14:03:49
@LastEditors: moo
@LastEditTime: 2021-05-19 17:51:09
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2021-01-19 10:29:02
@LastEditors: moo
@LastEditTime: 2021-01-28 20:43:30
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2021-01-03 18:05:41
@LastEditors: moo
@LastEditTime: 2021-01-30 15:39:44
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-12-29 16:32:55
@LastEditors: moo
@LastEditTime: 2021-01-04 15:31:14
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-12-26 17:58:06
@LastEditors: moo
@LastEditTime: 2020-12-26 17:59:48
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-12-26 17:58:06
@LastEditors: moo
@LastEditTime: 2020-12-26 17:59:58
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-12-26 17:58:06
@LastEditors: moo
@LastEditTime: 2021-03-26 16:05:47
stringutil 包含有用于处理字符串的工具函数。
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-10-26 18:35:32
@LastEditors: moo
@LastEditTime: 2020-12-29 16:45:07
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-12-26 17:58:06
@LastEditors: moo
@LastEditTime: 2020-12-26 18:18:33
@Name:
@Descripttion:
@Warning:
@version:
@Author: moo
@Date: 2020-12-29 15:03:43
@LastEditors: moo
@LastEditTime: 2020-12-29 18:59:26
Index ¶
- Constants
- func Bd09ToGcj02(lat float64, lon float64) []float64
- func Bd09ToGps84(lat float64, lon float64) []float64
- func Black(msg string) string
- func Blue(msg string) string
- func BubbleSort(arr *[]int)
- func CheckEmailPassword(server string, email string, password string) bool
- func ConvertToStr(src string, srcCode string, tagCode string) string
- func CreateRandInt(min int, max int) int
- func CurrLocation() *time.Location
- func Cyan(msg string) string
- func DateStrToLastTime(s string) time.Time
- func DateStrToTime(s string) time.Time
- func DateStrToZeroTime(s string) time.Time
- func DateToStr(t time.Time) string
- func DetermineEncoding(html string) (encoding.Encoding, string)
- func DifferentArrayUint(a []uint, b []uint) []uint
- func DuplicateArray(a []interface{}) (ret []interface{})
- func DuplicateArrayStr(arr []string) []string
- func DuplicateArrayUint(v []uint) (ret []uint)
- func EarthDistance(lat1, lng1, lat2, lng2 float64) float64
- func EmailSend(mailConn MailSetting, email string, title string, body string) (err error)
- func Encoding(html string, ct string) string
- func FileGetContent(file string) string
- func FilterHtml(s string) string
- func FilteredSQLInject(to_match_str string) bool
- func GapDays(t1, t2 time.Time) int
- func GapMonth(t1, t2 time.Time) (month int)
- func Gcj02ToBd09(lat float64, lon float64) []float64
- func Gcj02ToGps84(lat float64, lon float64) []float64
- func GenPwdHash(userPassword string) (string, error)
- func GeneSalt() string
- func Get(url string) string
- func GetCateory15Min(bgndt time.Time, enddt time.Time) []string
- func GetCateoryDay(bgndt time.Time, enddt time.Time) []string
- func GetCateoryDay1(bgndt time.Time, enddt time.Time) []string
- func GetCateoryHour(bgndt time.Time, enddt time.Time) []string
- func GetCateoryMonth(bgndt time.Time, enddt time.Time) []string
- func GetCateoryMonth1(bgndt time.Time, enddt time.Time) []string
- func GetCookie(r *http.Request, name string) string
- func GetCrossSectionArea(rr float64, hh float64) float64
- func GetDecoder() *mime.WordDecoder
- func GetExternalIp() string
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetFolders(server string, email string, password string, folder string) map[string]int
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetLastTime(d time.Time) time.Time
- func GetLocalIP() []string
- func GetMailNum(server string, email string, password string) map[string]int
- func GetServerIP() (net.IP, error)
- func GetUrlArg(r *http.Request, name string) string
- func GetVCodeBase64() (string, string, error)
- func GetZeroTime(d time.Time) time.Time
- func Gps84ToBd09(lat float64, lon float64) []float64
- func Gps84ToGcj02(lat float64, lon float64) []float64
- func Green(msg string) string
- func Hash(s string) string
- func HourDiffer(start_time, end_time time.Time) int64
- func InsertionSort(arr *[]int)
- func IsDate(s string) bool
- func IsEmail(s string) bool
- func IsEnChar(s string) bool
- func IsFileExist(path string) (bool, error)
- func IsHan(s string) bool
- func IsIDCard(s string) bool
- func IsMobile(s string) bool
- func IsNumber(s string) bool
- func JsonEscHTMLStr(data interface{}) string
- func Logger() *logrus.Logger
- func LoggerToFile() gin.HandlerFunc
- func Magenta(msg string) string
- func MakeToken(obj map[string]interface{}) (string, error)
- func Md5(src string) string
- func MergeSort(arr *[]int, left int, right int)
- func MinuteDiffer(start_time, end_time time.Time) int64
- func MurmurHash64A(data []byte) (h int64)
- func ParseIp(myip string) *ipdb.CityInfo
- func ParseToken(tokenStr string) map[string]interface{}
- func QuickSort(arr *[]int, left int, right int)
- func QuickSort2(arr *[]int, left int, right int)
- func RandFloat(min, max float64) float64
- func RandomContent(size int) string
- func RandomInt(min int, max int) int
- func RandomMobile() string
- func RandomName() string
- func RandomSite() string
- func RandomString(size int) string
- func RandomTime() time.Time
- func RandomTitle() string
- func Red(msg string) string
- func RedirectStderr(f *os.File)
- func Reverse(s string) string
- func Reverse2(s string) string
- func SelectionSort(arr *[]int)
- func Send(server string, from string, password string, to []string, subject string, ...) error
- func SendSms(mobile string, contentStr string) error
- func SetColor(msg string, conf, bg, text int) string
- func SetCookie(name string, value string, w *http.ResponseWriter)
- func ShowStringByte(str string)
- func StrToInt(s string) int
- func StrToUint(s string) uint
- func String2Time(in string) (out time.Time, err error)
- func StringLen(s string) int
- func StringSub(s string, length int) string
- func TimeStrToTime(s string) time.Time
- func TimeToStr(t time.Time) string
- func TrimHtml(sHtml string) string
- func TrimHtmlDesc(sHtml string, iLen int) string
- func TruncFloat(f float64, unit float64) float64
- func UnFilterHtml(s string) string
- func Uuid() string
- func ValidatePwd(userPassword string, hashed string) bool
- func VerifyVCodeBase64(id string, val string) bool
- func White(msg string) string
- func Yellow(msg string) string
- type GPSMODE
- type IndexData
- type JsonListResult
- type JsonResult
- type MailItem
- type MailPageList
- type MailServer
- type MailSetting
- type RspSms
- type SmtpBody
- type Snowflake
- type ViewData
- type ViewHtml
Constants ¶
const ( TextBlack = iota + 30 TextRed TextGreen TextYellow TextBlue TextMagenta TextCyan TextWhite )
const ( TIME_LAYOUT string = "2006-01-02 15:04:05" TIME_DATE_LAYOUT string = "2006-01-02" )
const ( BIG_M = 0xc6a4a7935bd1e995 BIG_R = 47 SEED = 0x1234ABCD )
const SECRET = "taoshihan"
Variables ¶
This section is empty.
Functions ¶
func CheckEmailPassword ¶
验证邮箱密码
func CurrLocation ¶
func DateStrToLastTime ¶
func DateStrToTime ¶
func DateStrToZeroTime ¶
func DuplicateArray ¶
func DuplicateArray(a []interface{}) (ret []interface{})
func DuplicateArrayStr ¶
func DuplicateArrayUint ¶
为了性能需要尽可能的减小拷贝,最悲观的情况每个元素只移动一次。 该函数会改变原先的 切片内容次序
func EarthDistance ¶
func EmailSend ¶
func EmailSend(mailConn MailSetting, email string, title string, body string) (err error)
func FilterHtml ¶
func GetCrossSectionArea ¶
func GetDecoder ¶
func GetDecoder() *mime.WordDecoder
func GetExternalIp ¶
func GetExternalIp() string
func GetFirstDateOfMonth ¶
获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetFolders ¶
获取邮件夹
func GetLastDateOfMonth ¶
获取传入的时间所在月份的最后一天,即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func GetLocalIP ¶
func GetLocalIP() []string
func GetMailNum ¶
获取邮件总数
func GetServerIP ¶
func GetVCodeBase64 ¶
func JsonEscHTMLStr ¶
func JsonEscHTMLStr(data interface{}) string
func LoggerToFile ¶
func LoggerToFile() gin.HandlerFunc
func MurmurHash64A ¶
func ParseToken ¶
func QuickSort2 ¶
快速排序2 找到一个基准,左边是所有比它小的,右边是比它大的,分别递归左右
func RandomContent ¶
func RandomMobile ¶
func RandomMobile() string
func RandomName ¶
func RandomName() string
func RandomSite ¶
func RandomSite() string
func RandomString ¶
func RandomTime ¶
func RandomTitle ¶
func RandomTitle() string
func ShowStringByte ¶
func ShowStringByte(str string)
func TimeStrToTime ¶
func TrimHtmlDesc ¶
func TruncFloat ¶
uint 代表小数位数,格式位 0.000001 如果是几位就指定为几位
func UnFilterHtml ¶
func VerifyVCodeBase64 ¶
Types ¶
type JsonListResult ¶
type JsonListResult struct { JsonResult Result interface{} `json:"result"` }
type JsonResult ¶
type MailItem ¶
type MailItem struct { Subject string Fid string Id uint32 From string To string Body string Date string }
type MailPageList ¶
type MailPageList struct {
MailItems []*MailItem
}
type MailServer ¶
type MailServer struct {
Server, Email, Password string
}
func GetMailServerFromCookie ¶
func GetMailServerFromCookie(r *http.Request) *MailServer
type MailSetting ¶
type Snowflake ¶
A Snowflake struct holds the basic information needed for a snowflake generator worker
func NewSnowflake ¶
NewNode returns a new snowflake worker that can be used to generate snowflake IDs