Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Main = gcmd.Command{ Name: "main", Usage: "main", Brief: "start http server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { s := g.Server() s.BindHookHandler("/*", ghttp.HookBeforeServe, beforeServeHook) s.BindHandler("/api/ws/message", Server) s.Run() return nil }, } )
Functions ¶
func MiddlewareAuth ¶
func MiddlewareHandlerResponse ¶
MiddlewareHandlerResponse is the default middleware handling handler response object and its error.
Types ¶
type DefaultHandlerResponse ¶
type DefaultHandlerResponse struct { Code int `json:"code" dc:"Error code"` Message string `json:"message" dc:"Error message"` Data interface{} `json:"data" dc:"Result data for certain request according API definition"` }
DefaultHandlerResponse is the default implementation of HandlerResponse.
Click to show internal directories.
Click to hide internal directories.