# Packages
Package plugin provides tools for loading and registering proxy plugins
*/.
# Functions
No description provided by the author
CloneRequest returns a deep copy of the received request, so the received and the returned proxy.Request do not share a pointer.
CloneRequestHeaders returns a copy of the received request headers.
CloneRequestParams returns a copy of the received request params.
CustomHTTPProxyFactory returns a BackendFactory.
DefaultFactory returns a default http proxy factory with the injected logger.
DefaultFactoryWithSubscriber returns a default proxy factory with the injected logger and subscriber factory.
DefaultHTTPResponseParserFactory is the default implementation of HTTPResponseParserFactory.
No description provided by the author
EmptyMiddlewareWithLoggger is a dummy middleware, useful for testing and fallback.
HTTPProxyFactory returns a BackendFactory.
NewBackendPluginMiddleware returns a backend middleware wrapped (if required) with the plugin middleware.
NewConcurrentMiddlewareWithLogger creates a proxy middleware that enables sending several requests concurrently.
NewConcurrentMiddlewareWithLogger creates a proxy middleware that enables sending several requests concurrently.
NewDefaultFactory returns a default proxy factory with the injected proxy builder and logger.
NewDefaultFactoryWithSubscriber returns a default proxy factory with the injected proxy builder, logger and subscriber factory.
NewEntityFormatter creates an entity formatter with the received backend definition.
NewFilterHeadersMiddleware returns a middleware with or without a header filtering proxy wrapping the next element (depending on the configuration).
NewFilterQueryStringsMiddleware returns a middleware with or without a header filtering proxy wrapping the next element (depending on the configuration).
NewFlatmapMiddleware creates a proxy middleware that enables applying flatmap operations to the proxy response.
NewGraphQLMiddleware returns a middleware with or without the GraphQL proxy wrapping the next element (depending on the configuration).
NewHTTPProxy creates a http proxy with the injected configuration, HTTPClientFactory and Decoder.
NewHTTPProxyDetailed creates a http proxy with the injected configuration, HTTPRequestExecutor, Decoder and HTTPResponseParser.
NewHTTPProxyWithHTTPExecutor creates a http proxy with the injected configuration, HTTPRequestExecutor and Decoder.
NewLoadBalancedMiddleware creates proxy middleware adding the most perfomant balancer over a default subscriber.
NewLoadBalancedMiddlewareWithLogger creates proxy middleware adding the most perfomant balancer over a default subscriber.
NewLoadBalancedMiddlewareWithSubscriber creates proxy middleware adding the most perfomant balancer over the received subscriber.
NewLoadBalancedMiddlewareWithSubscriberAndLogger creates proxy middleware adding the most perfomant balancer over the received subscriber.
NewLoggingMiddleware creates proxy middleware for logging requests and responses.
NewMergeDataMiddleware creates proxy middleware for merging responses from several backends.
NewPluginMiddleware returns an endpoint middleware wrapped (if required) with the plugin middleware.
NewRandomLoadBalancedMiddleware creates proxy middleware adding a random balancer over a default subscriber.
NewRandomLoadBalancedMiddlewareWithLogger creates proxy middleware adding a random balancer over a default subscriber.
NewRandomLoadBalancedMiddlewareWithSubscriber creates proxy middleware adding a random balancer over the received subscriber.
NewRandomLoadBalancedMiddlewareWithSubscriberAndLogger creates proxy middleware adding a random balancer over the received subscriber.
NewReadCloserWrapper Creates a new closeable io.Read.
No description provided by the author
No description provided by the author
NewRoundRobinLoadBalancedMiddleware creates proxy middleware adding a round robin balancer over a default subscriber.
NewRoundRobinLoadBalancedMiddlewareWithLogger creates proxy middleware adding a round robin balancer over a default subscriber.
NewRoundRobinLoadBalancedMiddlewareWithSubscriber creates proxy middleware adding a round robin balancer over the received subscriber.
NewRoundRobinLoadBalancedMiddlewareWithSubscriberAndLogger creates proxy middleware adding a round robin balancer over the received subscriber.
NewShadowFactory creates a new shadowFactory using the provided Factory.
NewShadowProxy returns a Proxy that sends requests to p1 and p2 but ignores the response of p2.
NewShadowProxyWithTimeout returns a Proxy that sends requests to p1 and p2 but ignores the response of p2.
NewStaticMiddleware creates proxy middleware for adding static values to the processed responses.
NoOpHTTPResponseParser is a HTTPResponseParser implementation that just copies the http response body into the proxy response IO.
NoopProxy is a do nothing proxy, useful for testing.
RegisterResponseCombiner adds a new response combiner into the internal register.
ShadowMiddleware is a Middleware that creates a shadowProxy.
ShadowMiddlewareWithLogger is a Middleware that creates a shadowProxy.
ShadowMiddlewareWithTimeout is a Middleware that creates a shadowProxy with a timeout in the context.
ShadowMiddlewareWithTimeoutAndLogger is a Middleware that creates a shadowProxy with a timeout in the context.
# Constants
Namespace to be used in extra config.
# Variables
DefaultHTTPResponseParserConfig defines a default HTTPResponseParserConfig.
ErrNoBackends is the error returned when an endpoint has no backends defined.
ErrNotEnoughProxies is the error returned when an endpoint has not enough proxies defined.
ErrTooManyBackends is the error returned when an endpoint has too many backends defined.
ErrTooManyProxies is the error returned when a middleware has too many proxies defined.
NewRequestBuilderMiddleware creates a proxy middleware that parses the request params received from the outer layer and generates the path to the backend endpoints.
# Structs
HTTPResponseParserConfig contains the config for a given HttpResponseParser.
Metadata is the Metadata of the Response which contains Headers and StatusCode.
No description provided by the author
Request contains the data to send to the backend.
Response is the entity returned by the proxy.
# Interfaces
EntityFormatter formats the response data.
Factory creates proxies based on the received endpoint configuration.
RequestWrapper is an interface for passing proxy request between the lura pipe and the loaded plugins.
ResponseWrapper is an interface for passing proxy response between the lura pipe and the loaded plugins.
# Type aliases
BackendFactory creates a proxy based on the received backend configuration.
EntityFormatterFunc holds the formatter function.
FactoryFunc type is an adapter to allow the use of ordinary functions as proxy factories.
HTTPResponseParser defines how the response is parsed from http.Response to Response object.
HTTPResponseParserFactory creates HTTPResponseParser from a given HTTPResponseParserConfig.
Middleware adds a middleware, decorator or wrapper over a collection of proxies, exposing a proxy interface.
Proxy processes a request in a given context and returns a response and an error.
ResponseCombiner func to merge the collected responses into a single one.