Versions in this module Expand all Collapse all v1 v1.138.1 Sep 11, 2026 Changes in this version + type Credentials func(header http.Header, token string) + type Option func(*Relay) + func WithClient(client *http.Client) Option + func WithCredentials(credentials Credentials) Option + func WithMaxRequestBytes(n int64) Option + func WithMaxStreamLineBytes(n int) Option + func WithRequestHeaders(headers ...string) Option + func WithResponseHeaders(headers ...string) Option + func WithStreamInterruptedEvent(event []byte) Option + func WithStreamObserver(newObserver func() StreamObserver) Option + func WithTimeout(timeout time.Duration) Option + type Relay struct + func New(target Target, path string, tokens TokenSource, validator Validator, ...) (*Relay, error) + func (r *Relay) Serve(w http.ResponseWriter, req *http.Request) (Result, error) + type RequestInfo struct + Stream bool + Values map[string]string + type Result struct + Info RequestInfo + Status int + type StreamObserver interface + Complete func() bool + Observe func(data []byte) + type Target func(*http.Request) (*url.URL, error) + type TokenSource interface + Invalidate func(token string) + Token func(ctx context.Context) (string, error) + type Validator interface + Validate func(body []byte, query url.Values) (RequestInfo, error)