Documentation ¶
Index ¶
- type Reader
- func (s *Reader) CountAccounts(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountActivations(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountApps(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountBlocks(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountCoinbaseRewards(ctx context.Context, coinbase string) (total, count int64, err error)
- func (s *Reader) CountEpochSmeshers(ctx context.Context, query *bson.D) (int64, error)
- func (s *Reader) CountEpochs(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountLayers(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountReceivedTransactions(ctx context.Context, address string) (amount, count int64, err error)
- func (s *Reader) CountRewards(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountSentTransactions(ctx context.Context, address string) (amount, fees, count int64, err error)
- func (s *Reader) CountSmesherRewards(ctx context.Context, smesherID string) (total, count int64, err error)
- func (s *Reader) CountSmeshers(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) CountTransactions(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
- func (s *Reader) GetAccountSummary(ctx context.Context, address string) (*model.AccountSummary, error)
- func (s *Reader) GetAccounts(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Account, error)
- func (s *Reader) GetActivations(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Activation, error)
- func (s *Reader) GetApps(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.App, error)
- func (s *Reader) GetBlocks(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Block, error)
- func (s *Reader) GetEpoch(ctx context.Context, epochNumber int) (*model.Epoch, error)
- func (s *Reader) GetEpochSmeshers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Smesher, error)
- func (s *Reader) GetEpochs(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Epoch, error)
- func (s *Reader) GetFirstSentTransaction(ctx context.Context, address string) (*model.Transaction, error)
- func (s *Reader) GetLatestReward(ctx context.Context, coinbase string) (*model.Reward, error)
- func (s *Reader) GetLatestTransaction(ctx context.Context, address string) (*model.Transaction, error)
- func (s *Reader) GetLayer(ctx context.Context, layerNumber int) (*model.Layer, error)
- func (s *Reader) GetLayerTimestamp(layer uint32) uint32
- func (s *Reader) GetLayers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Layer, error)
- func (s *Reader) GetNetworkInfo(ctx context.Context) (*model.NetworkInfo, error)
- func (s *Reader) GetReward(ctx context.Context, rewardID string) (*model.Reward, error)
- func (s *Reader) GetRewardV2(ctx context.Context, smesherID string, layer uint32) (*model.Reward, error)
- func (s *Reader) GetRewards(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Reward, error)
- func (s *Reader) GetSmesher(ctx context.Context, smesherID string) (*model.Smesher, error)
- func (s *Reader) GetSmeshers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Smesher, error)
- func (s *Reader) GetTotalRewards(ctx context.Context, filter *bson.D) (total, count int64, err error)
- func (s *Reader) GetTransactions(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Transaction, error)
- func (s *Reader) Ping(ctx context.Context) error
- type StorageReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a wrapper around a mongo client. This client is read-only.
func NewStorageReader ¶
NewStorageReader creates a new storage reader.
func (*Reader) CountAccounts ¶
func (s *Reader) CountAccounts(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountAccounts returns the number of accounts matching the query.
func (*Reader) CountActivations ¶
func (s *Reader) CountActivations(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountActivations returns the number of activations matching the query.
func (*Reader) CountApps ¶
func (s *Reader) CountApps(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountApps returns the number of apps matching the query.
func (*Reader) CountBlocks ¶
func (s *Reader) CountBlocks(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountBlocks returns the number of blocks matching the query.
func (*Reader) CountCoinbaseRewards ¶ added in v1.2.0
func (s *Reader) CountCoinbaseRewards(ctx context.Context, coinbase string) (total, count int64, err error)
CountCoinbaseRewards returns the number of rewards for given coinbase address.
func (*Reader) CountEpochSmeshers ¶ added in v1.3.2
GetEpochSmeshers returns the smeshers for specific epoch
func (*Reader) CountEpochs ¶
func (s *Reader) CountEpochs(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountEpochs returns the number of epochs matching the query.
func (*Reader) CountLayers ¶
func (s *Reader) CountLayers(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountLayers returns the number of layers matching the query.
func (*Reader) CountReceivedTransactions ¶ added in v1.2.0
func (*Reader) CountRewards ¶
func (s *Reader) CountRewards(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountRewards returns the number of rewards matching the query.
func (*Reader) CountSentTransactions ¶ added in v1.2.0
func (*Reader) CountSmesherRewards ¶
func (s *Reader) CountSmesherRewards(ctx context.Context, smesherID string) (total, count int64, err error)
CountSmesherRewards returns the number of smesher rewards matching the query.
func (*Reader) CountSmeshers ¶
func (s *Reader) CountSmeshers(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountSmeshers returns the number of smeshers matching the query.
func (*Reader) CountTransactions ¶
func (s *Reader) CountTransactions(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error)
CountTransactions returns the number of transactions matching the query.
func (*Reader) GetAccountSummary ¶
func (s *Reader) GetAccountSummary(ctx context.Context, address string) (*model.AccountSummary, error)
GetAccountSummary returns the summary of the accounts matching the query. Not all accounts from api have filled this data.
func (*Reader) GetAccounts ¶
func (s *Reader) GetAccounts(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Account, error)
GetAccounts returns the accounts matching the query.
func (*Reader) GetActivations ¶
func (s *Reader) GetActivations(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Activation, error)
GetActivations returns the activations matching the query.
func (*Reader) GetApps ¶
func (s *Reader) GetApps(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.App, error)
GetApps returns the apps matching the query.
func (*Reader) GetBlocks ¶
func (s *Reader) GetBlocks(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Block, error)
GetBlocks returns the blocks matching the query.
func (*Reader) GetEpochSmeshers ¶ added in v1.3.2
func (s *Reader) GetEpochSmeshers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Smesher, error)
GetEpochSmeshers returns the smeshers for specific epoch
func (*Reader) GetEpochs ¶
func (s *Reader) GetEpochs(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Epoch, error)
GetEpochs returns the epochs matching the query.
func (*Reader) GetFirstSentTransaction ¶ added in v1.2.0
func (s *Reader) GetFirstSentTransaction(ctx context.Context, address string) (*model.Transaction, error)
GetFirstSentTransaction returns the first sent tx for given address
func (*Reader) GetLatestReward ¶ added in v1.2.0
GetLatestReward returns the latest reward for given coinbase
func (*Reader) GetLatestTransaction ¶ added in v1.2.0
func (s *Reader) GetLatestTransaction(ctx context.Context, address string) (*model.Transaction, error)
GetLatestTransaction returns the latest tx for given address
func (*Reader) GetLayerTimestamp ¶ added in v0.0.13
func (*Reader) GetLayers ¶
func (s *Reader) GetLayers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Layer, error)
GetLayers returns the layers matching the query.
func (*Reader) GetNetworkInfo ¶
GetNetworkInfo returns the network info matching the query.
func (*Reader) GetRewardV2 ¶ added in v1.6.7
func (*Reader) GetRewards ¶
func (s *Reader) GetRewards(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Reward, error)
GetRewards returns the rewards matching the query.
func (*Reader) GetSmesher ¶
GetSmesher returns the smesher matching the query.
func (*Reader) GetSmeshers ¶
func (s *Reader) GetSmeshers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Smesher, error)
GetSmeshers returns the smeshers matching the query.
func (*Reader) GetTotalRewards ¶ added in v1.2.0
func (s *Reader) GetTotalRewards(ctx context.Context, filter *bson.D) (total, count int64, err error)
GetTotalRewards returns the total number of rewards.
func (*Reader) GetTransactions ¶
func (s *Reader) GetTransactions(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Transaction, error)
GetTransactions returns the transactions matching the query.
type StorageReader ¶
type StorageReader interface { Ping(ctx context.Context) error GetNetworkInfo(ctx context.Context) (*model.NetworkInfo, error) CountTransactions(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetTransactions(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Transaction, error) CountSentTransactions(ctx context.Context, address string) (amount, fees, count int64, err error) CountReceivedTransactions(ctx context.Context, address string) (amount, count int64, err error) GetLatestTransaction(ctx context.Context, address string) (*model.Transaction, error) GetFirstSentTransaction(ctx context.Context, address string) (*model.Transaction, error) CountApps(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetApps(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.App, error) CountAccounts(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetAccounts(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Account, error) GetAccountSummary(ctx context.Context, address string) (*model.AccountSummary, error) CountActivations(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetActivations(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Activation, error) CountBlocks(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetBlocks(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Block, error) CountEpochs(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetEpochs(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Epoch, error) GetEpoch(ctx context.Context, epochNumber int) (*model.Epoch, error) CountLayers(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetLayers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Layer, error) GetLayer(ctx context.Context, layerNumber int) (*model.Layer, error) CountRewards(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) CountCoinbaseRewards(ctx context.Context, coinbase string) (total, count int64, err error) GetRewards(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Reward, error) GetReward(ctx context.Context, rewardID string) (*model.Reward, error) GetRewardV2(ctx context.Context, smesherID string, layer uint32) (*model.Reward, error) GetLatestReward(ctx context.Context, coinbase string) (*model.Reward, error) GetTotalRewards(ctx context.Context, filter *bson.D) (total, count int64, err error) CountSmeshers(ctx context.Context, query *bson.D, opts ...*options.CountOptions) (int64, error) GetSmeshers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Smesher, error) GetSmesher(ctx context.Context, smesherID string) (*model.Smesher, error) CountEpochSmeshers(ctx context.Context, query *bson.D) (int64, error) GetEpochSmeshers(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*model.Smesher, error) CountSmesherRewards(ctx context.Context, smesherID string) (total, count int64, err error) }
StorageReader is the interface for the storage reader. Providing ReadOnly methods.