Documentation ¶
Index ¶
- type AbstractProviderInterface
- type AbstractReconnectProvider
- type CoalescingLayerStorage
- type RequestResponse
- type RetrieverResponseProperties
- func (r *RetrieverResponseProperties) GetConfiguration() configurationtypes.AbstractConfigurationInterface
- func (r *RetrieverResponseProperties) GetContext() *context.Context
- func (r *RetrieverResponseProperties) GetExcludeRegexp() *regexp.Regexp
- func (r *RetrieverResponseProperties) GetMatchedURL() configurationtypes.URL
- func (r *RetrieverResponseProperties) GetProvider() AbstractProviderInterface
- func (r *RetrieverResponseProperties) GetRegexpUrls() *regexp.Regexp
- func (r *RetrieverResponseProperties) GetTransport() TransportInterface
- func (r *RetrieverResponseProperties) SetMatchedURL(url configurationtypes.URL)
- func (r *RetrieverResponseProperties) SetMatchedURLFromRequest(req *http.Request)
- func (r *RetrieverResponseProperties) SetTransport(transportInterface TransportInterface)
- type RetrieverResponsePropertiesInterface
- type ReverseResponse
- type Transport
- type TransportInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractProviderInterface ¶
type AbstractProviderInterface interface { ListKeys() []string Prefix(key string, req *http.Request) []byte Get(key string) []byte Set(key string, value []byte, url configurationtypes.URL, duration time.Duration) error Delete(key string) DeleteMany(key string) Init() error Reset() error }
AbstractProviderInterface should be implemented in any providers
type AbstractReconnectProvider ¶ added in v1.6.19
type AbstractReconnectProvider interface { AbstractProviderInterface Reconnect() }
type CoalescingLayerStorage ¶
CoalescingLayerStorage is the layer to be able to not coalesce uncoalesceable request
func InitializeCoalescingLayerStorage ¶
func InitializeCoalescingLayerStorage() *CoalescingLayerStorage
InitializeCoalescingLayerStorage initialize the storage
func (*CoalescingLayerStorage) Delete ¶
func (provider *CoalescingLayerStorage) Delete(key string)
Delete method will delete the response in Ristretto provider if exists corresponding to key param
func (*CoalescingLayerStorage) Destruct ¶ added in v1.6.9
func (provider *CoalescingLayerStorage) Destruct() error
Destruct method will shutdown properly the provider
func (*CoalescingLayerStorage) Exists ¶
func (provider *CoalescingLayerStorage) Exists(key string) bool
Exists method returns if the key should coalesce
func (*CoalescingLayerStorage) Set ¶
func (provider *CoalescingLayerStorage) Set(key string)
Set method will store the response in Ristretto provider
type RequestResponse ¶
type RequestResponse struct { Body []byte `json:"body"` Headers map[string][]string `json:"headers"` }
RequestResponse object contains the request belongs to reverse-proxy
type RetrieverResponseProperties ¶
type RetrieverResponseProperties struct { Provider AbstractProviderInterface Configuration configurationtypes.AbstractConfigurationInterface MatchedURL configurationtypes.URL RegexpUrls regexp.Regexp Transport TransportInterface ExcludeRegex *regexp.Regexp Context *context.Context }
RetrieverResponseProperties struct
func (*RetrieverResponseProperties) GetConfiguration ¶
func (r *RetrieverResponseProperties) GetConfiguration() configurationtypes.AbstractConfigurationInterface
GetConfiguration get the configuration
func (*RetrieverResponseProperties) GetContext ¶
func (r *RetrieverResponseProperties) GetContext() *context.Context
GetContext get the different contexts to init/use
func (*RetrieverResponseProperties) GetExcludeRegexp ¶
func (r *RetrieverResponseProperties) GetExcludeRegexp() *regexp.Regexp
GetExcludeRegexp get the excluded regexp
func (*RetrieverResponseProperties) GetMatchedURL ¶
func (r *RetrieverResponseProperties) GetMatchedURL() configurationtypes.URL
GetMatchedURL get the matched url
func (*RetrieverResponseProperties) GetProvider ¶
func (r *RetrieverResponseProperties) GetProvider() AbstractProviderInterface
GetProvider interface
func (*RetrieverResponseProperties) GetRegexpUrls ¶
func (r *RetrieverResponseProperties) GetRegexpUrls() *regexp.Regexp
GetRegexpUrls get the regexp urls
func (*RetrieverResponseProperties) GetTransport ¶
func (r *RetrieverResponseProperties) GetTransport() TransportInterface
GetTransport get the transport according to the RFC
func (*RetrieverResponseProperties) SetMatchedURL ¶
func (r *RetrieverResponseProperties) SetMatchedURL(url configurationtypes.URL)
SetMatchedURL set the matched url
func (*RetrieverResponseProperties) SetMatchedURLFromRequest ¶
func (r *RetrieverResponseProperties) SetMatchedURLFromRequest(req *http.Request)
SetMatchedURLFromRequest set the matched url from the request
func (*RetrieverResponseProperties) SetTransport ¶
func (r *RetrieverResponseProperties) SetTransport(transportInterface TransportInterface)
SetTransport set the transport
type RetrieverResponsePropertiesInterface ¶
type RetrieverResponsePropertiesInterface interface { GetProvider() AbstractProviderInterface GetConfiguration() configurationtypes.AbstractConfigurationInterface GetMatchedURL() configurationtypes.URL SetMatchedURL(url configurationtypes.URL) SetMatchedURLFromRequest(*http.Request) GetRegexpUrls() *regexp.Regexp GetTransport() TransportInterface SetTransport(TransportInterface) GetExcludeRegexp() *regexp.Regexp GetContext() *context.Context }
RetrieverResponsePropertiesInterface interface
type ReverseResponse ¶
type ReverseResponse struct { Response *http.Response Proxy *httputil.ReverseProxy Request *http.Request }
ReverseResponse object contains the response from reverse-proxy
type Transport ¶
type Transport struct { // The RoundTripper interface actually used to make requests // If nil, http.DefaultTransport is used Transport http.RoundTripper Provider AbstractProviderInterface ConfigurationURL configurationtypes.URL MarkCachedResponses bool CoalescingLayerStorage *CoalescingLayerStorage YkeyStorage *ykeys.YKeyStorage SurrogateStorage providers.SurrogateInterface }
Transport is an implementation of http.RoundTripper that will return values from a cache where possible (avoiding a network request) and will additionally add validators (etag/if-modified-since) to repeated requests allowing servers to return 304 / Not Modified
type TransportInterface ¶
type TransportInterface interface { GetProvider() AbstractProviderInterface RoundTrip(req *http.Request) (resp *http.Response, err error) SetURL(url configurationtypes.URL) UpdateCacheEventually(req *http.Request) (resp *http.Response, err error) GetCoalescingLayerStorage() *CoalescingLayerStorage GetYkeyStorage() *ykeys.YKeyStorage GetSurrogateKeys() providers.SurrogateInterface SetSurrogateKeys(providers.SurrogateInterface) }
TransportInterface interface