mem

package
v0.13.2 Latest Latest
Warning

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

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

Documentation

Overview

Package mem implements an in-memory key-value store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store added in v0.7.0

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory key-value store. Its zero value is ready to use.

func (*Store) Create added in v0.7.0

func (s *Store) Create(key, value string) error

Create adds the given key-value pair to the store if and only if no entry for key exists. If an entry already exists it returns kes.ErrKeyExists.

func (*Store) Delete added in v0.7.0

func (s *Store) Delete(key string) error

Delete removes the value for the given key, if it exists.

func (*Store) Get added in v0.7.0

func (s *Store) Get(key string) (string, error)

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

func (*Store) List added in v0.13.0

func (s *Store) List(ctx context.Context) (secret.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