kv

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPathNotFound is raised when given secret path doesn't exists.
	ErrPathNotFound = errors.New("path not found")
	// ErrNoData is raised when gievn secret path doesn't contains data.
	ErrNoData = errors.New("no data")
)

Functions

func SecretGetter

func SecretGetter(client *api.Client) func(string) (map[string]interface{}, error)

SecretGetter pull a secret from Vault using given path.

To be used of template function.

Types

type SecretLister

type SecretLister interface {
	List(ctx context.Context, path string) ([]string, error)
}

SecretLister repesents secret key listing feature contract.

type SecretReader

type SecretReader interface {
	Read(ctx context.Context, path string) (Secrets, error)
}

SecretReader represents secret reader feature contract.

type SecretWriter

type SecretWriter interface {
	Write(ctx context.Context, path string, secrets Secrets) error
}

SecretWriter represents secret writer feature contract.

type Secrets

type Secrets map[string]interface{}

Secrets is a secret body

type Service

type Service interface {
	SecretLister
	SecretReader
	SecretWriter
}

Service declares vault service contract.

func New

func New(client *api.Client, path string) (Service, error)

New build a KV service according to mountPath version.

func V1

func V1(l logical.Logical, mountPath string) Service

V1 returns a K/V v1 backend service instance.

func V2

func V2(l logical.Logical, mountPath string) Service

V2 returns a K/V v2 backend service instance.

Jump to

Keyboard shortcuts

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