Documentation
¶
Overview ¶
Package secrettest provides test helpers for code that depends on the v2/secret package. Use MockProvider to supply known secret values in unit tests without touching the environment or the filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockProvider ¶
type MockProvider struct {
// contains filtered or unexported fields
}
MockProvider is a Provider implementation for use in tests. It returns values from a map supplied at construction time.
func NewMockProvider ¶
func NewMockProvider(secrets map[string]string) *MockProvider
NewMockProvider returns a MockProvider pre-loaded with the given secrets. Keys that are absent from the map cause Get to return an error wrapping secret.ErrNotFound.
Click to show internal directories.
Click to hide internal directories.