secrets

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package secrets provides a portable secret management API with cross-cutting concerns.

Index

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

func WithErrorInjection(i *inject.Injector) Option

WithErrorInjection sets the error injector.

func WithLatency

func WithLatency(d time.Duration) Option

WithLatency sets simulated latency.

func WithMetrics

func WithMetrics(m *metrics.Collector) Option

WithMetrics sets the metrics collector.

func WithRateLimiter

func WithRateLimiter(l *ratelimit.Limiter) Option

WithRateLimiter sets the rate limiter.

func WithRecorder

func WithRecorder(r *recorder.Recorder) Option

WithRecorder sets the recorder.

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

func NewSecrets(d driver.Secrets, opts ...Option) *Secrets

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

func (s *Secrets) DeleteSecret(ctx context.Context, name string) error

DeleteSecret deletes a secret.

func (*Secrets) GetSecret

func (s *Secrets) GetSecret(ctx context.Context, name string) (*driver.SecretInfo, error)

GetSecret retrieves secret metadata.

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

func (s *Secrets) ListSecrets(ctx context.Context) ([]driver.SecretInfo, error)

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.

Directories

Path Synopsis
Package driver defines the interface for secret management service implementations.
Package driver defines the interface for secret management service implementations.

Jump to

Keyboard shortcuts

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