keystore

package
v0.0.0-...-2c2efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package keystore - keep secrets

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrKeyNotFound is returned when a key is not found in the store
	ErrKeyNotFound = errors.New("Key not found")
)

Functions

This section is empty.

Types

type FileStore

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

FileStore is the key Store implementation storing the keys in a file

func (*FileStore) Get

func (f *FileStore) Get(name string) ([]byte, error)

Get retrieves multiple keys

func (*FileStore) Set

func (f *FileStore) Set(name string, key []byte) error

Set stores multiple keys at once

type MemoryStore

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

MemoryStore is the in-memory implementation of key store

func (*MemoryStore) Get

func (f *MemoryStore) Get(name string) ([]byte, error)

Get retrieves multiple keys

func (*MemoryStore) Set

func (f *MemoryStore) Set(name string, key []byte) error

Set stores multiple keys at once

type Store

type Store interface {
	// Set stores multiple keys at once
	Set(name string, key []byte) error
	// Get retrieves multiple keys
	Get(name string) ([]byte, error)
}

Store is the keystore interface

func NewFileStore

func NewFileStore(filePath string) (Store, error)

NewFileStore creates a new FileStore

func NewMemoryStore

func NewMemoryStore() (Store, error)

NewMemoryStore creates a new MemoryStore

Jump to

Keyboard shortcuts

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