Documentation
¶
Index ¶
- Variables
- type Storage
- func (s *Storage) CheckNonce(idPair publicwallets.KeyIDPair, nonce uint64) error
- func (s *Storage) Get(idPair publicwallets.KeyIDPair) (*publicwallets.Wallet, error)
- func (s *Storage) GetWallets() []*publicwallets.Wallet
- func (s *Storage) Nonce(idPair publicwallets.KeyIDPair) (uint64, error)
- func (s *Storage) Remove(idPair publicwallets.KeyIDPair) bool
- func (s *Storage) Store(wallet *publicwallets.Wallet) error
- func (s *Storage) UpdateNonce(idPair publicwallets.KeyIDPair, nonce uint64)
- func (s *Storage) WalletExists(idPair publicwallets.KeyIDPair) bool
- func (s *Storage) WalletExistsPermanent(idPair publicwallets.KeyIDPair) bool
Constants ¶
This section is empty.
Variables ¶
var ErrWalletNonExistent = errors.New("wallet non-existent")
Functions ¶
This section is empty.
Types ¶
type Storage ¶
func InitializeStorage ¶
func InitializeStorage() *Storage
InitializeStorage returns an empty wallet storage instance.
func (*Storage) CheckNonce ¶
func (s *Storage) CheckNonce(idPair publicwallets.KeyIDPair, nonce uint64) error
CheckNonce ensures the provided nonce is newer than the stored one.
s.RWMutex RLock should be used when calling this method.
func (*Storage) Get ¶
func (s *Storage) Get(idPair publicwallets.KeyIDPair) (*publicwallets.Wallet, error)
Get retrieves a copy of the wallet or returns ErrWalletNonExistent.
s.RWMutex RLock should be used when calling this method.
func (*Storage) GetWallets ¶
func (s *Storage) GetWallets() []*publicwallets.Wallet
GetWallets returns deep copies of all stored wallets.
s.RWMutex RLock should be used when calling this method.
func (*Storage) Nonce ¶
func (s *Storage) Nonce(idPair publicwallets.KeyIDPair) (uint64, error)
Nonce returns the stored nonce for the wallet.
s.RWMutex RLock should be used when calling this method.
func (*Storage) Remove ¶
func (s *Storage) Remove(idPair publicwallets.KeyIDPair) bool
Remove deletes the wallet entry for the given identifier pair.
s.RWMutex Lock should be used when calling this method.
func (*Storage) Store ¶
func (s *Storage) Store(wallet *publicwallets.Wallet) error
Store adds the wallet to storage while preserving status state.
s.RWMutex Lock should be used when calling this method.
func (*Storage) UpdateNonce ¶
func (s *Storage) UpdateNonce(idPair publicwallets.KeyIDPair, nonce uint64)
UpdateNonce sets the wallet's nonce to the provided value.
s.RWMutex Lock should be used when calling this method.
func (*Storage) WalletExists ¶
func (s *Storage) WalletExists(idPair publicwallets.KeyIDPair) bool
WalletExists reports whether the wallet is present in storage.
s.RWMutex RLock should be used when calling this method.
func (*Storage) WalletExistsPermanent ¶
func (s *Storage) WalletExistsPermanent(idPair publicwallets.KeyIDPair) bool
WalletExistsPermanent reports whether the wallet is present in permanent storage.
s.RWMutex RLock should be used when calling this method.