Documentation
¶
Index ¶
- Constants
- Variables
- func Addr(addr string, hostConfigs ...host.Configurator) iris.Runner
- func AddrServer(addr string) *http.Server
- func AllocsHandler() iris.Handler
- func BindRestAPIs(g iris.Party, api interface{})
- func BlockHandler() iris.Handler
- func CmdlineHandler() iris.Handler
- func ConcurrentLimit(n int) iris.Handler
- func Func2Handler(fn interface{}) iris.Handler
- func GoroutineHandler() iris.Handler
- func HeapHandler() iris.Handler
- func HttpHandler2IrisHandler(h http.Handler) iris.Handler
- func IndexHandler() iris.Handler
- func JSON(c iris.Context, code int, val ...interface{})
- func MutexHandler() iris.Handler
- func PProfWrapGroup(party iris.Party)
- func ProfileHandler() iris.Handler
- func QueueClearExpiredPattern() string
- func RPCServer2IrisHandler(h j2rpc.RPCServer) iris.Handler
- func RateLimiter() context.Handler
- func SetCrypto(k string)
- func SymbolHandler() iris.Handler
- func ThreadCreateHandler() iris.Handler
- func TraceHandler() iris.Handler
- type AppStart
- type Captcha
- type CaptchaArg
- type JSONResponse
- type JWT
- type Token
Constants ¶
const ( ErrorTokenExpired = "令牌已过期" ErrorTokenNotValidYet = "令牌不存在" ErrorTokenMalformed = "错误的令牌" ErrorTokenInvalid = "令牌已失效" ErrorTokenMissing = "非法访问" )
const ( JWTToken = "JWT_TOKEN" ContextUser = "CONTEXT_USER" )
Variables ¶
var App = new(AppStart)
var IncJWT = new(JWT)
Functions ¶
func AddrServer ¶
func AllocsHandler ¶
AllocsHandler will pass the call from /debug/pprof/allocs to pprof
func BindRestAPIs ¶
func BlockHandler ¶
BlockHandler will pass the call from /debug/pprof/block to pprof
func CmdlineHandler ¶
CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof
func ConcurrentLimit ¶
func Func2Handler ¶
func GoroutineHandler ¶
GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof
func HeapHandler ¶
HeapHandler will pass the call from /debug/pprof/heap to pprof
func IndexHandler ¶
IndexHandler will pass the call from /debug/pprof to pprof
func MutexHandler ¶
MutexHandler will pass the call from /debug/pprof/mutex to pprof
func PProfWrapGroup ¶
PProfWrapGroup adds several routes from package `net/http/pprof` to *gin.RouterGroup object
func ProfileHandler ¶
ProfileHandler will pass the call from /debug/pprof/profile to pprof
func QueueClearExpiredPattern ¶
func QueueClearExpiredPattern() string
func RateLimiter ¶
func SymbolHandler ¶
SymbolHandler will pass the call from /debug/pprof/symbol to pprof
func ThreadCreateHandler ¶
ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof
func TraceHandler ¶
TraceHandler will pass the call from /debug/pprof/trace to pprof
Types ¶
type AppStart ¶
type AppStart struct {
IrisApp *iris.Application `inject:""`
Config *config.Config `inject:""`
WebLogger *midLogger `inject:""`
Captcha *Captcha `inject:""`
JWT *JWT `inject:""`
Validator *util.Validator `inject:""`
RPC j2rpc.RPCServer `inject:""`
SysLogger util.ItfLogger `inject:""`
RPCServerFunc func(server j2rpc.RPCServer)
// contains filtered or unexported fields
}
func (*AppStart) Constructor ¶
func (a *AppStart) Constructor()
type Captcha ¶
type Captcha struct {
Driver base64Captcha.Driver
Store base64Captcha.Store
// contains filtered or unexported fields
}
func (*Captcha) Generate ¶
func (c *Captcha) Generate() (arg CaptchaArg, err error)
func (*Captcha) Verify ¶
func (c *Captcha) Verify(arg *CaptchaArg) bool
type CaptchaArg ¶
type JSONResponse ¶
type JSONResponse struct {
Code int `json:"code"`
Msg string `json:"msg,omitempty"`
Data interface{} `json:"data,omitempty"`
}
JSONResponse ...