Documentation ¶
Index ¶
- Constants
- type Config
- type ContextProviderFunc
- type MongoStore
- func (ms *MongoStore) AddDepositAddress(id string, index uint64, depositAddress *store.StoredDepositAddress) error
- func (ms *MongoStore) AddPendingTransfer(id string, originTailTxHash trinary.Hash, bundleTrytes []trinary.Trytes, ...) error
- func (ms *MongoStore) AddTailHash(id string, originTailTxHash trinary.Hash, newTailTxHash trinary.Hash) error
- func (ms *MongoStore) ExportAccount(id string) (*store.ExportedAccountState, error)
- func (ms *MongoStore) GetDepositAddresses(id string) (map[uint64]*store.StoredDepositAddress, error)
- func (ms *MongoStore) GetPendingTransfers(id string) (map[string]*store.PendingTransfer, error)
- func (ms *MongoStore) ImportAccount(state store.ExportedAccountState) error
- func (ms *MongoStore) LoadAccount(id string) (*store.AccountState, error)
- func (ms *MongoStore) ReadIndex(id string) (uint64, error)
- func (ms *MongoStore) RemoveAccount(id string) error
- func (ms *MongoStore) RemoveDepositAddress(id string, index uint64) error
- func (ms *MongoStore) RemovePendingTransfer(id string, originTailTxHash trinary.Hash) error
- func (ms *MongoStore) WriteIndex(id string, index uint64) error
Constants ¶
View Source
const ( DefaultDBName = "iota_account" DefaultCollName = "accounts" DepositAddressesKey = "deposit_addresses" KeyIndexKey = "key_index" PendingTransfersKey = "pending_transfers" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The name of the database inside MongoDB. DBName string // The name of the collection in which to store accounts. CollName string // The context provider which gets called up on each MongoDB call // in order to determine the timeout/cancellation. ContextProvider ContextProviderFunc }
Config defines settings which are used in conjunction with MongoDB.
type ContextProviderFunc ¶
ContextProviderFunc which generates a new context.
type MongoStore ¶
type MongoStore struct {
// contains filtered or unexported fields
}
func NewMongoStore ¶
func NewMongoStore(uri string, cnf *Config, opts ...*options.ClientOptions) (*MongoStore, error)
NewMongoStore creates a new MongoDB store. If no MongoDB client options are defined, the client will be configured with a majority read/write concern, 5 sec. write concern timeout and journal write acknowledgement.
func (*MongoStore) AddDepositAddress ¶
func (ms *MongoStore) AddDepositAddress(id string, index uint64, depositAddress *store.StoredDepositAddress) error
func (*MongoStore) AddPendingTransfer ¶
func (*MongoStore) AddTailHash ¶
func (*MongoStore) ExportAccount ¶
func (ms *MongoStore) ExportAccount(id string) (*store.ExportedAccountState, error)
func (*MongoStore) GetDepositAddresses ¶
func (ms *MongoStore) GetDepositAddresses(id string) (map[uint64]*store.StoredDepositAddress, error)
func (*MongoStore) GetPendingTransfers ¶
func (ms *MongoStore) GetPendingTransfers(id string) (map[string]*store.PendingTransfer, error)
func (*MongoStore) ImportAccount ¶
func (ms *MongoStore) ImportAccount(state store.ExportedAccountState) error
func (*MongoStore) LoadAccount ¶
func (ms *MongoStore) LoadAccount(id string) (*store.AccountState, error)
func (*MongoStore) RemoveAccount ¶
func (ms *MongoStore) RemoveAccount(id string) error
func (*MongoStore) RemoveDepositAddress ¶
func (ms *MongoStore) RemoveDepositAddress(id string, index uint64) error
func (*MongoStore) RemovePendingTransfer ¶
func (ms *MongoStore) RemovePendingTransfer(id string, originTailTxHash trinary.Hash) error
func (*MongoStore) WriteIndex ¶
func (ms *MongoStore) WriteIndex(id string, index uint64) error
Click to show internal directories.
Click to hide internal directories.