Documentation
¶
Index ¶
- Constants
- func NewHandler(dispatcher http.Handler) http.Handler
- func NewHandlerFromMetadata(dispatcher http.Handler, view runtime.MetadataView) (http.Handler, error)
- func NewHandlerWithLimits(dispatcher http.Handler, limits Limits) http.Handler
- func WithDispatchLeaseFactory(r *http.Request, factory DispatchLeaseFactory) *http.Request
- type Config
- type DispatchLease
- type DispatchLeaseFactory
- type ErrorResponse
- type Limits
- type PipelineRequest
- type PipelineResponse
- type Plugin
- type QueryValues
- type Request
Constants ¶
const (
DefaultURI = "/apisix/batch-requests"
)
Variables ¶
This section is empty.
Functions ¶
func NewHandlerFromMetadata ¶
func NewHandlerWithLimits ¶
func WithDispatchLeaseFactory ¶
func WithDispatchLeaseFactory(r *http.Request, factory DispatchLeaseFactory) *http.Request
WithDispatchLeaseFactory attaches a generation-aware subrequest factory to the request context without exposing the context key to other packages.
Types ¶
type DispatchLease ¶
DispatchLease keeps a route generation alive while a batch subrequest is executing through the server request boundary.
type DispatchLeaseFactory ¶
type DispatchLeaseFactory func() (DispatchLease, bool)
DispatchLeaseFactory acquires a dispatch lease for one batch worker. The factory must increment the generation reference before returning and its lease release must be idempotent.
func DispatchLeaseFactoryFromRequest ¶
func DispatchLeaseFactoryFromRequest(r *http.Request) DispatchLeaseFactory
DispatchLeaseFactoryFromRequest returns the generation-aware subrequest factory attached by the server boundary, if any.
type ErrorResponse ¶
type ErrorResponse struct {
ErrorMessage string `json:"error_msg"`
}
type PipelineRequest ¶
type PipelineRequest struct {
Version float64 `json:"version,omitempty"`
Method string `json:"method,omitempty"`
Path string `json:"path"`
Query QueryValues `json:"query,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Body string `json:"body,omitempty"`
SSLVerify bool `json:"ssl_verify,omitempty"`
}
type PipelineResponse ¶
type Plugin ¶
type Plugin struct {
base.BasePlugin
// contains filtered or unexported fields
}
type QueryValues ¶
QueryValues retains repeated arguments while accepting APISIX's scalar string shorthand on the JSON boundary.
func (*QueryValues) UnmarshalJSON ¶
func (values *QueryValues) UnmarshalJSON(data []byte) error
type Request ¶
type Request struct {
Query QueryValues `json:"query,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Timeout *int `json:"timeout,omitempty"`
Pipeline []PipelineRequest `json:"pipeline"`
}