Documentation
¶
Index ¶
- func New(opts ...Option) types.Store
- type Option
- type Store
- func (s *Store) Name() string
- func (s *Store) RetrieveAccount(walletID uuid.UUID, walletName string, accountName string) ([]byte, error)
- func (s *Store) RetrieveAccounts(id uuid.UUID, name string) <-chan []byte
- func (s *Store) RetrieveWallet(name string) ([]byte, error)
- func (s *Store) RetrieveWallets() <-chan []byte
- func (s *Store) StoreAccount(walletID uuid.UUID, walletName string, accountID uuid.UUID, accountName string, ...) error
- func (s *Store) StoreWallet(id uuid.UUID, name string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option gives options to New
func WithLocation ¶
WithLocation sets the on-filesystem location for the store.
func WithPassphrase ¶
WithPassphrase sets the encryption for the store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the store for the wallet.
func (*Store) RetrieveAccount ¶
func (s *Store) RetrieveAccount(walletID uuid.UUID, walletName string, accountName string) ([]byte, error)
RetrieveAccount retrieves account-level data. It will fail if it cannot retrieve the data.
func (*Store) RetrieveAccounts ¶
RetrieveAccounts retrieves all account-level data for a wallet.
func (*Store) RetrieveWallet ¶
RetrieveWallet retrieves wallet-level data. It will fail if it cannot retrieve the data.
func (*Store) RetrieveWallets ¶
RetrieveWallets retrieves wallet-level data for all wallets.
func (*Store) StoreAccount ¶
func (s *Store) StoreAccount(walletID uuid.UUID, walletName string, accountID uuid.UUID, accountName string, data []byte) error
StoreAccount stores an account. It will fail if it cannot store the data. Note this will overwrite an existing account with the same ID. It will not, however, allow multiple accounts with the same name to co-exist in the same wallet.
func (*Store) StoreWallet ¶
StoreWallet stores wallet-level data. It will fail if it cannot store the data. Note that this will overwrite any existing data; it is up to higher-level functions to check for the presence of a wallet with the wallet name and handle clashes accordingly.