Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, factory RegistryFactory)
Register SecretBackend driver, should be call be driver when package import init, the name should be unique. Driver will be overwritten when register with same name, and the last registration will win.
Types ¶
type Holder ¶
type Holder struct {
// contains filtered or unexported fields
}
Holder is container that help you manager your secret driver.
func (*Holder) Add ¶
func (h *Holder) Add(name string, secretBackend SecretDriver)
func (*Holder) Get ¶
func (h *Holder) Get(name string) SecretDriver
type RegistryFactory ¶
type RegistryFactory func(config map[string]any) (SecretDriver, error)
type SecretDriver ¶
type SecretDriver interface { // Set store confId/value to actual Secret Backend, Secret Backend may convert confId/value to another form. Set(confID string, value string) error // Get lookup value for confId, Secret Backend may reconvert value if it converts value to another form when Set. Get(confID string) (string, error) // GetByParams lookup value for confId, Secret Backend may reconvert value if it converts value to another form when Set. GetByParams(confID string, params map[string]any) (string, error) // Close should free the SecretBackend resources. Close() error }
SecretDriver is actual secret manager system. It may be Vault, KMS, etc.
func NewSecretBackendWith ¶
func NewSecretBackendWith(name string, config map[string]any) (SecretDriver, error)
NewSecretBackendWith return a SecretBackend driver named params name. With a not-exist name, will return err.
Click to show internal directories.
Click to hide internal directories.