Documentation
¶
Overview ¶
Package parameters provides shared caching and transformations for configuration providers.
Index ¶
- func Age(d time.Duration) *time.Duration
- func ClearCaches()
- func GetError(name string, err error) error
- func TransformValue(name string, value any, transform Transform) (any, error)
- type Cache
- func (c *Cache) ClearCache()
- func (c *Cache) Get(ctx context.Context, name string, options Options, ...) (any, error)
- func (c *Cache) GetMultiple(ctx context.Context, path string, options Options, ...) (map[string]any, error)
- func (c *Cache) Lookup(name string, options Options) (any, bool)
- func (c *Cache) Store(name string, value any, options Options)
- type GetParameterError
- type Options
- type ParameterNotFoundError
- type SetParameterError
- type Transform
- type TransformParameterError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCaches ¶
func ClearCaches()
ClearCaches clears all initialized default providers. Explicit providers have their own ClearCache methods. Default AWS configuration and AppConfig sessions are retained.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is safe for concurrent retrievals. Construct one per provider, not per invocation. SDK options are not cache keys: use ForceFetch or separate providers when they change. Concurrent misses may fetch independently, matching the reference provider.
func (*Cache) ClearCache ¶
func (c *Cache) ClearCache()
ClearCache also prevents in-flight Get/GetMultiple callbacks from repopulating entries.
func (*Cache) Get ¶
func (c *Cache) Get(ctx context.Context, name string, options Options, fetch func(context.Context) (any, error)) (any, error)
Get fetches and transforms a value on a cache miss. A nil value means missing.
func (*Cache) GetMultiple ¶
type GetParameterError ¶
GetParameterError preserves the underlying SDK or context error for errors.Is/As.
func (*GetParameterError) Error ¶
func (e *GetParameterError) Error() string
func (*GetParameterError) Unwrap ¶
func (e *GetParameterError) Unwrap() error
type Options ¶
type Options struct {
MaxAge *time.Duration
ForceFetch bool
Transform Transform
ThrowOnMissing bool
ThrowOnTransformError bool
}
Options controls one retrieval. A nil MaxAge reads the environment on each call. MaxAge controls new cache entries; ForceFetch bypasses existing entries.
type ParameterNotFoundError ¶
type ParameterNotFoundError struct{ Name string }
func (*ParameterNotFoundError) Error ¶
func (e *ParameterNotFoundError) Error() string
type SetParameterError ¶
func (*SetParameterError) Error ¶
func (e *SetParameterError) Error() string
func (*SetParameterError) Unwrap ¶
func (e *SetParameterError) Unwrap() error
type TransformParameterError ¶
func (*TransformParameterError) Error ¶
func (e *TransformParameterError) Error() string
func (*TransformParameterError) Unwrap ¶
func (e *TransformParameterError) Unwrap() error
Directories
¶
| Path | Synopsis |
|---|---|
|
Package appconfig retrieves configuration through the AppConfig Data API.
|
Package appconfig retrieves configuration through the AppConfig Data API. |
|
Package appconfigagent reads the local AppConfig Agent or Lambda extension.
|
Package appconfigagent reads the local AppConfig Agent or Lambda extension. |
|
Package dynamodb retrieves configuration values from a DynamoDB table.
|
Package dynamodb retrieves configuration values from a DynamoDB table. |
|
internal
|
|
|
parameterdefaults
Package parameterdefaults manages lazily initialized default providers.
|
Package parameterdefaults manages lazily initialized default providers. |
|
Package secrets retrieves AWS Secrets Manager values with an in-memory cache.
|
Package secrets retrieves AWS Secrets Manager values with an in-memory cache. |
|
Package ssm retrieves and writes AWS Systems Manager parameters.
|
Package ssm retrieves and writes AWS Systems Manager parameters. |