Documentation ¶
Index ¶
- func HttpMethodToMethodString(httpMethod HttpMethod) string
- type ContextCloseFuncType
- type CreateInternalErrorRspFuncType
- type GetHandleContextFuncType
- type HttpError
- type HttpMethod
- type MiddlewareFuncType
- type WebServer
- func (o *WebServer) RegistFunc(baseUrl string, httpMethod HttpMethod, middlewares []MiddlewareFuncType, ...)
- func (o *WebServer) RegistFuncs(baseUrl string, httpMethod HttpMethod, middlewares []MiddlewareFuncType, ...)
- func (o *WebServer) Start(addr string) error
- func (o *WebServer) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpMethodToMethodString ¶ added in v0.0.33
func HttpMethodToMethodString(httpMethod HttpMethod) string
Types ¶
type ContextCloseFuncType ¶ added in v0.0.37
type ContextCloseFuncType func()
func DefaultGetContext ¶ added in v0.0.19
func DefaultGetContext(r *http.Request, funcInfo *delivery.HandleFuncInfo) (context.Context, ContextCloseFuncType, error)
type CreateInternalErrorRspFuncType ¶ added in v0.0.22
type GetHandleContextFuncType ¶ added in v0.0.19
type GetHandleContextFuncType func(r *http.Request, funcInfo *delivery.HandleFuncInfo) (context.Context, ContextCloseFuncType, error)
type HttpMethod ¶ added in v0.0.33
type HttpMethod int
const ( HttpMethodGet HttpMethod = 1 << iota MHttpMethodPost HttpMethodOptions )
func MethodStringToHttpMethod ¶ added in v0.0.33
func MethodStringToHttpMethod(method string) HttpMethod
func (HttpMethod) Match ¶ added in v0.0.33
func (o HttpMethod) Match(method string) bool
func (HttpMethod) ToString ¶ added in v0.0.33
func (o HttpMethod) ToString() string
type MiddlewareFuncType ¶ added in v0.0.38
type MiddlewareFuncType func(w http.ResponseWriter, r *http.Request, funcInfo *delivery.HandleFuncInfo) bool
type WebServer ¶
type WebServer struct { ServeMux *http.ServeMux OnHandleFinishedFunc delivery.OnHandleFinishedFuncType GetHandleContextFunc GetHandleContextFuncType CreateInternalErrorRspFunc CreateInternalErrorRspFuncType // contains filtered or unexported fields }
func NewWebServer ¶ added in v0.0.8
func NewWebServer() *WebServer
func (*WebServer) RegistFunc ¶ added in v0.0.32
func (o *WebServer) RegistFunc(baseUrl string, httpMethod HttpMethod, middlewares []MiddlewareFuncType, f interface{})
f type must be HandleFuncType
func (*WebServer) RegistFuncs ¶ added in v0.0.32
func (o *WebServer) RegistFuncs(baseUrl string, httpMethod HttpMethod, middlewares []MiddlewareFuncType, f ...interface{})
f type must be HandleFuncType
Click to show internal directories.
Click to hide internal directories.