Documentation
¶
Overview ¶
Package provider provides the building blocks for creating a provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupported = customerror.New("not supported", customerror.WithStatusCode(http.StatusBadRequest))
ErrNotSupported is the error returned when a provider does not support some operation, e.g., Load (read secrets).
Functions ¶
Types ¶
type IProvider ¶
type IProvider interface { // ExportToStruct exports the loaded configuration to the given struct. ExportToStruct(v any) error // GetName returns the name of the provider. GetName() string // GetLogger returns the logger. GetLogger() *logging.Logger // GetOverride returns the override flag. GetOverride() bool // GetRawValue returns the raw value flag. GetRawValue() bool // Load retrieves the configuration, and exports it to the environment. // // NOTE: Not all providers allow loading secrets, for example, GitHub. They // are designed to be write-only stores of information. This is a security // measure to prevent exposure of sensitive data. If that's the case, an // error ErrNotSupported is returned. Load(ctx context.Context, opts ...option.LoadKeyFunc) (map[string]string, error) // Write stores a new secret in the Vault. Write(ctx context.Context, values map[string]interface{}, opts ...option.WriteFunc) error }
IProvider defines what a provider does.
type Provider ¶
type Provider struct { // Logger is provider's logger. Logger *logging.Logger `json:"-" validate:"required"` // Name is the name of the provider. Name string `json:"name" validate:"required,gte=3,lte=50"` // Override is the flag that indicates if the provider should override // existing environment variables. Default is `false`. Override bool `json:"override"` // RawValue is the flag that indicates if the provider should not parse // (escaping sequence, etc) values. Default is `false`. RawValue bool `json:"rawValue"` }
Provider contains common settings for all providers.
func (*Provider) ExportToStruct ¶ added in v0.0.2
ExportToStruct exports the loaded configuration to the given struct.
func (*Provider) GetOverride ¶
GetOverride returns the override flag.
func (*Provider) GetRawValue ¶ added in v1.2.17
GetRawValue returns the raw value flag.
Click to show internal directories.
Click to hide internal directories.