go-ethereum: github.com/ethereum/go-ethereum/signer/storage Index | Files

package storage

import "github.com/ethereum/go-ethereum/signer/storage"

Index

Package Files

aes_gcm_storage.go storage.go

Variables

var (
    // ErrZeroKey is returned if an attempt was made to inset a 0-length key.
    ErrZeroKey = errors.New("0-length key")

    // ErrNotFound is returned if an unknown key is attempted to be retrieved.
    ErrNotFound = errors.New("not found")
)

type AESEncryptedStorage Uses

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

AESEncryptedStorage is a storage type which is backed by a json-file. The json-file contains key-value mappings, where the keys are _not_ encrypted, only the values are.

func NewAESEncryptedStorage Uses

func NewAESEncryptedStorage(filename string, key []byte) *AESEncryptedStorage

NewAESEncryptedStorage creates a new encrypted storage backed by the given file/key

func (*AESEncryptedStorage) Del Uses

func (s *AESEncryptedStorage) Del(key string)

Del removes a key-value pair. If the key doesn't exist, the method is a noop.

func (*AESEncryptedStorage) Get Uses

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

Get returns the previously stored value, or an error if it does not exist or key is of 0-length.

func (*AESEncryptedStorage) Put Uses

func (s *AESEncryptedStorage) Put(key, value string)

Put stores a value by key. 0-length keys results in noop.

type EphemeralStorage Uses

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

EphemeralStorage is an in-memory storage that does not persist values to disk. Mainly used for testing

func (*EphemeralStorage) Del Uses

func (s *EphemeralStorage) Del(key string)

Del removes a key-value pair. If the key doesn't exist, the method is a noop.

func (*EphemeralStorage) Get Uses

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

Get returns the previously stored value, or an error if the key is 0-length or unknown.

func (*EphemeralStorage) Put Uses

func (s *EphemeralStorage) Put(key, value string)

Put stores a value by key. 0-length keys results in noop.

type NoStorage Uses

type NoStorage struct{}

NoStorage is a dummy construct which doesn't remember anything you tell it

func (*NoStorage) Del Uses

func (s *NoStorage) Del(key string)

func (*NoStorage) Get Uses

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

func (*NoStorage) Put Uses

func (s *NoStorage) Put(key, value string)

type Storage Uses

type Storage interface {
    // Put stores a value by key. 0-length keys results in noop.
    Put(key, value string)

    // Get returns the previously stored value, or an error if the key is 0-length
    // or unknown.
    Get(key string) (string, error)

    // Del removes a key-value pair. If the key doesn't exist, the method is a noop.
    Del(key string)
}

func NewEphemeralStorage Uses

func NewEphemeralStorage() Storage

Package storage imports 9 packages (graph) and is imported by 12 packages. Updated 2019-11-23. Refresh now. Tools for package owners.