Documentation ¶
Index ¶
- type ErrResponse
- type FilterChain
- type FilterFunc
- type HttpContext
- func (hc *HttpContext) API(api router.API)
- func (hc *HttpContext) Abort()deprecated
- func (hc *HttpContext) AddHeader(k, v string)
- func (hc *HttpContext) AllHeaders() http.Header
- func (hc *HttpContext) AppendFilterFunc(ff ...FilterFunc)deprecated
- func (hc *HttpContext) GetAPI() *router.API
- func (hc *HttpContext) GetApplicationName() string
- func (hc *HttpContext) GetClientIP() string
- func (hc *HttpContext) GetHeader(k string) string
- func (hc *HttpContext) GetLocalReplyBody() []byte
- func (hc *HttpContext) GetMethod() string
- func (hc *HttpContext) GetRouteEntry() *model.RouteAction
- func (hc *HttpContext) GetStatusCode() int
- func (hc *HttpContext) GetUrl() string
- func (hc *HttpContext) LocalReply() bool
- func (hc *HttpContext) Next()deprecated
- func (hc *HttpContext) Reset()
- func (hc *HttpContext) RouteEntry(r *model.RouteAction)
- func (hc *HttpContext) SendLocalReply(status int, body []byte)
- func (hc *HttpContext) SetUrl(url string)
- func (hc *HttpContext) StatusCode(code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrResponse ¶
type ErrResponse struct {
Message string `json:"message"`
}
ErrResponse err response.
type HttpContext ¶
type HttpContext struct { //Deprecated: waiting to delete Index int8 //Deprecated: waiting to delete Filters FilterChain Timeout time.Duration Ctx context.Context Params map[string]interface{} // the response context will return. TargetResp *client.Response // client call response. SourceResp interface{} HttpConnectionManager model.HttpConnectionManagerConfig Route *model.RouteAction Api *router.API Request *http.Request Writer http.ResponseWriter // contains filtered or unexported fields }
HttpContext http context
func (*HttpContext) API ¶
func (hc *HttpContext) API(api router.API)
API sets the API to http context
func (*HttpContext) Abort
deprecated
func (hc *HttpContext) Abort()
Deprecated: Abort filter chain break , filter after the current filter will not executed.
func (*HttpContext) AllHeaders ¶
func (hc *HttpContext) AllHeaders() http.Header
AllHeaders get all headers
func (*HttpContext) AppendFilterFunc
deprecated
func (hc *HttpContext) AppendFilterFunc(ff ...FilterFunc)
Deprecated: AppendFilterFunc append filter func.
func (*HttpContext) GetApplicationName ¶
func (hc *HttpContext) GetApplicationName() string
GetApplicationName get application name
func (*HttpContext) GetClientIP ¶
func (hc *HttpContext) GetClientIP() string
GetClientIP get client IP
func (*HttpContext) GetHeader ¶
func (hc *HttpContext) GetHeader(k string) string
GetHeader get header
func (*HttpContext) GetLocalReplyBody ¶
func (hc *HttpContext) GetLocalReplyBody() []byte
func (*HttpContext) GetMethod ¶
func (hc *HttpContext) GetMethod() string
GetMethod get method, POST/GET ...
func (*HttpContext) GetRouteEntry ¶
func (hc *HttpContext) GetRouteEntry() *model.RouteAction
GetRouteEntry get route
func (*HttpContext) GetStatusCode ¶
func (hc *HttpContext) GetStatusCode() int
func (*HttpContext) LocalReply ¶
func (hc *HttpContext) LocalReply() bool
func (*HttpContext) Next
deprecated
func (hc *HttpContext) Next()
Deprecated: Next logic for lookup filter
func (*HttpContext) RouteEntry ¶
func (hc *HttpContext) RouteEntry(r *model.RouteAction)
RouteEntry set route
func (*HttpContext) SendLocalReply ¶
func (hc *HttpContext) SendLocalReply(status int, body []byte)
SendLocalReply Means that the request was interrupted and Response will be sent directly Even if it’s currently in to Decode stage
func (*HttpContext) SetUrl ¶
func (hc *HttpContext) SetUrl(url string)
func (*HttpContext) StatusCode ¶
func (hc *HttpContext) StatusCode(code int)
Click to show internal directories.
Click to hide internal directories.