Documentation
¶
Overview ¶
Package clorthofx provides integration with go.uber.org/fx.
An optional clortho.Parser and clortho.Loader can be provided to tailor how key material is loaded and parsed.
Index ¶
Constants ¶
const Module = "clortho"
Module is the name of the go.uber.org/fx module this package uses for its components.
Variables ¶
This section is empty.
Functions ¶
func Provide ¶
Provide bootstraps the clortho module.
If a clortho.KeyRing is present in the enclosing application, it will be used as the cache for the resolver and refresher. Otherwise, an internal key ring is created and used.
This module provides the following components:
clortho.KeyRing Available as a component itself, this is also used as the cache for the resolver and is refreshed using the injected clortho.Config configuration.
clortho.Fetcher An optional clortho.Parser and clortho.Loader may be supplied to tailor this component. If no parser or loader are supplied, the package defaults are used.
clorthozap.Listener This will be non-nil only if a *zap.Logger is supplied. If non-nil, it will automatically listen for refresh and resolve events.
clorthometrics.Listener This will be non-nil only if a *touchstone.Factory is supplied. If non-nil, it will
clortho.Refresher The refresher will be bound to the application lifecycle.
clortho.Resolver
clortho.KeyAccessor This is the same component as the key ring, but may be decorated in future versions. Clients that only need read access to the key ring should use this component.
Types ¶
type FetcherIn ¶
type FetcherIn struct { fx.In // FetcherOptions is the optional slice of options used to create the clortho.Fetcher. FetcherOptions []clortho.FetcherOption `optional:"true"` // Parser is the optional clortho.Parser used to tailor how key material is parsed. // This will override any parser described in FetcherOptions. // // If no parser is injected, the clortho.Fetcher component will use a default // parser created via clortho.NewParser(). Parser clortho.Parser `optional:"true"` // Loader is the optional clortho.Loader used to tailor how key material is loaded. // This will override any loader described in FetcherOptions. // // If no loader is injected, the clortho.Fetcher component will use a default // loader created via clortho.NewLoader(). Loader clortho.Loader `optional:"true"` }
FetcherIn specifies the components that the clortho.Fetcher component depends upon.
type MetricsIn ¶
type MetricsIn struct { fx.In Factory *touchstone.Factory `optional:"true"` }
MetricsIn holds the set of dependencies for creating a *clorthometrics.Listener.
type RefresherIn ¶
type RefresherIn struct { fx.In // KeyRing is the key ring to refresh. This will be either supplied from the // enclosing application or internally created within this module. KeyRing clortho.KeyRing Fetcher clortho.Fetcher Config clortho.Config `optional:"true"` ZapListener *clorthozap.Listener `optional:"true"` MetricsListener *clorthometrics.Listener `optional:"true"` Lifecycle fx.Lifecycle }
RefresherIn enumerates the set of components involved in the creation of a clortho.Refresher.
type ResolverIn ¶
type ResolverIn RefresherIn
ResolverIn enumerates the set of components involved in the creation of a clortho.Resolver.