Documentation ¶
Index ¶
- func GraceMiddleware(ctx *Context)
- func NoRouteHandler(ctx *Context)
- func RecordMiddleware(ctx *Context)
- func ResponseMiddleware(ctx *Context)
- type APISIXFlow
- func (flow *APISIXFlow) GetConsumerGroupID() string
- func (flow *APISIXFlow) GetConsumerName() string
- func (flow *APISIXFlow) GetRequestID() string
- func (flow *APISIXFlow) Initiate(ctx *Context)
- func (flow *APISIXFlow) IsAnonymousRequest() bool
- func (flow *APISIXFlow) IsAuthenticatedRequest() bool
- func (flow *APISIXFlow) IsClientRequest() bool
- func (flow *APISIXFlow) IsExternalRequest() bool
- func (flow *APISIXFlow) IsInternalRequest() bool
- func (flow *APISIXFlow) IsMonitorRequest() bool
- func (flow *APISIXFlow) IsServiceRequest() bool
- func (flow *APISIXFlow) IsUserRequest() bool
- type BaseFlow
- type CORSConfig
- type Context
- type Engine
- type Flow
- type GraceMiddlewareFlow
- type Handler
- type JSONResponse
- type JSONResponseBaseData
- type JSONResponseMeta
- type JSONResponseOptions
- type JSONResponsePageData
- type JSONResponsePageMeta
- type KongFlow
- func (flow *KongFlow) GetConsumerCustomID() string
- func (flow *KongFlow) GetConsumerGroups() []string
- func (flow *KongFlow) GetRequestID() string
- func (flow *KongFlow) Initiate(ctx *Context)
- func (flow *KongFlow) IsAnonymousRequest() bool
- func (flow *KongFlow) IsAuthenticatedRequest() bool
- func (flow *KongFlow) IsClientRequest() bool
- func (flow *KongFlow) IsExternalRequest() bool
- func (flow *KongFlow) IsInternalRequest() bool
- func (flow *KongFlow) IsMonitorRequest() bool
- func (flow *KongFlow) IsServiceRequest() bool
- func (flow *KongFlow) IsUserRequest() bool
- type MetaMessage
- type MiddlewareFlow
- type RESTFlow
- func (flow *RESTFlow) BindBody(value any)
- func (flow *RESTFlow) BindHeaders(value any)
- func (flow *RESTFlow) BindParams(value any)
- func (flow *RESTFlow) BindQueries(value any)
- func (flow *RESTFlow) ContainBody() bool
- func (flow *RESTFlow) ContainData() bool
- func (flow *RESTFlow) ContainHeaders() bool
- func (flow *RESTFlow) ContainParams() bool
- func (flow *RESTFlow) ContainQueries() bool
- func (flow *RESTFlow) GetBody() io.ReadCloser
- func (flow *RESTFlow) GetContext() *Context
- func (flow *RESTFlow) GetHeader(key string) string
- func (flow *RESTFlow) GetHeaderValues() http.Header
- func (flow *RESTFlow) GetMethod() string
- func (flow *RESTFlow) GetParam(key string) string
- func (flow *RESTFlow) GetQuery(key string) string
- func (flow *RESTFlow) GetQueryFallback(key, fallback string) string
- func (flow *RESTFlow) GetQueryMap(key string) map[string]string
- func (flow *RESTFlow) GetQuerySlice(key string) []string
- func (flow *RESTFlow) GetQueryValues() url.Values
- func (flow *RESTFlow) GetRequest() *http.Request
- func (flow *RESTFlow) GetRequestIP() string
- func (flow *RESTFlow) GetRequestURI() string
- func (flow *RESTFlow) GetWriter() ResponseWriter
- func (flow *RESTFlow) Inherit(fore Flow)
- func (flow *RESTFlow) Initiate(context *Context)
- func (flow *RESTFlow) IsDeleteMethod() bool
- func (flow *RESTFlow) IsGetMethod() bool
- func (flow *RESTFlow) IsHeadMethod() bool
- func (flow *RESTFlow) IsOptionsMethod() bool
- func (flow *RESTFlow) IsPatchMethod() bool
- func (flow *RESTFlow) IsPostMethod() bool
- func (flow *RESTFlow) IsPutMethod() bool
- func (flow *RESTFlow) IsTraceMethod() bool
- func (flow *RESTFlow) RequireBody() any
- func (flow *RESTFlow) RequireData() []byte
- func (flow *RESTFlow) RequireHeaders() any
- func (flow *RESTFlow) RequireParams() any
- func (flow *RESTFlow) RequireQueries() any
- func (flow *RESTFlow) RespondFile(path string)
- func (flow *RESTFlow) RespondJSON(message *MetaMessage, data any, options *JSONResponseOptions)
- func (flow *RESTFlow) SetError(err error)
- func (flow *RESTFlow) SetHeader(key, value string)
- func (flow *RESTFlow) SetNotFoundError()
- type RecordMiddlewareFlow
- type ResponseMiddlewareFlow
- type ResponseWriter
- type Router
- type RouterGroup
- type RouterLeaf
- type RouterStem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GraceMiddleware ¶
func GraceMiddleware(ctx *Context)
func NoRouteHandler ¶
func NoRouteHandler(ctx *Context)
func RecordMiddleware ¶
func RecordMiddleware(ctx *Context)
func ResponseMiddleware ¶
func ResponseMiddleware(ctx *Context)
Types ¶
type APISIXFlow ¶
type APISIXFlow struct {
RESTFlow
}
func (*APISIXFlow) GetConsumerGroupID ¶
func (flow *APISIXFlow) GetConsumerGroupID() string
func (*APISIXFlow) GetConsumerName ¶
func (flow *APISIXFlow) GetConsumerName() string
func (*APISIXFlow) GetRequestID ¶
func (flow *APISIXFlow) GetRequestID() string
func (*APISIXFlow) Initiate ¶
func (flow *APISIXFlow) Initiate(ctx *Context)
func (*APISIXFlow) IsAnonymousRequest ¶
func (flow *APISIXFlow) IsAnonymousRequest() bool
func (*APISIXFlow) IsAuthenticatedRequest ¶
func (flow *APISIXFlow) IsAuthenticatedRequest() bool
func (*APISIXFlow) IsClientRequest ¶
func (flow *APISIXFlow) IsClientRequest() bool
func (*APISIXFlow) IsExternalRequest ¶
func (flow *APISIXFlow) IsExternalRequest() bool
func (*APISIXFlow) IsInternalRequest ¶
func (flow *APISIXFlow) IsInternalRequest() bool
func (*APISIXFlow) IsMonitorRequest ¶
func (flow *APISIXFlow) IsMonitorRequest() bool
func (*APISIXFlow) IsServiceRequest ¶
func (flow *APISIXFlow) IsServiceRequest() bool
func (*APISIXFlow) IsUserRequest ¶
func (flow *APISIXFlow) IsUserRequest() bool
type CORSConfig ¶
type GraceMiddlewareFlow ¶
type GraceMiddlewareFlow struct {
MiddlewareFlow
}
func (*GraceMiddlewareFlow) NextFlow ¶
func (flow *GraceMiddlewareFlow) NextFlow()
type Handler ¶
type Handler = gin.HandlerFunc
type JSONResponse ¶
func NewJSONResponse ¶
func NewJSONResponse(message *MetaMessage, data any, options *JSONResponseOptions) *JSONResponse
type JSONResponseBaseData ¶
type JSONResponseBaseData = xbdata.JSONResponseBaseData
type JSONResponseMeta ¶
type JSONResponseMeta = xbdata.JSONResponseMeta
type JSONResponseOptions ¶
type JSONResponseOptions struct { HTTPCode *int MetaArgs []any PageData *JSONResponsePageData }
type JSONResponsePageData ¶
type JSONResponsePageData = xbdata.JSONResponsePageData
type JSONResponsePageMeta ¶
type JSONResponsePageMeta = xbdata.JSONResponsePageMeta
type KongFlow ¶
type KongFlow struct {
RESTFlow
}
func (*KongFlow) GetConsumerCustomID ¶
func (*KongFlow) GetConsumerGroups ¶
func (*KongFlow) GetRequestID ¶
func (*KongFlow) IsAnonymousRequest ¶
func (*KongFlow) IsAuthenticatedRequest ¶
func (*KongFlow) IsClientRequest ¶
func (*KongFlow) IsExternalRequest ¶
func (*KongFlow) IsInternalRequest ¶
func (*KongFlow) IsMonitorRequest ¶
func (*KongFlow) IsServiceRequest ¶
func (*KongFlow) IsUserRequest ¶
type MetaMessage ¶
type MetaMessage = xbmtmsg.MetaMessage
type MiddlewareFlow ¶
type MiddlewareFlow struct {
RESTFlow
}
func (*MiddlewareFlow) NextFlow ¶
func (flow *MiddlewareFlow) NextFlow()
type RESTFlow ¶
type RESTFlow struct { BaseFlow // contains filtered or unexported fields }
func (*RESTFlow) BindHeaders ¶
func (*RESTFlow) BindParams ¶
func (*RESTFlow) BindQueries ¶
func (*RESTFlow) ContainBody ¶
func (*RESTFlow) ContainData ¶
func (*RESTFlow) ContainHeaders ¶
func (*RESTFlow) ContainParams ¶
func (*RESTFlow) ContainQueries ¶
func (*RESTFlow) GetBody ¶
func (flow *RESTFlow) GetBody() io.ReadCloser
func (*RESTFlow) GetContext ¶
func (*RESTFlow) GetHeaderValues ¶
func (*RESTFlow) GetQueryFallback ¶
func (*RESTFlow) GetQuerySlice ¶
func (*RESTFlow) GetQueryValues ¶
func (*RESTFlow) GetRequest ¶
func (*RESTFlow) GetRequestIP ¶
func (*RESTFlow) GetRequestURI ¶
func (*RESTFlow) GetWriter ¶
func (flow *RESTFlow) GetWriter() ResponseWriter
func (*RESTFlow) IsDeleteMethod ¶
func (*RESTFlow) IsGetMethod ¶
func (*RESTFlow) IsHeadMethod ¶
func (*RESTFlow) IsOptionsMethod ¶
func (*RESTFlow) IsPatchMethod ¶
func (*RESTFlow) IsPostMethod ¶
func (*RESTFlow) IsPutMethod ¶
func (*RESTFlow) IsTraceMethod ¶
func (*RESTFlow) RequireBody ¶
func (*RESTFlow) RequireData ¶
func (*RESTFlow) RequireHeaders ¶
func (*RESTFlow) RequireParams ¶
func (*RESTFlow) RequireQueries ¶
func (*RESTFlow) RespondFile ¶
func (*RESTFlow) RespondJSON ¶
func (flow *RESTFlow) RespondJSON(message *MetaMessage, data any, options *JSONResponseOptions)
func (*RESTFlow) SetNotFoundError ¶
func (flow *RESTFlow) SetNotFoundError()
type RecordMiddlewareFlow ¶
type RecordMiddlewareFlow struct { MiddlewareFlow // contains filtered or unexported fields }
func (*RecordMiddlewareFlow) Initiate ¶
func (flow *RecordMiddlewareFlow) Initiate(ctx *Context)
func (*RecordMiddlewareFlow) SetBodies ¶
func (flow *RecordMiddlewareFlow) SetBodies()
func (*RecordMiddlewareFlow) SetFields ¶
func (flow *RecordMiddlewareFlow) SetFields()
func (*RecordMiddlewareFlow) SetResult ¶
func (flow *RecordMiddlewareFlow) SetResult()
type ResponseMiddlewareFlow ¶
type ResponseMiddlewareFlow struct {
MiddlewareFlow
}
func (*ResponseMiddlewareFlow) SetResult ¶
func (flow *ResponseMiddlewareFlow) SetResult()
type ResponseWriter ¶
type ResponseWriter = gin.ResponseWriter
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) GetCORSConfig ¶
func (router *Router) GetCORSConfig() *CORSConfig
func (*Router) NewMiddlewares ¶
func (*Router) SetMiddlewares ¶
func (*Router) SetRouterGroup ¶
func (router *Router) SetRouterGroup(stems ...RouterStem)
func (*Router) UseMiddlewares ¶
func (router *Router) UseMiddlewares()
type RouterGroup ¶
type RouterGroup = gin.RouterGroup
type RouterLeaf ¶
type RouterStem ¶
type RouterStem struct { Path string Handlers []Handler Leaves []RouterLeaf Stems []RouterStem }
Click to show internal directories.
Click to hide internal directories.