Documentation
¶
Overview ¶
Package cached handles a metadata.Provider implementation that both downloads and caches the MDS3 blob. This effectively is the recommended provider in most instances as it's fairly robust. Alternatively we suggest implementing a similar provider that leverages the memory.Provider as an underlying element.
This provider only specifically performs updates at the time it's initialized. It has no automatic update functionality. This may change in the future however if you want this functionality at this time we recommend making your own implementation.
Index ¶
- func New(opts ...Option) (provider metadata.Provider, err error)
- type NewFunc
- type Option
- func WithClient(client *http.Client) Option
- func WithClock(clock metadata.Clock) Option
- func WithDecoder(decoder *metadata.Decoder) Option
- func WithForceUpdate(force bool) Option
- func WithMetadataURL(uri string) Option
- func WithNew(newup NewFunc) Option
- func WithPath(name string) Option
- func WithUpdate(update bool) Option
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
Option describes an optional pattern for this provider.
func WithClient ¶
WithClient configures the *http.Client used to get the MDS3 blob.
func WithClock ¶
WithClock allows injection of a metadata.Clock to check the up-to-date status of a blob.
func WithDecoder ¶
WithDecoder sets the decoder to be used for this provider. By default this is a decoder with the entry parsing errors configured to skip that entry.
func WithForceUpdate ¶
WithForceUpdate is used to force an update on creation. This will forcibly overwrite the file if possible.
func WithMetadataURL ¶
WithMetadataURL configures the URL to get the metadata from. This shouldn't be modified unless you know what you're doing as we use the metadata.ProductionMDSURL which is safe in most instances.
func WithNew ¶
WithNew customizes the NewFunc. By default we just create a fairly standard memory.Provider with strict defaults.
func WithUpdate ¶
WithUpdate is used to enable or disable the update. By default it's set to true.