Documentation ¶
Index ¶
- func Decimal(value float64) float64
- func EncryptPassword(password, salt string) string
- func FileIsExisted(filename string) bool
- func GetBetweenDates(sdate, edate string) []string
- func GetCityByIp(ip string) string
- func GetClientIp(ctx context.Context) string
- func GetDomain(ctx context.Context) string
- func GetLocalIP() (ip string, err error)
- func GetQuarterDay() (string, string)
- func GetTime(i int, types int, begin string) (startTime string, endTime string, duration int, unit string)
- func GetTimeByType(types int) (index int, begin string, end string)
- func GetUserAgent(ctx context.Context) string
- func GetWeekDay() (string, string)
- func InArray(target string, strArray []string) bool
- func MarkdownToHtml(mdContent string) string
- func ParseFilePath(pathStr string) (fileName string, fileType string)
- func RemoveDuplicationMap(arr []string) []string
- func RemoveRepeatedElementAndEmpty(arr []int) []int
- func ReplaceTemplate(content string, variable map[string]interface{}) (result string, err error)
- func WriteToFile(fileName string, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBetweenDates ¶
GetBetweenDates 根据开始日期和结束日期计算出时间段内所有日期 参数为日期格式,如:2020-01-01
func GetTime ¶
func GetTime(i int, types int, begin string) (startTime string, endTime string, duration int, unit string)
GetTime 根据类型和开始时间获取时间段及长度
func GetTimeByType ¶
GetTimeByType 根据类型获取开始时间、结束时间及差值 1 天 2 周 3 月 4 年
func ParseFilePath ¶
解析路径获取文件名称及后缀
func RemoveDuplicationMap ¶
RemoveDuplicationMap 数组去重
func ReplaceTemplate ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.