secrets

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecret

func GetSecret(s *schema.Secret, store *SecretStore, logger *slog.Logger) (string, error)

GetSecret returns the secret value for the given secret.

Types

type Provider

type Provider string
const (
	ProviderAWS   Provider = "aws"
	ProviderEnv   Provider = "env"
	ProviderLocal Provider = "local"
)

type SecretProvider

type SecretProvider interface {
	Get(key string) (string, error)
	Set(key, value string) (string, error)
}

SecretProvider is an interface for getting and setting secrets.

type SecretStore

type SecretStore struct {
	// contains filtered or unexported fields
}

SecretStore is a store of secret providers.

func NewDefaultSecretStore

func NewDefaultSecretStore() SecretStore

NewDefaultSecretStore returns a new SecretStore with the default providers.

func NewSecretStore

func NewSecretStore(store map[Provider]func(*slog.Logger) (SecretProvider, error)) SecretStore

NewSecretStore returns a new SecretStore with the given providers.

func (SecretStore) NewClient

func (s SecretStore) NewClient(logger *slog.Logger, p Provider) (SecretProvider, error)

NewClient returns a new SecretProvider client for the given provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL