mem

package
v0.0.0-...-02d3d6b Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mem is an in-memory implementation of the `key.Storage` interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStorage

type KeyStorage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

KeyStorage implements the key.Storage interface using memory as the storage device. Retrival and creation of keys on KeyStorage is the thread-safe.

func (*KeyStorage) Create

func (s *KeyStorage) Create(alg string, opts key.Opts) (*key.Key, error)

Create inserts a new key of type alg in memory.

func (*KeyStorage) Get

func (s *KeyStorage) Get(id string) (*key.Key, error)

Get retrieves a key identified by id from memory.

func (*KeyStorage) Open

func (s *KeyStorage) Open(config []byte) error

Open initializes a new in-memory `KeyStorage`. The config is not used and can be left empty.

Jump to

Keyboard shortcuts

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