Documentation ¶
Index ¶
- Constants
- func DefaultOptions(opts *ProcessingOptions) error
- func Serve(port int, processor RequestProcessor)
- func StrInSlice(s []string, r string) bool
- type GenericExtProcServer
- type HealthServer
- type PhaseResponse
- type ProcessingOptions
- type RequestContext
- func (rc *RequestContext) AddHeader(name string, value string) error
- func (rc *RequestContext) AddHeaders(headers map[string]string) error
- func (rc *RequestContext) AppendHeader(name string, value string) error
- func (rc *RequestContext) AppendHeaders(headers map[string]string) error
- func (rc *RequestContext) CancelRequest(status int32, headers map[string]string, body string) error
- func (rc *RequestContext) ClearBodyChunk() error
- func (rc *RequestContext) ContinueRequest() error
- func (rc *RequestContext) GetResponse(phase int) (*extprocv3.ProcessingResponse, error)
- func (rc *RequestContext) GetValue(name string) (interface{}, error)
- func (rc *RequestContext) OverwriteHeader(name string, value string) error
- func (rc *RequestContext) OverwriteHeaders(headers map[string]string) error
- func (rc *RequestContext) RemoveHeader(name string) error
- func (rc *RequestContext) RemoveHeaders(headers []string) error
- func (rc *RequestContext) RemoveHeadersVariadic(headers ...string) error
- func (rc *RequestContext) ReplaceBodyChunk(body []byte) error
- func (rc *RequestContext) ResetPhase() error
- func (rc *RequestContext) SetValue(name string, val interface{}) error
- func (rc *RequestContext) UpdateHeader(name string, value string, action string) error
- func (rc *RequestContext) UpdateHeaders(headers map[string]string, action string) error
- type RequestProcessor
Constants ¶
View Source
const ( REQUEST_PHASE_UNDETERMINED = 0 REQUEST_PHASE_REQUEST_HEADERS = 1 REQUEST_PHASE_REQUEST_BODY = 2 REQUEST_PHASE_REQUEST_TRAILERS = 3 REQUEST_PHASE_RESPONSE_HEADERS = 4 REQUEST_PHASE_RESPONSE_BODY = 5 REQUEST_PHASE_RESPONSE_TRAILERS = 6 )
Variables ¶
This section is empty.
Functions ¶
func DefaultOptions ¶ added in v0.0.18
func DefaultOptions(opts *ProcessingOptions) error
func Serve ¶
func Serve(port int, processor RequestProcessor)
func StrInSlice ¶
Types ¶
type GenericExtProcServer ¶ added in v0.0.4
type GenericExtProcServer struct {
// contains filtered or unexported fields
}
func (*GenericExtProcServer) Process ¶ added in v0.0.4
func (s *GenericExtProcServer) Process(srv extprocv3.ExternalProcessor_ProcessServer) error
type HealthServer ¶
type HealthServer struct{}
func (*HealthServer) Check ¶
func (s *HealthServer) Check(ctx context.Context, req *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error)
func (*HealthServer) Watch ¶
func (s *HealthServer) Watch(req *pb.HealthCheckRequest, srv pb.Health_WatchServer) error
type PhaseResponse ¶ added in v0.0.4
type PhaseResponse struct {
// contains filtered or unexported fields
}
type ProcessingOptions ¶ added in v0.0.18
type ProcessingOptions struct { LogStream bool LogPhases bool UpdateExtProcHeader bool UpdateDurationHeader bool }
func NewOptions ¶ added in v0.0.18
func NewOptions() *ProcessingOptions
type RequestContext ¶
type RequestContext struct { Scheme string Authority string Method string Path string RequestId string Headers map[string][]string Started time.Time Duration time.Duration EndOfStream bool // contains filtered or unexported fields }
func (*RequestContext) AddHeader ¶
func (rc *RequestContext) AddHeader(name string, value string) error
func (*RequestContext) AddHeaders ¶
func (rc *RequestContext) AddHeaders(headers map[string]string) error
func (*RequestContext) AppendHeader ¶ added in v0.0.4
func (rc *RequestContext) AppendHeader(name string, value string) error
func (*RequestContext) AppendHeaders ¶ added in v0.0.4
func (rc *RequestContext) AppendHeaders(headers map[string]string) error
func (*RequestContext) CancelRequest ¶
func (*RequestContext) ClearBodyChunk ¶ added in v0.0.21
func (rc *RequestContext) ClearBodyChunk() error
func (*RequestContext) ContinueRequest ¶
func (rc *RequestContext) ContinueRequest() error
func (*RequestContext) GetResponse ¶
func (rc *RequestContext) GetResponse(phase int) (*extprocv3.ProcessingResponse, error)
func (*RequestContext) GetValue ¶
func (rc *RequestContext) GetValue(name string) (interface{}, error)
func (*RequestContext) OverwriteHeader ¶ added in v0.0.4
func (rc *RequestContext) OverwriteHeader(name string, value string) error
func (*RequestContext) OverwriteHeaders ¶ added in v0.0.4
func (rc *RequestContext) OverwriteHeaders(headers map[string]string) error
func (*RequestContext) RemoveHeader ¶
func (rc *RequestContext) RemoveHeader(name string) error
func (*RequestContext) RemoveHeaders ¶
func (rc *RequestContext) RemoveHeaders(headers []string) error
func (*RequestContext) RemoveHeadersVariadic ¶ added in v0.0.17
func (rc *RequestContext) RemoveHeadersVariadic(headers ...string) error
func (*RequestContext) ReplaceBodyChunk ¶ added in v0.0.21
func (rc *RequestContext) ReplaceBodyChunk(body []byte) error
func (*RequestContext) ResetPhase ¶ added in v0.0.15
func (rc *RequestContext) ResetPhase() error
func (*RequestContext) SetValue ¶
func (rc *RequestContext) SetValue(name string, val interface{}) error
func (*RequestContext) UpdateHeader ¶ added in v0.0.4
func (rc *RequestContext) UpdateHeader(name string, value string, action string) error
func (*RequestContext) UpdateHeaders ¶ added in v0.0.4
func (rc *RequestContext) UpdateHeaders(headers map[string]string, action string) error
type RequestProcessor ¶
type RequestProcessor interface { GetName() string GetOptions() *ProcessingOptions ProcessRequestHeaders(ctx *RequestContext, headers map[string][]string) error ProcessRequestBody(ctx *RequestContext, body []byte) error ProcessRequestTrailers(ctx *RequestContext, trailers map[string][]string) error ProcessResponseHeaders(ctx *RequestContext, headers map[string][]string) error ProcessResponseBody(ctx *RequestContext, body []byte) error ProcessResponseTrailers(ctx *RequestContext, trailers map[string][]string) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.