Documentation ¶
Index ¶
- Constants
- Variables
- func BadRequest(ctx *gin.Context, err error)
- func CalcTimeRange(fromDate string, toDate string) int64
- func CheckDirectoryExists(dir string) bool
- func CheckHash(hash string, secret string) error
- func ConvertInterfaceToIntMap(i []interface{}) []int
- func ConvertStringToDateTimeString(s string) (string, error)
- func ConvertToBool(any interface{}) bool
- func ConvertToFloat64(any interface{}) float64
- func ConvertToInt(any interface{}) int
- func ConvertToString(any interface{}) string
- func CreateHash(secret string) string
- func CreateMD5(secret interface{}) string
- func CreateSHA1(secret interface{}) string
- func CreateUuid() string
- func CurrentDateTimeIsGreaterThanSpecifiedDateTime(t *time.Time) bool
- func DebugPrintf(any interface{})
- func Fail(ctx *gin.Context, err error)
- func GetBytes(key interface{}) ([]byte, error)
- func GetCurrentGoFilePath() string
- func GetDateTimeByTraditionalChinese[T string | time.Time](t T) (time.Time, error)
- func GetFileContentType(extension string) string
- func GetFileExtensionByContentType(contentType string) string
- func GetFunctionName() string
- func GetGinRequest(c *gin.Context)
- func GetJSON(value interface{}) string
- func GetNextWeekDayDateTime(wdt time.Time) time.Time
- func GetNowDateTimeByFormat(format string) string
- func GetOS() string
- func GetPathSeparator() string
- func GetPostJSON(ctx *gin.Context)
- func GetSpecifyNextWeekDayDateTime(wdt time.Time) time.Time
- func GetSpecifyNextWeekDayDateTimeByString(wdts string) time.Time
- func GetStructName(s interface{}) string
- func GetTimeByTimeString(ts string) (*time.Time, error)
- func GetType(value interface{})
- func GetWeekDayEnglishByTraditionalChinese(traditionalChinese string) string
- func GetWeekDayShortTraditionalChineseByEnglish(english string) string
- func GetWeekDayTraditionalChineseByEnglish(english string) string
- func GetWeekDays() []string
- func IsDateTime(s string) bool
- func IsRunnigTest() bool
- func IsShortDateOrTraditionalChineseShortDate(tc string) bool
- func IsValidUUID(u string) bool
- func Pluck(any interface{}, key string) interface{}
- func Response(ctx *gin.Context, value interface{}, err error)
- func ShortDateIsEveryDay(tc string) bool
- func SliceToSet(any interface{}) interface{}
- func Success(ctx *gin.Context, value interface{}, message interface{})
- func TruncateString(s string, maxLength int) string
- func Unauthorized(ctx *gin.Context, err error)
- func UploadSuccess(ctx *gin.Context, value interface{}, message interface{})
- func ValidJSONWebToken(requestToken string) bool
- func ValidateURL(str string) bool
- type Result
- type Token
Constants ¶
View Source
const Iso8601 = "2006-01-02"
View Source
const Rfc2822 = "Mon Jan 02 15:04:05 -0700 2006"
View Source
const Yyyymmddhhmmss = "2006/01/02 15:04:05"
Variables ¶
View Source
var (
RootPath = filepath.Join(filepath.Dir(b), "../..")
)
Functions ¶
func BadRequest ¶
func CalcTimeRange ¶
func CheckDirectoryExists ¶
func ConvertInterfaceToIntMap ¶
func ConvertInterfaceToIntMap(i []interface{}) []int
func ConvertToBool ¶
func ConvertToBool(any interface{}) bool
func ConvertToFloat64 ¶
func ConvertToFloat64(any interface{}) float64
func ConvertToInt ¶
func ConvertToInt(any interface{}) int
func ConvertToString ¶
func ConvertToString(any interface{}) string
func CreateHash ¶
func CreateSHA1 ¶
func CreateSHA1(secret interface{}) string
func CreateUuid ¶
func CreateUuid() string
func DebugPrintf ¶
func DebugPrintf(any interface{})
func GetCurrentGoFilePath ¶
func GetCurrentGoFilePath() string
func GetFileContentType ¶
func GetFunctionName ¶
func GetFunctionName() string
func GetGinRequest ¶
func GetNowDateTimeByFormat ¶
func GetPathSeparator ¶
func GetPathSeparator() string
func GetPostJSON ¶
func GetStructName ¶
func GetStructName(s interface{}) string
func GetWeekDays ¶
func GetWeekDays() []string
func IsDateTime ¶
func IsRunnigTest ¶
func IsRunnigTest() bool
func IsValidUUID ¶
func ShortDateIsEveryDay ¶
func SliceToSet ¶
func SliceToSet(any interface{}) interface{}
func TruncateString ¶
func Unauthorized ¶
func UploadSuccess ¶
func ValidJSONWebToken ¶
func ValidateURL ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.