Documentation ¶
Overview ¶
Package scratch provides an in-memory store. It is ephemeral, and should not be used where accounts are required to be stored.
Index ¶
- func New() wtypes.Store
- type Store
- func (s *Store) Name() string
- func (s *Store) RetrieveAccount(walletID uuid.UUID, accountID uuid.UUID) ([]byte, error)
- func (s *Store) RetrieveAccounts(walletID uuid.UUID) <-chan []byte
- func (s *Store) RetrieveAccountsIndex(walletID uuid.UUID) ([]byte, error)
- func (s *Store) RetrieveBatch(_ context.Context, walletID uuid.UUID) ([]byte, error)
- func (s *Store) RetrieveWallet(walletName string) ([]byte, error)
- func (s *Store) RetrieveWalletByID(walletID uuid.UUID) ([]byte, error)
- func (s *Store) RetrieveWallets() <-chan []byte
- func (s *Store) StoreAccount(walletID uuid.UUID, accountID uuid.UUID, data []byte) error
- func (s *Store) StoreAccountsIndex(walletID uuid.UUID, data []byte) error
- func (s *Store) StoreBatch(_ context.Context, walletID uuid.UUID, _ string, data []byte) error
- func (s *Store) StoreWallet(walletID uuid.UUID, _ string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the store for the wallet.
func (*Store) RetrieveAccount ¶
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) RetrieveAccountsIndex ¶ added in v1.3.0
RetrieveAccountsIndex retrieves the account index.
func (*Store) RetrieveBatch ¶ added in v1.7.2
RetrieveBatch retrieves the batch of accounts for a given wallet.
func (*Store) RetrieveWallet ¶
RetrieveWallet retrieves wallet-level data. It will fail if it cannot retrieve the data.
func (*Store) RetrieveWalletByID ¶ added in v1.2.0
RetrieveWalletByID 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 ¶
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) StoreAccountsIndex ¶ added in v1.3.0
StoreAccountsIndex stores the account index.
func (*Store) StoreBatch ¶ added in v1.7.2
StoreBatch stores wallet batch data. It will fail if it cannot store the data.