Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseContext ¶
type BaseContext struct {
Context
Index int8
Filters FilterChain
Timeout time.Duration
Ctx context.Context
// the response context will return.
TargetResp *client.Response
// client call response.
SourceResp interface{}
// happen error
Err error
}
BaseContext
func (*BaseContext) Abort ¶
func (c *BaseContext) Abort()
Abort filter chain break , filter after the current filter will not executed.
func (*BaseContext) AbortWithError ¶
func (c *BaseContext) AbortWithError(message string, err error)
AbortWithError filter chain break , filter after the current filter will not executed. And log will print.
func (*BaseContext) AppendFilterFunc ¶
func (c *BaseContext) AppendFilterFunc(ff ...FilterFunc)
AppendFilterFunc append filter func.
func (*BaseContext) Next ¶
func (c *BaseContext) Next()
Next should be used only inside middleware. It executes the pending handlers in the chain inside the calling handler. See example in GitHub.
type Context ¶
type Context interface {
Next()
Abort()
AbortWithError(string, error)
AppendFilterFunc(ff ...FilterFunc)
Status(code int)
StatusCode() int
WriteWithStatus(int, []byte) (int, error)
Write([]byte) (int, error)
AddHeader(k, v string)
GetHeader(k string) string
GetUrl() string
GetMethod() string
BuildFilters()
API(router.API)
GetAPI() *router.API
Api(api *model.Api)
GetApi() *model.Api
GetClientIP() string
GetApplicationName() string
WriteErr(p interface{})
}
Context run context
Click to show internal directories.
Click to hide internal directories.