Documentation ¶
Index ¶
- Constants
- func Cors() gin.HandlerFunc
- func ErrHandler(c *gin.Context)
- func LogFormatter(p gin.LogFormatterParams) string
- func PrepareProc(c *gin.Context)
- type App
- func (app *App) BadReq()
- func (app *App) CommonError(err error)
- func (app *App) Data(data interface{})
- func (app *App) ErrorMsg(msg string)
- func (app *App) GetApiCacheExpire() *time.Duration
- func (app *App) GetApiCacheKey() *string
- func (app *App) GetContentType() string
- func (app *App) GetCtxRespVal() *fastcurd.RetJSON
- func (app *App) GetFullReqURL() string
- func (app *App) GetLocale() string
- func (app *App) GetNotSaveResp() *bool
- func (app *App) GetNotTrace() *bool
- func (app *App) GetProcBeginTime() *time.Time
- func (app *App) GetProcTime() string
- func (app *App) GetReqID() string
- func (app *App) GetStatusCode() int
- func (app *App) GetToken() string
- func (app *App) GetUA() string
- func (app *App) GetUserAgent() string
- func (app *App) IsShouldSaveResp() bool
- func (app *App) JSON(json *fastcurd.RetJSON)
- func (app *App) NoAuth()
- func (app *App) NoChange()
- func (app *App) NoLogin()
- func (app *App) Ok(msg string, data ...interface{})
- func (app *App) RateLimitError()
- func (app *App) Response(code int, json *fastcurd.RetJSON)
- func (app *App) RetData(data interface{}, msgParam ...string)
- func (app *App) SendAffectRows(affectRows int)
- func (app *App) SendList(list interface{}, count int)
- func (app *App) ServerBad()
- func (app *App) ServerError(err error)
- func (app *App) SetApiCacheExpire(d *time.Duration)
- func (app *App) SetApiCacheKey(key string)
- func (app *App) SetCtxRespVal(json *fastcurd.RetJSON)
- func (app *App) SetNotSaveResp()
- func (app *App) SetNotTrace()
- func (app *App) SetProcBeginTime(beginTime *time.Time)
- func (app *App) SetProcTime(procTime string)
- func (app *App) SetReqID(reqID string)
- func (app *App) SetStatusCode(code int)
- func (app *App) String(html string)
- func (app *App) Success()
- func (app *App) ValidError(err error)
- func (app *App) XML(xml interface{})
- type ServerInfo
Constants ¶
View Source
const ( // head field HeadLocale = "locale" HeadToken = "token" HeadUserAgent = "User-Agent" HeadContentType = "Content-Type" // ctx key KeyUID = "uid" KeyTeam = "team" KeyTrans = "trans" KeyApp = "app" KeyAuthUser = "authUser" KeyInitOnce = "initOnce" KeyProcBeginTime = "procBeginTime" KeyNotSaveResp = "notSaveResp" KeyNotTrace = "notTrace" KeyResp = "resp" KeyReqID = "reqID" KeyApiCacheKey = "apiCacheKey" KeyApiCacheExpire = "apiCacheExpire" KeyRoles = "roles" KeyStatusCode = "statusCode" KeyProcTime = "procTime" )
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func ErrHandler ¶
func LogFormatter ¶
func LogFormatter(p gin.LogFormatterParams) string
Types ¶
type App ¶
func (*App) CommonError ¶
func (*App) GetApiCacheExpire ¶
func (*App) GetApiCacheKey ¶
func (*App) GetContentType ¶
func (*App) GetCtxRespVal ¶
func (*App) GetFullReqURL ¶
func (*App) GetNotSaveResp ¶
func (*App) GetNotTrace ¶
func (*App) GetProcBeginTime ¶
func (*App) GetProcTime ¶
func (*App) GetStatusCode ¶
func (*App) GetUserAgent ¶
func (*App) IsShouldSaveResp ¶
func (*App) RateLimitError ¶
func (app *App) RateLimitError()
func (*App) SendAffectRows ¶
func (*App) ServerError ¶
func (*App) SetApiCacheExpire ¶
func (*App) SetApiCacheKey ¶
func (*App) SetCtxRespVal ¶
func (*App) SetNotSaveResp ¶
func (app *App) SetNotSaveResp()
func (*App) SetNotTrace ¶
func (app *App) SetNotTrace()
func (*App) SetProcBeginTime ¶
func (*App) SetProcTime ¶
func (*App) SetStatusCode ¶
func (*App) ValidError ¶
type ServerInfo ¶
type ServerInfo struct {
Timestamp int64 `json:"timestamp"`
}
Click to show internal directories.
Click to hide internal directories.