utils

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UTCDatetime : 2006-01-02 15:04:05
	UTCDatetime = "2006-01-02 15:04:05"
	UTCMonth    = "200601"
	// UTCDay : 20060102
	UTCDay             = "20060102"
	UTCHour            = "2006010215"
	UTCDatetimeDay     = "2006-01-02"
	UTCDatetimeMinute  = "2006-01-02 15:04:00"
	UTCDatetimeHour    = "2006-01-02 15:00:00"
	UTCDatetimeOnlyDay = "2006-01-02 00:00:00"
)
View Source
const (
	Success         = 200
	Error           = 500
	ErrorAuth       = 403
	InvalidParams   = 10001
	InvalidAppID    = 10002
	InvalidCoinType = 10003
	ConfigError     = 10004
	Exist           = 409
)

Variables

View Source
var MessageFlags = map[int]string{
	Success:         "success",
	Error:           "fail",
	ErrorAuth:       "auth error",
	InvalidParams:   "invalid params",
	InvalidAppID:    "invalid app id",
	InvalidCoinType: "invalid coin type",
	ConfigError:     "config error",
	Exist:           "exists",
}
View Source
var StatusFlags = map[int]int{
	Success: 0,
	Error:   1,
}

Functions

func ConfigLocalFilesystemLogger

func ConfigLocalFilesystemLogger(logPath, logFileName string, maxAge, rotationTime time.Duration)

func GetMessage

func GetMessage(status int) string

func GetStatus

func GetStatus(status int) int

func Redirect

func Redirect(c *gin.Context, httpCode int, url string)

func Response

func Response(c *gin.Context, httpCode, status int, data interface{})

func ResponseError

func ResponseError(c *gin.Context, httpCode, status int, data interface{})

func ResponseList

func ResponseList(c *gin.Context, httpCode, status int, list interface{}, count int)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL