Documentation ¶
Index ¶
- Constants
- func Assert(condition bool, msg string, code ...int)
- func Black(msg string) string
- func Blue(msg string) string
- func CompareHashAndPassword(e string, p string) (bool, error)
- func Cyan(msg string) string
- func FormatTimeStr(timeStr string) (string, error)
- func GenerateFromPassword(p string, cost int) (string, error)
- func GetBodyString(c *gin.Context) (string, error)
- func GetCurrentTime() time.Time
- func GetCurrentTimeStr() string
- func GetLocaHonst() string
- func GetLocation(ip string) string
- func GetUserIdStr(c *gin.Context) string
- func GetUserIdUint64(c *gin.Context) uint64
- func Green(msg string) string
- func HasError(err error, msg string, code ...int)
- func IdsStrToIdsIntGroup(key string, c *gin.Context) []int
- func IdsStrToIdsIntGroupStr(keys string) []int
- func Int64ToString(e int64) string
- func IntToString(e int) string
- func JsonStrToMap(e string) (map[string]interface{}, error)
- func Magenta(msg string) string
- func Red(msg string) string
- func Round(f float64, n int) float64
- func SetColor(msg string, conf, bg, text int) string
- func StringToBool(e string) (bool, error)
- func StringToInt(e string) (int, error)
- func StringToInt64(e string) (int64, error)
- func StringToUInt64(e string) (uint64, error)
- func StringToUint8(e string) (uint8, error)
- func StructToJsonStr(e interface{}) (string, error)
- func StructToMap(data interface{}) (map[string]interface{}, error)
- func White(msg string) string
- func Yellow(msg string) string
- type Ids
- type Mode
Constants ¶
View Source
const ( ModeDev Mode = "dev" ModeTest Mode = "test" ModeProd = "prod" Mysql = "mysql" Sqlite = "sqllite3" )
View Source
const ( TextBlack = iota + 30 TextRed TextGreen TextYellow TextBlue TextMagenta TextCyan TextWhite )
Variables ¶
This section is empty.
Functions ¶
func FormatTimeStr ¶
func GetCurrentTime ¶
func GetCurrentTimeStr ¶
func GetCurrentTimeStr() string
func GetUserIdStr ¶
func GetUserIdUint64 ¶
func HasError ¶
HasError 错误断言 当 error 不为 nil 时触发 panic 对于当前请求不会再执行接下来的代码,并且返回指定格式的错误信息和错误码 若 msg 为空,则默认为 error 中的内容
func IdsStrToIdsIntGroupStr ¶
func Int64ToString ¶
func IntToString ¶
func JsonStrToMap ¶
func StringToBool ¶
func StringToInt ¶
func StringToInt64 ¶
func StringToUInt64 ¶
func StringToUint8 ¶
func StructToJsonStr ¶
func StructToMap ¶
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.