Documentation ¶
Overview ¶
Package secrets handles the production of and access to collections of secrets. i.e. files containing sensitive data such as passwords.
Index ¶
- func NewSingleFile(v *api.Volume, n string, r io.Reader, t api.SecretType) api.Secrets
- func NewTarGz(v *api.Volume, r io.ReadCloser, tgzo ...TarGzOption) (api.Secrets, error)
- func OpenTarGz(v *api.Volume, fs afero.Fs, file string, tgzo ...TarGzOption) (api.Secrets, error)
- func WriteJSON(s api.Secrets, w io.Writer) error
- type Producer
- type Producers
- type TalosProducerOption
- type TarGzOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSingleFile ¶
NewSingleFile returns a set of Secrets containing only a single file, the provided io.Reader.
func NewTarGz ¶
func NewTarGz(v *api.Volume, r io.ReadCloser, tgzo ...TarGzOption) (api.Secrets, error)
NewTarGz creates an api.Secrets backed by the supplied io.ReadCloser, which is expected to be a gzipped tarball of secret files.
Types ¶
type Producer ¶
type Producer interface { // For returns the appropriate secrets files for the supplied api.Volume. For(*api.Volume) (api.Secrets, error) }
A Producer produces secrets files for the supplied api.Volume.
func NewTalosProducer ¶
func NewTalosProducer(lb lb.LoadBalancer, spo ...TalosProducerOption) (Producer, error)
NewTalosProducer builds a Producer backed by https://github.com/spotify/talos The supplied lb.LoadBalancer should return the address of a Talos HTTP backend.
type Producers ¶
type Producers map[api.SecretSource]Producer
Producers maps api.SecretSources to the Producer that handles them.
type TalosProducerOption ¶
type TalosProducerOption func(sp *talosProducer) error
A TalosProducerOption represents an argument to NewTalosProducer.
func WithContext ¶
func WithContext(ctx context.Context) TalosProducerOption
WithContext provides an alternative parent context.Context() for HTTP requests to Talos. context.Background() is used by default.
type TarGzOption ¶
type TarGzOption func(*tarGz) error
A TarGzOption represents an argument to NewTarGz.
func TarGzSecretType ¶
func TarGzSecretType(s api.SecretType) TarGzOption
TarGzSecretType defines the type of the secret files within Secrets.