stores/

directory
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: GPL-3.0

README

Blox Eth Key Manager - Stores

blox.io

Store is a place that saves and fetches data used by a portfolio,wallet and accounts. It also stores sensitive information like a seed.

Currently there are the following implementations:

  • In memory storage (mostly used for testing as a quick storage setup)
  • (Hashicorp's Vault)[https://www.vaultproject.io]
Develop you own store

You could develop you own store, for example saving it to an S3, local file system and so on. To implement a store, simple override the methods below from here

// Implements methods to store and retrieve data
// Any encryption is done on the implementation level but is not obligatory
type Storage interface {
	Name() string
	///*
	//	Wallet specific
	// */
	SaveWallet(wallet Wallet) error
	// will return nil,err if no wallet was found
	OpenWallet() (Wallet, error)
	// will return an empty array for no accounts
	ListAccounts() ([]ValidatorAccount, error)

	///*
	//	Account specific
	// */
	SaveAccount(account ValidatorAccount) error
	// will return nil,nil if no account was found
	OpenAccount(accountID uuid.UUID) (ValidatorAccount, error)

	// could also bee set to nil
	SetEncryptor(encryptor types.Encryptor, password []byte)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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