Documentation ¶
Index ¶
- func AllowCORS(writer http.ResponseWriter)
- func ConvertDateTimeStringToTime(timeString string) time.Time
- func ConvertTimeToDateString(time time.Time) string
- func ConvertTimeToDateTimeString(time time.Time) string
- func ConvertTimeToTimeString(time time.Time) string
- func CopyFile(srcPath string, destPath string) (nBytes int64)
- func DeleteEmptyDir(dirPath string) bool
- func DeleteEmptyDirRecursive(dirPath string)
- func DisableCache(writer http.ResponseWriter)
- func EnvDevelopment() bool
- func EnvMacDevelopment() bool
- func EnvWinDevelopment() bool
- func FirstMinuteOfDay(day time.Time) time.Time
- func FirstSecondOfDay(day time.Time) time.Time
- func GetBcrypt(raw string) string
- func GetConfPath() string
- func GetDevHomePath() string
- func GetDirOfPath(fullPath string) string
- func GetExtension(filename string) string
- func GetFallbackMimeType(filename string, fallback string) string
- func GetFilenameOfPath(fullPath string) string
- func GetGoPath() string
- func GetHomePath() string
- func GetHostFromRequest(request *http.Request) string
- func GetHtmlPath() string
- func GetIpAddress(r *http.Request) string
- func GetLogPath() string
- func GetMd5(raw string) string
- func GetMimeType(filename string) string
- func GetMysqlUrl(mysqlPort int, mysqlHost string, mysqlSchema string, mysqlUsername string, ...) string
- func GetSessionUuidFromRequest(request *http.Request, cookieAuthKey string) string
- func GetSimpleFileName(filename string) string
- func HumanFileSize(bytes int64) string
- func LastSecondOfDay(day time.Time) time.Time
- func MakeDirAll(dirPath string) string
- func MatchBcrypt(raw string, bcryptStr string) bool
- func PathExists(path string) bool
- func RandomNumber4() string
- func RandomString4() string
- func Tomorrow() time.Time
- func UniformPath(p string) string
- func Yesterday() time.Time
- func Zip(srcPath string, destPath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDateTimeStringToTime ¶
convert time string(yyyy-MM-dd HH:mm:ss) to Time object
func ConvertTimeToDateString ¶
convert Time object to string(yyyy-MM-dd)
func ConvertTimeToDateTimeString ¶
convert Time object to string(yyyy-MM-dd HH:mm:ss)
func ConvertTimeToTimeString ¶
convert Time object to string(HH:mm:ss)
func DeleteEmptyDir ¶
try to delete empty dir. true: delete an empty dir, false: delete nothing.
func DeleteEmptyDirRecursive ¶
func DeleteEmptyDirRecursive(dirPath string)
delete empty dir recursive, delete until not empty.
func GetFallbackMimeType ¶
get MimeType by filename, if not found return fallback.
func GetFilenameOfPath ¶
get filename from path. eg /var/www/xx.log -> xx.log
func GetHostFromRequest ¶
get host from request
func GetHtmlPath ¶
func GetHtmlPath() string
get html path dev: return $project/build/html prod: return $application/html
func GetMimeType ¶
get MimeType by filename, if not found return "application/octet-stream"
func GetMysqlUrl ¶
func GetMysqlUrl( mysqlPort int, mysqlHost string, mysqlSchema string, mysqlUsername string, mysqlPassword string) string
get mysql url.
func GetSessionUuidFromRequest ¶
get cookieAuthKey from request.
func GetSimpleFileName ¶
get filename without extension
func MatchBcrypt ¶
func PathExists ¶
func UniformPath ¶
1. replace \\ to / 2. clean path. 3. trim suffix /
Types ¶
This section is empty.