secretmanager

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoVersions = errors.New("no versions")

ErrNoVersions means the secret exists but it has no enabled versions

Functions

func SecretShortNames

func SecretShortNames(list []KVValue) []string

SecretShortNames reduces a list of KVValues to a list of short names

Types

type CatchAllClient

type CatchAllClient struct{}

CatchAllClient -

func (*CatchAllClient) Get

func (*CatchAllClient) Get(name string) (KVValue, error)

func (*CatchAllClient) ListKeys

func (*CatchAllClient) ListKeys() ([]KVValue, error)

func (*CatchAllClient) New

func (*CatchAllClient) New(name string, labels map[string]string) (KVValue, error)

type CatchAllFlexibleKVValue

type CatchAllFlexibleKVValue struct{}

CatchAllFlexibleKVValue -

func (*CatchAllFlexibleKVValue) GetFullName

func (*CatchAllFlexibleKVValue) GetFullName() string

func (*CatchAllFlexibleKVValue) GetLabels

func (*CatchAllFlexibleKVValue) GetLabels() map[string]string

func (*CatchAllFlexibleKVValue) GetShortName

func (*CatchAllFlexibleKVValue) GetShortName() string

func (*CatchAllFlexibleKVValue) GetValue

func (*CatchAllFlexibleKVValue) GetValue() ([]byte, error)

func (*CatchAllFlexibleKVValue) SetLabels

func (*CatchAllFlexibleKVValue) SetLabels(labels map[string]string) error

func (*CatchAllFlexibleKVValue) SetValue

func (*CatchAllFlexibleKVValue) SetValue([]byte) (string, error)

type KVClient

type KVClient interface {
	ListKeys() ([]KVValue, error)
	Get(name string) (KVValue, error)
	New(name string, labels map[string]string) (KVValue, error)
}

KVClient is a generic interface implemented by SecretManager and a mock

func NewClient

func NewClient(project string) (KVClient, error)

NewClient creates a new wrapped Secret Manager client

func NewInMemoryClient

func NewInMemoryClient(project string, keyValues ...string) KVClient

NewInMemoryClient creates a handy stand-in for Secret Manager (for example for mocking)

func NewOfflineClient

func NewOfflineClient(file, project string) (KVClient, error)

NewOfflineClient returns an "offline" implementation that uses a dot-env format input

type KVValue

type KVValue interface {
	GetFullName() string
	GetShortName() string
	GetValue() ([]byte, error)
	GetLabels() map[string]string
	SetLabels(labels map[string]string) error
	SetValue([]byte) (string, error)
}

KVValue represents a versions secret data storage

Directories

Path Synopsis
Singleflight is a small wrapper around KVClient that prevents concurrent requests on the same entities.
Singleflight is a small wrapper around KVClient that prevents concurrent requests on the same entities.

Jump to

Keyboard shortcuts

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