Documentation ¶
Index ¶
- func New(opts ...Option) (wtypes.Store, error)
- type Option
- type Store
- func (s *Store) Location() string
- 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(id uuid.UUID, _ string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new Amazon S3-compatible store. This takes the following options:
- region: a string specifying the Amazon S3 region, defaults to "us-east-1", set with WithRegion()
- id: a byte array specifying an identifying key for the store, defaults to nil, set with WithID()
- passphrase: a key used to encrypt all data written to the store, defaults to blank and no additional encryption
- bucket: the name of a bucket to create, defaults to one generated using the credentials and ID
- path: a path inside the bucket in which to place wallets, defaults to the root of the bucket
- endpoint: a URL for an S3-compatible service to use in place of S3 itself
- credentials ID: AWS access credentials ID
- credentials secret: AWS access credentials secret
If credentials are not supplied, the access credentials should be in a standard place, e.g. ~/.aws/credentials .
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option gives options to New.
func WithBucket ¶ added in v1.11.0
WithBucket sets the bucket for the store.
func WithCredentialsID ¶ added in v1.11.1
WithCredentialsID sets the credentials ID.
func WithCredentialsSecret ¶ added in v1.11.1
WithCredentialsSecret sets the credentials secret.
func WithEndpoint ¶ added in v1.11.0
WithEndpoint sets the endpoint for the store.
func WithPassphrase ¶
WithPassphrase sets the passphrase for the store.
func WithPath ¶ added in v1.11.0
WithPath sets the path for the store. If not supplied this will default to an accout-specific path.
func WithRegion ¶
WithRegion sets the AWS region for the store. This defaults to "us-east-1", and cannot be overridden by an empty string.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the store for the wallet held encrypted on Amazon S3.
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.5.0
RetrieveAccountsIndex retrieves the account index.
func (*Store) RetrieveBatch ¶ added in v1.12.0
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.3.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.5.0
StoreAccountsIndex stores the account index.
func (*Store) StoreBatch ¶ added in v1.12.0
StoreBatch stores wallet batch data. It will fail if it cannot store the data.
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.