kv

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	API          api.API
	TokenManager auth.TokenManager
}

Client is the gateway into Vault's key-value secrets engine.

For more information, see https://www.vaultproject.io/docs/secrets/kv.

func (*Client) GetSecret

func (c *Client) GetSecret(ctx context.Context, secretPath string) (*Secret, error)

GetSecret retrieves the secret at the specified path and maps the data a struct at the provided address.

If a secret is not found at the provided path, nil will be returned for both the secret and error return values.

func (*Client) UpsertSecret

func (c *Client) UpsertSecret(ctx context.Context, secretPath string, secret map[string]interface{}) error

UpsertSecret creates or updates the secret at the specified path.

type Secret

type Secret struct {
	Data    map[string]interface{}
	Version int
}

Secret contains versioned, private information corresponding to a key in Vault's key-value engine.

Jump to

Keyboard shortcuts

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