Documentation
¶
Overview ¶
Package stdawssecretsfx provides access to secrets in the AWS Secret manager.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvideJSONSecret ¶
func ProvideJSONSecret[S any, IDR SecretIDer]() fx.Option
ProvideJSONSecret provides a JSON secret with shape "S". It also requires a type that needs to be provided through fx as a dependency and implements SecretIDer. Usually this is a configuration struct that has the name of the ID as one of its fields, of which the field is loaded from an environment variable. This config then only needs to implement the SecretIDer interface by just returing the env value.
Types ¶
type JSONSecret ¶
type JSONSecret[S any] struct { // contains filtered or unexported fields }
JSONSecret holds a secret encoded as JSON with shape "S".
func NewJSONSecret ¶
func NewJSONSecret[S any, IDR SecretIDer](p JSONSecretParams[IDR]) (secr *JSONSecret[S], err error)
NewJSONSecret inits the main component in this module.
func (*JSONSecret[S]) Static ¶
func (s *JSONSecret[S]) Static() *S
Static returns a pointer to the static value of the secret as read on startup.
type JSONSecretParams ¶
type JSONSecretParams[IDR SecretIDer] struct { fx.In Config IDR Cache *secretcache.Cache }
JSONSecretParams describes the dependencies for creating the json secret. It requires a type that can return the ID of the secret in the AWS secrets manager. Usually this is a configuration struct that implements the interface.
type SecretIDer ¶
type SecretIDer interface {
AWSSecretID() string
}
SecretIDer describes a type that can return the ID of a secret in the AWS secrets manager.