Documentation
¶
Index ¶
- 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 any, receivers ...any) iris.Handler
- func GoroutineHandler() iris.Handler
- func HeapHandler() iris.Handler
- func HttpHandler2IrisHandler(h http.Handler) iris.Handler
- func IndexHandler() iris.Handler
- func Logger() util.ItfLogger
- func MutexHandler() iris.Handler
- func PProfWrapGroup(party iris.Party)
- func ProfileHandler() iris.Handler
- func RPCServer2IrisHandler(s j2rpc.Server) iris.Handler
- func RateLimiter(limit float64, burst int, options ...rate.Option) context.Handler
- func RestJSONError(c iris.Context, args ...interface{})
- func RestJSONSuccess(c iris.Context, vs ...interface{}) error
- func SymbolHandler() iris.Handler
- func ThreadCreateHandler() iris.Handler
- func TraceHandler() iris.Handler
- type AppStart
- func (a *AppStart) Constructor()
- func (a *AppStart) DefaultMiddlewares(p iris.Party)
- func (a *AppStart) ResetRPCServer(appBus interface{}, args ...interface{})
- func (a *AppStart) RootParty() iris.Party
- func (a *AppStart) RouteApp(middleware ...iris.Handler) iris.Party
- func (a *AppStart) SetRootParty(rootParty iris.Party)
- func (a *AppStart) Shutdown()
- func (a *AppStart) StartApp(opt StartOption)
- func (a *AppStart) Wait()
- type Captcha
- type CaptchaArg
- type IrBindFunc
- type J2rpcServerCallBackFunc
- type JSONResponse
- type RPCServerOption
- type StartOption
Constants ¶
This section is empty.
Variables ¶
var App = NewApp()
var DefaultRPCServerOption = &RPCServerOption{}
Functions ¶
func Addr ¶
func Addr(addr string, hostConfigs ...host.Configurator) iris.Runner
func AddrServer ¶
func AllocsHandler ¶
func AllocsHandler() iris.Handler
AllocsHandler will pass the call from /debug/pprof/allocs to pprof
func BindRestAPIs ¶
func BindRestAPIs(g iris.Party, api interface{})
func BlockHandler ¶
func BlockHandler() iris.Handler
BlockHandler will pass the call from /debug/pprof/block to pprof
func CmdlineHandler ¶
func CmdlineHandler() iris.Handler
CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof
func ConcurrentLimit ¶
func ConcurrentLimit(n int) iris.Handler
func Func2handler ¶
Func2handler fn param like those func Handler(c iris.Context,bound any) (any, error) func Handler(c iris.Context,bound any) any func Handler(c iris.Context,bound any) error func Handler(c iris.Context,bound any) func Handler(bound any) (any, error) func Handler(bound any) any func Handler(bound any) error func Handler(bound any) func Handler() (any, error) func Handler() any func Handler() error func Handler()
func GoroutineHandler ¶
func GoroutineHandler() iris.Handler
GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof
func HeapHandler ¶
func HeapHandler() iris.Handler
HeapHandler will pass the call from /debug/pprof/heap to pprof
func HttpHandler2IrisHandler ¶
func IndexHandler ¶
func IndexHandler() iris.Handler
IndexHandler will pass the call from /debug/pprof to pprof
func MutexHandler ¶
func MutexHandler() iris.Handler
MutexHandler will pass the call from /debug/pprof/mutex to pprof
func PProfWrapGroup ¶
func PProfWrapGroup(party iris.Party)
PProfWrapGroup adds several routes from package `net/http/pprof` to *gin.RouterGroup object
func ProfileHandler ¶
func ProfileHandler() iris.Handler
ProfileHandler will pass the call from /debug/pprof/profile to pprof
func RPCServer2IrisHandler ¶
func RateLimiter ¶
func RestJSONError ¶
func RestJSONError(c iris.Context, args ...interface{})
func RestJSONSuccess ¶
func RestJSONSuccess(c iris.Context, vs ...interface{}) error
func SymbolHandler ¶
func SymbolHandler() iris.Handler
SymbolHandler will pass the call from /debug/pprof/symbol to pprof
func ThreadCreateHandler ¶
func ThreadCreateHandler() iris.Handler
ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof
func TraceHandler ¶
func TraceHandler() iris.Handler
TraceHandler will pass the call from /debug/pprof/trace to pprof
Types ¶
type AppStart ¶
type AppStart struct { IrisApp *iris.Application WebLogger *midLogger Captcha *Captcha RPC j2rpc.Server // contains filtered or unexported fields }
func (*AppStart) Constructor ¶
func (a *AppStart) Constructor()
func (*AppStart) DefaultMiddlewares ¶
func (a *AppStart) DefaultMiddlewares(p iris.Party)
func (*AppStart) ResetRPCServer ¶
func (a *AppStart) ResetRPCServer(appBus interface{}, args ...interface{})
ResetRPCServer ...
func (*AppStart) RouteApp ¶
func (a *AppStart) RouteApp(middleware ...iris.Handler) iris.Party
RouteApp ......
func (*AppStart) SetRootParty ¶
func (a *AppStart) SetRootParty(rootParty iris.Party)
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 IrBindFunc ¶
type IrBindFunc func(c iris.Context, v interface{}) error
var GetBody IrBindFunc = func(c iris.Context, v interface{}) (err error) { var body []byte body, err = c.GetBody() if err != nil { return } if err = j2rpc.JSONDecode(body, v); err != nil { return } return }
var ReadBody IrBindFunc = func(c iris.Context, v interface{}) (err error) {
return c.ReadBody(v)
}
type J2rpcServerCallBackFunc ¶
type JSONResponse ¶
type JSONResponse struct { Code int `json:"code"` Msg string `json:"msg,omitempty"` Data interface{} `json:"data,omitempty"` }
JSONResponse ...
type RPCServerOption ¶
type RPCServerOption struct { ConcurrentLimit int RateLimitValue float64 RateLimitBurst int ServerHost string PPROFPort string //ResetRPCArgs type is j2rpc.Option or J2rpcServerCallBackFunc ResetRPCArgs []interface{} BeforeRouteAppFunc func(p iris.Party) AfterRouteAppFunc func(p iris.Party) }
func (*RPCServerOption) AddRPCServerArgsCallBack ¶
func (r *RPCServerOption) AddRPCServerArgsCallBack(args ...J2rpcServerCallBackFunc)
AddRPCServerArgsCallBack ...
func (*RPCServerOption) AddRPCServerArgsOption ¶
func (r *RPCServerOption) AddRPCServerArgsOption(args ...j2rpc.Option)
AddRPCServerArgsOption ...
func (*RPCServerOption) Prepare ¶
func (r *RPCServerOption) Prepare(vp *viper.Viper)
func (*RPCServerOption) StartIrisRPC ¶
func (r *RPCServerOption) StartIrisRPC(vp *viper.Viper, appBus interface{})