Documentation
¶
Index ¶
- func MaterializeScopedPluginSecrets(ctx context.Context, baseScope secret.Scope, ...) error
- func NewCompositeChildPreparer(dependencies base.Dependencies, generation uint64, scope Scope, ...) (base.CompositeChildPreparer, error)
- func SupportsScopedSecretMaterialization(factory string) (bool, error)
- func WrapBeforeProxyHooks(next http.RoundTripper) http.RoundTripper
- type BaseCommit
- type Binding
- func BindGenerationResolvedPlugin(generation uint64, descriptor Descriptor, p Plugin, scope Scope, ...) (Binding, error)
- func BindPluginChecked(factoryName string, p Plugin, scope Scope, provenance ResourceProvenance) (Binding, error)
- func BindResolvedPlugin(descriptor Descriptor, p Plugin, scope Scope, provenance ResourceProvenance, ...) (Binding, error)
- type BufferedResponseExecutor
- func (e *BufferedResponseExecutor) PostResolutionHook(r *http.Request, effective EffectiveBindingSet) (*http.Request, error)
- func (e *BufferedResponseExecutor) WithFinalResponseCommitter(committer FinalResponseCommitter) *BufferedResponseExecutor
- func (e *BufferedResponseExecutor) WithStreamingResponseExecutor(streaming *StreamingResponseExecutor) *BufferedResponseExecutor
- type CompressionOfferPlugin
- type CompressionSet
- type ConsumerBindingResolver
- type ConsumerCacheKey
- type ConsumerIdentity
- type ConsumerResolution
- type Definition
- type Descriptor
- type Domain
- type EffectiveBindingSet
- type EnabledSet
- type FactoryInstance
- type FinalResponseCommitter
- type FinalizerKind
- type GenerationOwnerKind
- type InstanceIdentityInput
- type InstanceKey
- type InstanceScope
- type LogBinding
- type LogExecutor
- func (e LogExecutor) Bindings() []LogBinding
- func (e LogExecutor) Prepare(r *http.Request) (*http.Request, error)
- func (e LogExecutor) RegisterComposite(r *http.Request) bool
- func (e LogExecutor) SealAndRegister(r *http.Request) error
- func (e LogExecutor) SealFinalRequest(r *http.Request) error
- func (e LogExecutor) WithBindings(bindings []LogBinding) (LogExecutor, error)
- type LogRequestState
- type PanicError
- type Phase
- type Plugin
- type PostResolutionHook
- type ProtocolKind
- type RequestPipeline
- func (p RequestPipeline) Then(terminal http.Handler) http.Handler
- func (p RequestPipeline) ThenWithPostResolutionHook(terminal http.Handler, hook PostResolutionHook) http.Handler
- func (p RequestPipeline) WithBeforeProxyHooksAtTransport() RequestPipeline
- func (p RequestPipeline) WithBufferedResponseExecutor(executor *BufferedResponseExecutor) RequestPipeline
- func (p RequestPipeline) WithLogExecutor(executor *LogExecutor) RequestPipeline
- func (p RequestPipeline) WithStreamingResponseExecutor(executor *StreamingResponseExecutor) RequestPipeline
- type RequestStage
- type ResolvedResponsePhases
- type ResourceKind
- type ResourceProvenance
- type ResponseBinding
- type ResponseCapability
- type ResponseCapabilityDescriber
- type ResponseCapabilityPlugin
- type ResponseOwnerKind
- type ResponsePhaseMask
- type ResponsePlan
- func (p ResponsePlan) BufferedBindings() []ResponseBinding
- func (p ResponsePlan) BufferedConfig() base.BufferedResponseConfig
- func (p ResponsePlan) Install(pipeline RequestPipeline, terminal http.Handler) http.Handler
- func (p ResponsePlan) Materialize(effective EffectiveBindingSet) (ResponsePlan, error)
- func (p ResponsePlan) PostResolutionHook(r *http.Request, effective EffectiveBindingSet) (*http.Request, error)
- func (p ResponsePlan) RouteTerminals() []RouteTerminalCandidate
- func (p ResponsePlan) StaticBindings() []Binding
- func (p ResponsePlan) StreamingBindings() []Binding
- type ResponsePlanInput
- type RouteTerminalCandidate
- type SchemaWitness
- type Scope
- type ScopedSecretAccess
- type ScopedSecretMaterializer
- type StreamingResponseExecutor
- func (e *StreamingResponseExecutor) Bindings() []Binding
- func (e *StreamingResponseExecutor) CommitResponse(w http.ResponseWriter, r *http.Request, state *base.ResponseState, ...) error
- func (e *StreamingResponseExecutor) PostResolutionHook(r *http.Request, effective EffectiveBindingSet) (*http.Request, error)
- func (e *StreamingResponseExecutor) RunExclusiveProtocol(w http.ResponseWriter, r *http.Request, next http.Handler) (*http.Request, base.ProtocolDisposition, error)
- func (e *StreamingResponseExecutor) Then(next http.Handler) http.Handler
- func (e *StreamingResponseExecutor) WithRouteTerminals(terminals []RouteTerminalCandidate) (*StreamingResponseExecutor, error)
- type TerminalDescriptor
- type TerminalOwner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompositeChildPreparer ¶
func NewCompositeChildPreparer( dependencies base.Dependencies, generation uint64, scope Scope, provenance ResourceProvenance, ) (base.CompositeChildPreparer, error)
func SupportsScopedSecretMaterialization ¶
SupportsScopedSecretMaterialization reports whether the registered factory implements the generation-scoped secret contract. The factory is constructed only for a type assertion; no plugin lifecycle or materialization method is invoked.
func WrapBeforeProxyHooks ¶
func WrapBeforeProxyHooks(next http.RoundTripper) http.RoundTripper
WrapBeforeProxyHooks runs registered hooks after ReverseProxy's Director and immediately before the actual upstream RoundTripper. Hook errors are returned to ReverseProxy so its existing ErrorHandler owns the response.
Types ¶
type BaseCommit ¶
type BaseCommit func(http.ResponseWriter, *base.ResponseState)
type Binding ¶
type Binding struct {
Plugin Plugin
Descriptor Descriptor
Priority int
Scope Scope
Provenance ResourceProvenance
InstanceKey InstanceKey
// contains filtered or unexported fields
}
Binding is the immutable executor input for one materialized plugin.
func BindGenerationResolvedPlugin ¶
func BindGenerationResolvedPlugin( generation uint64, descriptor Descriptor, p Plugin, scope Scope, provenance ResourceProvenance, identity InstanceIdentityInput, ) (Binding, error)
BindGenerationResolvedPlugin constructs a generation-owned binding.
func BindPluginChecked ¶
func BindPluginChecked( factoryName string, p Plugin, scope Scope, provenance ResourceProvenance, ) (Binding, error)
BindPluginChecked is the strict production constructor. It records the exact factory key and writes any config-derived request stage into the immutable Binding before it can enter a pipeline.
func BindResolvedPlugin ¶
func BindResolvedPlugin( descriptor Descriptor, p Plugin, scope Scope, provenance ResourceProvenance, identity InstanceIdentityInput, ) (Binding, error)
BindResolvedPlugin constructs a binding from the descriptor resolved once during plugin materialization. Wrappers may preserve callbacks, but cannot re-read config to change the immutable phase selection.
type BufferedResponseExecutor ¶
type BufferedResponseExecutor struct {
// contains filtered or unexported fields
}
func NewBufferedResponseExecutor ¶
func NewBufferedResponseExecutor( static []Binding, terminal TerminalDescriptor, config base.BufferedResponseConfig, ) (*BufferedResponseExecutor, error)
func (*BufferedResponseExecutor) PostResolutionHook ¶
func (e *BufferedResponseExecutor) PostResolutionHook( r *http.Request, effective EffectiveBindingSet, ) (*http.Request, error)
func (*BufferedResponseExecutor) WithFinalResponseCommitter ¶
func (e *BufferedResponseExecutor) WithFinalResponseCommitter( committer FinalResponseCommitter, ) *BufferedResponseExecutor
func (*BufferedResponseExecutor) WithStreamingResponseExecutor ¶
func (e *BufferedResponseExecutor) WithStreamingResponseExecutor( streaming *StreamingResponseExecutor, ) *BufferedResponseExecutor
type CompressionOfferPlugin ¶
type CompressionOfferPlugin interface {
RegisterCompressionOffers(*http.Request, *compression.State) []compression.Offer
WrapCompression(
http.ResponseWriter,
*http.Request,
*compression.State,
compression.Decision,
) (http.ResponseWriter, error)
}
CompressionOfferPlugin is the root-owned structural contract. It keeps the complete Offer/State/Decision values from shared negotiation.
type CompressionSet ¶
type CompressionSet uint8
const ( CompressionOfferGzip CompressionSet = 1 << iota CompressionOfferDeflate CompressionOfferBrotli )
type ConsumerBindingResolver ¶
type ConsumerBindingResolver func(*http.Request) (ConsumerResolution, error)
type ConsumerCacheKey ¶
type ConsumerIdentity ¶
type ConsumerResolution ¶
type ConsumerResolution struct {
Bindings []Binding
OverrideFactories []string
Request *http.Request
CacheKey ConsumerCacheKey
Identity ConsumerIdentity
Resolved bool
}
type Definition ¶
type Definition struct {
Factory string
Domain Domain
Phases []Phase
Scopes []Scope
InstanceScope InstanceScope
PreAuthentication bool
PreferRoute bool
ConditionalTerminal bool
}
Definition is the immutable execution metadata for one implemented plugin factory.
func DefinitionForFactory ¶
func DefinitionForFactory(factory string) (Definition, bool)
DefinitionForFactory returns the execution metadata for one implemented factory.
func Definitions ¶
func Definitions() []Definition
Definitions returns all implemented plugin factories in stable order.
type Descriptor ¶
type Descriptor struct {
Factory string
Implementation string
Phases []Phase
Priority int
Scopes []Scope
InstanceScope InstanceScope
// contains filtered or unexported fields
}
Descriptor is the immutable runtime view of one registered plugin factory. ResolveDescriptor adds facts owned by the initialized plugin and may narrow phases for one initialized config.
func DescriptorForFactory ¶
func DescriptorForFactory(factory string) (Descriptor, error)
func ResolveDescriptor ¶
func ResolveDescriptor(descriptor Descriptor, p Plugin) (Descriptor, error)
ResolveDescriptor resolves config-aware phase selection once, while a binding is constructed. It never permits config to add a phase absent from the registry.
func ResolveDescriptorForFactory ¶
func ResolveDescriptorForFactory(factory string, p Plugin) (Descriptor, error)
ResolveDescriptorForFactory resolves one initialized plugin for compiler-owned materialization.
func (Descriptor) HasPhase ¶
func (d Descriptor) HasPhase(phase Phase) bool
func (Descriptor) HasResponseOwner ¶
func (d Descriptor) HasResponseOwner(owner ResponseOwnerKind) bool
func (Descriptor) OwnsSnapshotFinalizer ¶
func (d Descriptor) OwnsSnapshotFinalizer() bool
func (Descriptor) RequestStage ¶
func (d Descriptor) RequestStage() RequestStage
func (Descriptor) ResponseCapability ¶
func (d Descriptor) ResponseCapability() ResponseCapability
type EffectiveBindingSet ¶
type EffectiveBindingSet struct {
// contains filtered or unexported fields
}
EffectiveBindingSet keeps the two Plan 14 partitions separate so response materialization can execute global/system winners before route/consumer winners without reconstructing them after the terminal returns.
type EnabledSet ¶
type EnabledSet struct {
// contains filtered or unexported fields
}
EnabledSet is the immutable membership snapshot used by a route build.
func NewEnabledSet ¶
func NewEnabledSet(names []string) EnabledSet
NewEnabledSet clones names into a membership set.
func (EnabledSet) Contains ¶
func (s EnabledSet) Contains(name string) bool
Contains reports whether name is enabled in the set.
type FactoryInstance ¶
type FactoryInstance struct {
// contains filtered or unexported fields
}
FactoryInstance binds a plugin instance to the exact registry key that constructed it. Its fields are intentionally private so callers cannot relabel one registered factory as another factory with the same Go type.
func NewFactoryInstance ¶
func NewFactoryInstance(factory string, deps base.Dependencies) (FactoryInstance, error)
NewFactoryInstance constructs a plugin while retaining its exact registry identity. Plugin lifecycle methods are not invoked.
func (FactoryInstance) Factory ¶
func (instance FactoryInstance) Factory() string
func (FactoryInstance) Plugin ¶
func (instance FactoryInstance) Plugin() Plugin
type FinalResponseCommitter ¶
type FinalResponseCommitter interface {
CommitFinalResponse(http.ResponseWriter, *http.Request, *base.ResponseState, BaseCommit)
}
type FinalizerKind ¶
type FinalizerKind uint8
const ( FinalizerNone FinalizerKind = iota FinalizerSnapshot FinalizerDynamic )
type GenerationOwnerKind ¶
type GenerationOwnerKind uint8
const ( GenerationOwnerNone GenerationOwnerKind = iota GenerationOwnerProcess GenerationOwnerRoute )
type InstanceIdentityInput ¶
type InstanceIdentityInput struct {
PluginConfig any `json:"plugin_config"`
Filter any `json:"filter,omitempty"`
ErrorResponse any `json:"error_response,omitempty"`
CompositePosition string `json:"composite_position,omitempty"`
}
InstanceIdentityInput contains only configuration that changes the behavior of one materialized plugin instance. Ordering-only and enablement metadata deliberately remain outside the identity.
type InstanceKey ¶
type InstanceKey struct {
Factory string
Generation uint64
Scope Scope
Owner ResourceProvenance
ConfigDigest [32]byte
}
func NewGenerationInstanceKey ¶
func NewGenerationInstanceKey( generation uint64, descriptor Descriptor, scope Scope, owner ResourceProvenance, identity InstanceIdentityInput, ) (InstanceKey, error)
func NewInstanceKey ¶
func NewInstanceKey( descriptor Descriptor, scope Scope, owner ResourceProvenance, identity InstanceIdentityInput, ) (InstanceKey, error)
func (InstanceKey) String ¶
func (k InstanceKey) String() string
type InstanceScope ¶
type InstanceScope string
const ( InstancePerRoute InstanceScope = "route" InstancePerService InstanceScope = "service" InstancePerConsumer InstanceScope = "consumer" InstancePerGlobalRule InstanceScope = "global_rule" InstanceEffectiveConfig InstanceScope = "effective-config" )
type LogBinding ¶
type LogBinding struct {
Factory string
Plugin Plugin
Priority int
Scope Scope
Provenance ResourceProvenance
Policy base.LogCapturePolicy
// contains filtered or unexported fields
}
type LogExecutor ¶
type LogExecutor struct {
// contains filtered or unexported fields
}
func NewLogExecutor ¶
func NewLogExecutor(bindings []LogBinding) (LogExecutor, error)
func NewLogExecutorFromBindings ¶
func NewLogExecutorFromBindings(bindings []Binding) (LogExecutor, error)
NewLogExecutorFromBindings selects explicit sanitizer, log, and snapshot- finalizer owners from one materialized binding set. Dynamic finalizers register their own lifecycle callbacks and never enter this executor.
func (LogExecutor) Bindings ¶
func (e LogExecutor) Bindings() []LogBinding
func (LogExecutor) RegisterComposite ¶
func (e LogExecutor) RegisterComposite(r *http.Request) bool
func (LogExecutor) SealAndRegister ¶
func (e LogExecutor) SealAndRegister(r *http.Request) error
func (LogExecutor) SealFinalRequest ¶
func (e LogExecutor) SealFinalRequest(r *http.Request) error
func (LogExecutor) WithBindings ¶
func (e LogExecutor) WithBindings(bindings []LogBinding) (LogExecutor, error)
WithBindings returns a value copy with per-request materialized bindings. Route integration can construct the static executor before authentication, then replace this binding set after consumer/group resolution without mutating the published generation executor.
type LogRequestState ¶
type LogRequestState struct {
// contains filtered or unexported fields
}
type PanicError ¶
PanicError attributes a recovered panic to one explicit plugin callback. Value is retained for internal classification; Error deliberately exposes only bounded descriptor metadata.
func (*PanicError) Error ¶
func (e *PanicError) Error() string
type Phase ¶
type Phase string
Phase is one APISIX plugin execution phase.
const ( PhaseRewrite Phase = "rewrite" PhaseConsumerRewrite Phase = "consumer_rewrite" PhaseAccess Phase = "access" PhaseBeforeProxy Phase = "before_proxy" PhaseHeaderFilter Phase = "header_filter" PhaseBodyFilter Phase = "body_filter" PhaseLog Phase = "log" PhaseFinalizer Phase = "finalizer" PhaseProtocol Phase = "protocol" )
type Plugin ¶
type PostResolutionHook ¶
type ProtocolKind ¶
type ProtocolKind string
const ( ProtocolNone ProtocolKind = "" ProtocolAI ProtocolKind = "ai" ProtocolGRPCWeb ProtocolKind = "grpc-web" ProtocolKafka ProtocolKind = "kafka" ProtocolDubbo ProtocolKind = "dubbo" ProtocolHTTPDubbo ProtocolKind = "http-dubbo" ProtocolMQTT ProtocolKind = "mqtt" )
type RequestPipeline ¶
type RequestPipeline struct {
// contains filtered or unexported fields
}
RequestPipeline owns the explicit Plan 14 request order. Static bindings are cloned at construction; resolution data is merged per request so no mutable request, auth, or override state can leak between requests.
func NewRequestPipeline ¶
func NewRequestPipeline(bindings []Binding, resolve ConsumerBindingResolver) RequestPipeline
func (RequestPipeline) ThenWithPostResolutionHook ¶
func (p RequestPipeline) ThenWithPostResolutionHook( terminal http.Handler, hook PostResolutionHook, ) http.Handler
ThenWithPostResolutionHook inserts one hook after consumer/group winners are merged and before any later request stage or terminal runs.
func (RequestPipeline) WithBeforeProxyHooksAtTransport ¶
func (p RequestPipeline) WithBeforeProxyHooksAtTransport() RequestPipeline
WithBeforeProxyHooksAtTransport defers registered before-proxy hooks to a transport installed with WrapBeforeProxyHooks. The ordinary prepared HTTP proxy uses this seam so ReverseProxy's Director can materialize the selected upstream and pass_host before the hook observes the request.
func (RequestPipeline) WithBufferedResponseExecutor ¶
func (p RequestPipeline) WithBufferedResponseExecutor( executor *BufferedResponseExecutor, ) RequestPipeline
WithBufferedResponseExecutor returns a value copy that owns one immutable response executor reference. Request-local capture state is created by Then, never stored on the pipeline itself.
func (RequestPipeline) WithLogExecutor ¶
func (p RequestPipeline) WithLogExecutor(executor *LogExecutor) RequestPipeline
func (RequestPipeline) WithStreamingResponseExecutor ¶
func (p RequestPipeline) WithStreamingResponseExecutor( executor *StreamingResponseExecutor, ) RequestPipeline
type RequestStage ¶
type RequestStage uint8
RequestStage identifies the request-stage owner for a plugin binding.
const ( RequestStageNone RequestStage = iota RequestStageRewrite RequestStageConsumerRewrite RequestStageAccess RequestStageBeforeProxy )
type ResolvedResponsePhases ¶
type ResolvedResponsePhases struct {
Owners []ResponseOwnerKind
CompressionOffers CompressionSet
ExclusiveProtocol ProtocolKind
}
type ResourceKind ¶
type ResourceKind string
ResourceKind identifies the source resource that materialized a binding.
const ( ResourceSystem ResourceKind = "system" ResourceGlobalRule ResourceKind = "global_rule" ResourceRoute ResourceKind = "route" ResourceService ResourceKind = "service" ResourcePluginConfig ResourceKind = "plugin_config" ResourceConsumer ResourceKind = "consumer" ResourceConsumerGroup ResourceKind = "consumer_group" )
const ResourceUpstream ResourceKind = "upstream"
type ResourceProvenance ¶
type ResourceProvenance struct {
Kind ResourceKind
ID string
}
ResourceProvenance is kept by value so diagnostics cannot lose the source identity while route/plugin configuration maps are merged.
type ResponseBinding ¶
type ResponseBinding struct {
Plugin Plugin
Descriptor Descriptor
Scope Scope
Provenance ResourceProvenance
Phases ResponsePhaseMask
// contains filtered or unexported fields
}
func MaterializeResponseBindings ¶
func MaterializeResponseBindings(effective EffectiveBindingSet) ([]ResponseBinding, error)
type ResponseCapability ¶
type ResponseCapability struct {
HeaderFilter bool
BufferedBodyFilter bool
StreamingBodyFilter bool
StreamingResponseOwner bool
CompressionOffer bool
ExclusiveProtocol ProtocolKind
SeparateSubsystem bool
}
ResponseCapability is the build-time structural declaration for response callbacks within phases allowed by the plugin registry.
func ResponseCapabilityFor ¶
func ResponseCapabilityFor(factory string) (ResponseCapability, bool)
type ResponseCapabilityDescriber ¶
type ResponseCapabilityDescriber interface {
DescribeResponseCapability() (ResponseCapability, error)
}
type ResponseCapabilityPlugin ¶
type ResponseCapabilityPlugin interface {
ResponseCapability() ResponseCapability
}
type ResponseOwnerKind ¶
type ResponseOwnerKind uint8
const ( ResponseOwnerNone ResponseOwnerKind = iota ResponseOwnerHeaderFilter ResponseOwnerBufferedBodyFilter ResponseOwnerFinalStore ResponseOwnerStreamingHeaderFilter ResponseOwnerStreamingBodyFilter ResponseOwnerCompressionOffer ResponseOwnerStreamingProducer ResponseOwnerExclusiveProtocol ResponseOwnerSeparateSubsystemProtocol )
type ResponsePhaseMask ¶
type ResponsePhaseMask uint8
const ( ResponsePhaseHeader ResponsePhaseMask = 1 << iota ResponsePhaseBufferedBody ResponsePhaseFinalStore )
type ResponsePlan ¶
type ResponsePlan struct {
// contains filtered or unexported fields
}
ResponsePlan is an immutable generation recipe. Slices are private and every accessor returns a copy; request-local dynamic materialization never mutates the published generation.
func BuildResponsePlan ¶
func BuildResponsePlan(input any) (ResponsePlan, error)
BuildResponsePlan validates and freezes the response ownership recipe. The any input accepts the original []Binding prototype as well as the explicit Plan 16 input, allowing existing callers to migrate without a second plan constructor.
func (ResponsePlan) BufferedBindings ¶
func (p ResponsePlan) BufferedBindings() []ResponseBinding
func (ResponsePlan) BufferedConfig ¶
func (p ResponsePlan) BufferedConfig() base.BufferedResponseConfig
func (ResponsePlan) Install ¶
func (p ResponsePlan) Install(pipeline RequestPipeline, terminal http.Handler) http.Handler
func (ResponsePlan) Materialize ¶
func (p ResponsePlan) Materialize(effective EffectiveBindingSet) (ResponsePlan, error)
Materialize resolves a request-local effective binding set while retaining the generation's route-owned streaming and terminal declarations.
func (ResponsePlan) PostResolutionHook ¶
func (p ResponsePlan) PostResolutionHook(r *http.Request, effective EffectiveBindingSet) (*http.Request, error)
PostResolutionHook performs the immutable per-request compatibility check. The request itself is returned unchanged; execution state remains owned by RequestPipeline/BufferedResponseExecutor.
func (ResponsePlan) RouteTerminals ¶
func (p ResponsePlan) RouteTerminals() []RouteTerminalCandidate
func (ResponsePlan) StaticBindings ¶
func (p ResponsePlan) StaticBindings() []Binding
func (ResponsePlan) StreamingBindings ¶
func (p ResponsePlan) StreamingBindings() []Binding
type ResponsePlanInput ¶
type ResponsePlanInput struct {
StaticBindings []Binding
RouteTerminals []RouteTerminalCandidate
BufferedConfig base.BufferedResponseConfig
}
type RouteTerminalCandidate ¶
type RouteTerminalCandidate struct {
Identity string
Scope Scope
Priority int
Provenance ResourceProvenance
Protocol ProtocolKind
Terminal base.ExclusiveProtocolTerminal
}
type SchemaWitness ¶
SchemaWitness exposes only the immutable schema facts owned by one generated plugin factory. Consumer validation remains owned by the consumer package.
func SchemaWitnessForFactory ¶
func SchemaWitnessForFactory(factory string) (SchemaWitness, error)
SchemaWitnessForFactory initializes the registered factory only far enough to expose its schemas. It deliberately bypasses New so runtime dependencies are never installed and no post-initialization lifecycle can run.
type ScopedSecretAccess ¶
type ScopedSecretAccess = base.ScopedSecretAccess
type ScopedSecretMaterializer ¶
type ScopedSecretMaterializer = base.ScopedSecretMaterializer
type StreamingResponseExecutor ¶
type StreamingResponseExecutor struct {
// contains filtered or unexported fields
}
StreamingResponseExecutor owns streaming header filters, body wrappers and the optional exclusive protocol owner for one generation. It is immutable; all per-request state lives in the returned handler/writer chain.
func NewStreamingResponseExecutor ¶
func NewStreamingResponseExecutor(bindings []Binding) (*StreamingResponseExecutor, error)
func (*StreamingResponseExecutor) Bindings ¶
func (e *StreamingResponseExecutor) Bindings() []Binding
func (*StreamingResponseExecutor) CommitResponse ¶
func (e *StreamingResponseExecutor) CommitResponse( w http.ResponseWriter, r *http.Request, state *base.ResponseState, commit BaseCommit, ) error
CommitResponse composes Plan 16 header/body adapters after bounded Plan 15 transformations and stores have produced the final canonical state.
func (*StreamingResponseExecutor) PostResolutionHook ¶
func (e *StreamingResponseExecutor) PostResolutionHook( r *http.Request, effective EffectiveBindingSet, ) (*http.Request, error)
func (*StreamingResponseExecutor) RunExclusiveProtocol ¶
func (e *StreamingResponseExecutor) RunExclusiveProtocol( w http.ResponseWriter, r *http.Request, next http.Handler, ) (*http.Request, base.ProtocolDisposition, error)
func (*StreamingResponseExecutor) Then ¶
func (e *StreamingResponseExecutor) Then(next http.Handler) http.Handler
Then installs streaming wrappers around the normal upstream continuation. Exclusive protocol owners run exactly once before that continuation.
func (*StreamingResponseExecutor) WithRouteTerminals ¶
func (e *StreamingResponseExecutor) WithRouteTerminals( terminals []RouteTerminalCandidate, ) (*StreamingResponseExecutor, error)
type TerminalDescriptor ¶
type TerminalDescriptor struct {
Owner TerminalOwner
Provenance ResourceProvenance
}
type TerminalOwner ¶
type TerminalOwner uint8
const ( TerminalOwnerOrdinaryProxy TerminalOwner = iota TerminalOwnerGlobalNotFound TerminalOwnerAIRuntime TerminalOwnerKafka TerminalOwnerDubbo TerminalOwnerHTTPDubbo )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ai_common holds stateless helpers shared by the AI proxy plugins.
|
Package ai_common holds stateless helpers shared by the AI proxy plugins. |
|
Package chash implements the consistent-hash ring used by APISIX HTTP upstream owners.
|
Package chash implements the consistent-hash ring used by APISIX HTTP upstream owners. |
|
Package compression coordinates content-coding selection for response compression plugins.
|
Package compression coordinates content-coding selection for response compression plugins. |
|
Package dubbo shares the Dubbo transport skeleton used by the dubbo-proxy and http-dubbo plugins.
|
Package dubbo shares the Dubbo transport skeleton used by the dubbo-proxy and http-dubbo plugins. |
|
Package limitbase provides shared helpers for the rate-limit plugin family: limit-req, limit-conn, limit-count, and graphql-limit-count.
|
Package limitbase provides shared helpers for the rate-limit plugin family: limit-req, limit-conn, limit-count, and graphql-limit-count. |
|
Package luautil provides shared conversions between Lua values and Go values for the serverless and exit-transformer plugins.
|
Package luautil provides shared conversions between Lua values and Go values for the serverless and exit-transformer plugins. |