Documentation
¶
Index ¶
- Variables
- type Cache
- type Config
- type InMemoryCache
- func (cache *InMemoryCache) AddBlock(blockNum string, block ethereum.Block) error
- func (cache *InMemoryCache) AddTx(tx ethereum.Transaction) error
- func (cache *InMemoryCache) GetBlock(blockNum string) (ethereum.Block, error)
- func (cache *InMemoryCache) GetBlockProcessed(blockNum string) (bool, error)
- func (cache *InMemoryCache) GetTx(hash string) (ethereum.Transaction, error)
- func (cache *InMemoryCache) SetBlockProcessed(blockNum string) error
- func (cache *InMemoryCache) Subscribe(address string) error
- func (cache *InMemoryCache) TxForAddress(address string) ([]ethereum.Transaction, error)
- func (cache *InMemoryCache) Unsubscribe(address string) error
- type Notifier
- type RPCClient
- type State
- type TxNotFoundError
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadFormat = errors.New("invalid string format, expected '0x' prefix")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
AddBlock(blockNum string, block ethereum.Block) error
GetBlock(blockNum string) (ethereum.Block, error)
GetBlockProcessed(blockNum string) (bool, error)
SetBlockProcessed(blockNum string) error
AddTx(tx ethereum.Transaction) error
GetTx(hash string) (ethereum.Transaction, error)
TxForAddress(address string) ([]ethereum.Transaction, error)
Subscribe(address string) error
Unsubscribe(address string) error
}
type InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
func NewInMemoryCache ¶
func NewInMemoryCache() *InMemoryCache
func (*InMemoryCache) AddBlock ¶
func (cache *InMemoryCache) AddBlock(blockNum string, block ethereum.Block) error
func (*InMemoryCache) AddTx ¶
func (cache *InMemoryCache) AddTx(tx ethereum.Transaction) error
func (*InMemoryCache) GetBlock ¶
func (cache *InMemoryCache) GetBlock(blockNum string) (ethereum.Block, error)
func (*InMemoryCache) GetBlockProcessed ¶
func (cache *InMemoryCache) GetBlockProcessed(blockNum string) (bool, error)
func (*InMemoryCache) GetTx ¶
func (cache *InMemoryCache) GetTx(hash string) (ethereum.Transaction, error)
func (*InMemoryCache) SetBlockProcessed ¶
func (cache *InMemoryCache) SetBlockProcessed(blockNum string) error
func (*InMemoryCache) Subscribe ¶
func (cache *InMemoryCache) Subscribe(address string) error
func (*InMemoryCache) TxForAddress ¶
func (cache *InMemoryCache) TxForAddress(address string) ([]ethereum.Transaction, error)
func (*InMemoryCache) Unsubscribe ¶
func (cache *InMemoryCache) Unsubscribe(address string) error
type Notifier ¶
type Notifier interface {
Notify(address string, txList []ethereum.Transaction)
}
type TxNotFoundError ¶
type TxNotFoundError struct {
// contains filtered or unexported fields
}
func (TxNotFoundError) Error ¶
func (e TxNotFoundError) Error() string
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
NewWatcher initializes a new Watcher instance with a JSON-RPC client, logger, in-memory cache, and notifier.
Click to show internal directories.
Click to hide internal directories.