Help us shape the future of Go! Take the 2026 Go Developer Survey

secret

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSecreter

func RegisterSecreter(reg SecreterRegistration)

func RegisteredSecreterNames

func RegisteredSecreterNames() []string

Types

type Secreter

type Secreter interface {
	// Returns the value and an opaque version, which is empty without change detection
	Lookup(ctx context.Context, key string) (string, string, error)

	// Versions match keys positionally. An empty version means the key can't be watched
	Check(ctx context.Context, keys []string) ([]string, error)
}

Resolves secret references in configuration. Implementations holding resources may implement lifecycle.Closer

type SecreterDeps added in v0.11.0

type SecreterDeps struct {
	ErrorMessages config.ErrorMessages
	// Rebuilds the entity generation when a watched secret rotates. Nil disables watching
	ReloadFunc func(reason string)
}

New dependencies are added as fields so the Initialize signature stays stable

type SecreterRegistration

type SecreterRegistration interface {
	Name() string
	Initialize(config any, deps SecreterDeps) (Secreter, error)
	InitializeConfig() any
	// Max keys per Check call. 0 means the backend can't be watched
	CheckBatchSize() int
}

func RegisteredSecreter

func RegisteredSecreter(name string) (SecreterRegistration, bool)

Jump to

Keyboard shortcuts

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