Documentation
¶
Overview ¶
Package secrets provides a portable secret management API with cross-cutting concerns.
Index ¶
- type Option
- type Secrets
- func (s *Secrets) CreateSecret(ctx context.Context, config driver.SecretConfig, value []byte) (*driver.SecretInfo, error)
- func (s *Secrets) DeleteSecret(ctx context.Context, name string) error
- func (s *Secrets) GetSecret(ctx context.Context, name string) (*driver.SecretInfo, error)
- func (s *Secrets) GetSecretValue(ctx context.Context, name, versionID string) (*driver.SecretVersion, error)
- func (s *Secrets) ListSecretVersions(ctx context.Context, name string) ([]driver.SecretVersion, error)
- func (s *Secrets) ListSecrets(ctx context.Context) ([]driver.SecretInfo, error)
- func (s *Secrets) PutSecretValue(ctx context.Context, name string, value []byte) (*driver.SecretVersion, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Secrets)
Option configures a portable Secrets.
func WithErrorInjection ¶
WithErrorInjection sets the error injector.
func WithMetrics ¶
WithMetrics sets the metrics collector.
func WithRateLimiter ¶
WithRateLimiter sets the rate limiter.
type Secrets ¶
type Secrets struct {
// contains filtered or unexported fields
}
Secrets is the portable secrets type wrapping a driver with cross-cutting concerns.
func NewSecrets ¶
NewSecrets creates a new portable Secrets wrapping the given driver.
func (*Secrets) CreateSecret ¶
func (s *Secrets) CreateSecret(ctx context.Context, config driver.SecretConfig, value []byte) (*driver.SecretInfo, error)
CreateSecret creates a new secret with an initial value.
func (*Secrets) DeleteSecret ¶
DeleteSecret deletes a secret.
func (*Secrets) GetSecretValue ¶
func (s *Secrets) GetSecretValue(ctx context.Context, name, versionID string) (*driver.SecretVersion, error)
GetSecretValue retrieves a secret value by version. Empty versionID returns the current version.
func (*Secrets) ListSecretVersions ¶
func (s *Secrets) ListSecretVersions(ctx context.Context, name string) ([]driver.SecretVersion, error)
ListSecretVersions lists all versions of a secret.
func (*Secrets) ListSecrets ¶
ListSecrets lists all secrets.
func (*Secrets) PutSecretValue ¶
func (s *Secrets) PutSecretValue(ctx context.Context, name string, value []byte) (*driver.SecretVersion, error)
PutSecretValue stores a new version of a secret value.