Documentation ¶
Index ¶
- Variables
- func InitHttpServerSingle(ec *EnetConfig) error
- type CommonJsonResp
- type Context
- type EnetConfig
- type HandlerFunc
- type HttpServer
- func (h *HttpServer) Any(path string, handlers ...HandlerFunc)
- func (h *HttpServer) Close()
- func (h *HttpServer) Get(path string, handlers ...HandlerFunc)
- func (h *HttpServer) NewGroup(path string) *RouterGroup
- func (h *HttpServer) Post(path string, handlers ...HandlerFunc)
- func (h *HttpServer) Run()
- type NetLog
- type RouterGroup
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHttpGroupNil = errors.New("http group nil") ErrHttpLogNil = errors.New("log is nil") )
Functions ¶
func InitHttpServerSingle ¶
func InitHttpServerSingle(ec *EnetConfig) error
Types ¶
type CommonJsonResp ¶
func CreateJsonResp ¶
func CreateJsonResp(code int, msg string) CommonJsonResp
func CreateSuccessJsonResp ¶
func CreateSuccessJsonResp() CommonJsonResp
type EnetConfig ¶
type HandlerFunc ¶
type HandlerFunc func(c *Context)
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
var (
HttpWeb *HttpServer
)
func InitHttpServer ¶
func InitHttpServer(ec *EnetConfig) (*HttpServer, error)
func (*HttpServer) Any ¶
func (h *HttpServer) Any(path string, handlers ...HandlerFunc)
func (*HttpServer) Close ¶
func (h *HttpServer) Close()
func (*HttpServer) Get ¶
func (h *HttpServer) Get(path string, handlers ...HandlerFunc)
func (*HttpServer) NewGroup ¶
func (h *HttpServer) NewGroup(path string) *RouterGroup
func (*HttpServer) Post ¶
func (h *HttpServer) Post(path string, handlers ...HandlerFunc)
func (*HttpServer) Run ¶
func (h *HttpServer) Run()
type RouterGroup ¶
type RouterGroup struct {
// contains filtered or unexported fields
}
func (*RouterGroup) Any ¶
func (r *RouterGroup) Any(relativePath string, handlers ...HandlerFunc)
func (*RouterGroup) Get ¶
func (r *RouterGroup) Get(relativePath string, handlers ...HandlerFunc)
func (*RouterGroup) Post ¶
func (r *RouterGroup) Post(relativePath string, handlers ...HandlerFunc)
Click to show internal directories.
Click to hide internal directories.