generic

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Endpoint string // Endpoint of the KeyStore plugin / generic KeyStore.

	KeyPath  string // Path to the TLS client private key.
	CertPath string // Path to the TLS client certificate.
	CAPath   string // Path to one (or directory of) root CA certificates.

	// ErrorLog specifies an optional logger for errors.
	// If an unexpected error is encountered while trying
	// to fetch, store or delete a key or when an authentication
	// error happens then an error event is written to the error
	// log.
	//
	// If nil, logging is done via the log package's standard
	// logger.
	ErrorLog *log.Logger
	// contains filtered or unexported fields
}

Store is a generic KeyStore that stores/fetches keys from a v1 KeyStore plugin compatible service.

func (*Store) Authenticate

func (s *Store) Authenticate() error

func (*Store) Create

func (s *Store) Create(ctx context.Context, name string, key key.Key) error

Create creates the given key-value pair at the generic KeyStore if and only if the given key does not exist. If such an entry already exists it returns kes.ErrKeyExists.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, name string) error

Delete removes a the value associated with the given key from the generic KeyStore, if it exists.

func (*Store) Get

func (s *Store) Get(ctx context.Context, name string) (key.Key, error)

Get returns the value associated with the given key. If no entry for the key exists it returns kes.ErrKeyNotFound.

func (*Store) List

func (s *Store) List(ctx context.Context) (key.Iterator, error)

List returns a new Iterator over the names of all stored keys.

Jump to

Keyboard shortcuts

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