Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilUpstreamUrl = errors.New("upstream url cannot be nil") ErrEmptyProxyPattern = errors.New("proxy pattern cannot be empty") )
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface {
// FlushInterval sets the flush interval for flushable response bodies.
FlushInterval(time.Duration) Builder
// Rewrite sets the rewrite function for the reverse proxy.
CustomRewrite(RewriteFunc) Builder
// ModifyResponse sets the modify response function for the reverse proxy.
ModifyResponse(ModifyResponseFunc) Builder
// ErrorHandler sets the error handler function for the reverse proxy.
ErrorHandler(ErrorHandlerFunc) Builder
// Transport sets the transport for the reverse proxy.
Transport(http.RoundTripper) Builder
// ErrorLogger sets the (go) logger for the reverse proxy.
ErrorLogger(*log.Logger) Builder
// ProxyRewrite sets the proxy rewrite function for the reverse proxy.
ProxyRewrite(
stripPath bool,
preserveHost bool,
disableQueryParams bool,
xForwardedHeaders bool,
) Builder
// Build builds the reverse proxy executor.
Build(
upstreamUrl *url.URL,
proxyPattern string,
) (http.Handler, error)
// Clone clones the builder.
Clone() Builder
}
func NewBuilder ¶
func NewBuilder() Builder
type ErrorHandlerFunc ¶
type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error)
type ModifyResponseFunc ¶
Click to show internal directories.
Click to hide internal directories.