Documentation
¶
Overview ¶
Package secret implements an agent to read and reload the secrets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadSecrets ¶
func LoadSecrets(paths []string) (map[string][]byte, error)
LoadSecrets loads multiple paths of secrets and add them in a map.
func LoadSingleSecret ¶
func LoadSingleSecret(path string) ([]byte, error)
LoadSingleSecret reads and returns the value of a single file.
Types ¶
type Agent ¶
type Agent struct {
sync.RWMutex
// contains filtered or unexported fields
}
Agent watches a path and automatically loads the secrets stored.
func (*Agent) GetSecret ¶
func (a *Agent) GetSecret(secretPath string) []byte
GetSecret returns the value of a secret stored in a map.
func (*Agent) GetTokenGenerator ¶
func (a *Agent) GetTokenGenerator(secretPath string) func() []byte
GetTokenGenerator returns a function that gets the value of a given secret.
Click to show internal directories.
Click to hide internal directories.