vault

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Logger zerolog.Logger
	Storer providers.VaultStorer
}

Dependencies defines the dependencies for the plugin provider.

type KrokVault

type KrokVault struct {
	Dependencies

	sync.RWMutex
	// contains filtered or unexported fields
}

KrokVault is the vault used by Krok.

func NewKrokVault

func NewKrokVault(deps Dependencies) *KrokVault

NewKrokVault creates a vault which contains secrets. The format is: KEY=VALUE KEY2=VALUE2

func (*KrokVault) AddSecret

func (v *KrokVault) AddSecret(key string, value []byte)

AddSecret adds a value to the vault. Add will overwrite if the key already exists and not warn.

func (*KrokVault) DeleteSecret

func (v *KrokVault) DeleteSecret(key string)

DeleteSecret deletes a secret from the vault. DeleteSecret is a no-op if the data doesn't exist.

func (*KrokVault) GetSecret

func (v *KrokVault) GetSecret(key string) ([]byte, error)

GetSecret returns a value for a key. This operation is safe to use concurrently. Get will return an error if the data doesn't exist.

func (*KrokVault) ListSecrets

func (v *KrokVault) ListSecrets() []string

ListSecrets lists all secret names. Not the values.

func (*KrokVault) LoadSecrets

func (v *KrokVault) LoadSecrets() error

LoadSecrets unlocks the vault and loads in all secrets.

func (*KrokVault) SaveSecrets

func (v *KrokVault) SaveSecrets() error

SaveSecrets saves all the secrets to the vault. Persisting new values.

Jump to

Keyboard shortcuts

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