Documentation
¶
Index ¶
- type Config
- type Plugin
- func (p *Plugin) Config() any
- func (p *Plugin) Handler(next http.Handler) http.Handler
- func (p *Plugin) Init() error
- func (p *Plugin) PostInit() error
- func (p *Plugin) RunExclusiveProtocol(w http.ResponseWriter, r *http.Request, next http.Handler) (base.ProtocolDisposition, *http.Request, apisixctx.ResponseSource, error)
- func (p *Plugin) RunRequestPhase(w http.ResponseWriter, r *http.Request) base.RequestPhaseResult
- func (p *Plugin) RunStreamingHeaderFilter(_ *http.Request, _ *base.StreamingResponseState) error
- func (p *Plugin) WrapStreamingResponse(w http.ResponseWriter, _ *http.Request) (http.ResponseWriter, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
base.BasePlugin
// contains filtered or unexported fields
}
func (*Plugin) RunExclusiveProtocol ¶
func (p *Plugin) RunExclusiveProtocol( w http.ResponseWriter, r *http.Request, next http.Handler, ) (base.ProtocolDisposition, *http.Request, apisixctx.ResponseSource, error)
RunExclusiveProtocol frames the normal upstream continuation exactly once. grpc-web trailers are emitted by the request-local writer after the continuation returns, and the source is published before its first write.
func (*Plugin) RunRequestPhase ¶
func (p *Plugin) RunRequestPhase(w http.ResponseWriter, r *http.Request) base.RequestPhaseResult
RunRequestPhase validates and rewrites a grpc-web request once. The protocol owner consumes the prepared request after all access hooks run.
func (*Plugin) RunStreamingHeaderFilter ¶
func (*Plugin) WrapStreamingResponse ¶
func (p *Plugin) WrapStreamingResponse(w http.ResponseWriter, _ *http.Request) (http.ResponseWriter, error)
WrapStreamingResponse satisfies the declared streaming-body capability. The protocol terminal remains the sole grpc-web framing owner; this callback is deliberately transparent so generic response wrapping cannot frame twice.