kv

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 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 SecretData added in v0.1.10

type SecretData map[string]interface{}

SecretData is a secret body

type SecretLister

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

SecretLister repesents secret key listing feature contract.

type SecretMetadata added in v0.1.10

type SecretMetadata map[string]interface{}

SecretMetadata is secret data attached metadata

type SecretReader

type SecretReader interface {
	Read(ctx context.Context, path string) (SecretData, SecretMetadata, error)
	ReadVersion(ctx context.Context, path string, version uint32) (SecretData, SecretMetadata, error)
}

SecretReader represents secret reader feature contract.

type SecretWriter

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

SecretWriter represents secret writer feature contract.

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