Documentation ¶
Index ¶
- func NewDefault(conf *superwatcher.Config, ethClient superwatcher.EthClient, ...) (superwatcher.Emitter, superwatcher.Engine)
- func NewEmitter(conf *superwatcher.Config, client superwatcher.EthClient, ...) superwatcher.Emitter
- func NewEmitterClient(conf *superwatcher.Config, syncChan chan<- struct{}, ...) superwatcher.EmitterClient
- func NewEmitterClientOptions(options ...Option) superwatcher.EmitterClient
- func NewEmitterOptions(options ...Option) superwatcher.Emitter
- func NewEmitterWithPoller(conf *superwatcher.Config, client superwatcher.EthClient, ...) superwatcher.Emitter
- func NewEngine(emitterClient superwatcher.EmitterClient, ...) superwatcher.Engine
- func NewEngineOptions(options ...Option) superwatcher.Engine
- func NewEngineWithEmitterClient(conf *superwatcher.Config, serviceEngine superwatcher.ServiceEngine, ...) superwatcher.Engine
- func NewPoller(addresses []common.Address, topics [][]common.Hash, doReorg bool, ...) superwatcher.EmitterPoller
- func NewPollerOptions(options ...Option) superwatcher.EmitterPoller
- func NewSuperWatcher(emitter superwatcher.Emitter, engine superwatcher.Engine, logLevel uint8) superwatcher.SuperWatcher
- func NewSuperWatcherDefault(conf *superwatcher.Config, ethClient superwatcher.EthClient, ...) superwatcher.SuperWatcher
- func NewSuperWatcherOptions(options ...Option) superwatcher.SuperWatcher
- func NewThinEngine(emitterClient superwatcher.EmitterClient, ...) superwatcher.Engine
- func NewThinEngineWithEmitter(conf *superwatcher.Config, ...) (superwatcher.Emitter, superwatcher.Engine)
- type Option
- func WithAddresses(addresses ...common.Address) Option
- func WithConfig(conf *superwatcher.Config) Option
- func WithDoHeader(doHeader bool) Option
- func WithDoReorg(doReorg bool) Option
- func WithErrChan(errChan chan error) Option
- func WithEthClient(client superwatcher.EthClient) Option
- func WithFilterRange(filterRange uint64) Option
- func WithFilterResultChan(resultChan chan *superwatcher.PollerResult) Option
- func WithGetStateDataGateway(gateway superwatcher.GetStateDataGateway) Option
- func WithLogLevel(level uint8) Option
- func WithPolicy(level superwatcher.Policy) Option
- func WithServiceEngine(service superwatcher.ServiceEngine) Option
- func WithSetStateDataGateway(gateway superwatcher.SetStateDataGateway) Option
- func WithSyncChan(syncChan chan struct{}) Option
- func WithTopics(topics ...[]common.Hash) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefault ¶
func NewDefault( conf *superwatcher.Config, ethClient superwatcher.EthClient, getStateDataGateway superwatcher.GetStateDataGateway, setStateDataGateway superwatcher.SetStateDataGateway, serviceEngine superwatcher.ServiceEngine, addresses []common.Address, topics [][]common.Hash, ) ( superwatcher.Emitter, superwatcher.Engine, )
NewDefault returns default implementations of Emitter and Engine. The EmitterClient is initialized and embedded to the returned engine within this function. This is the preferred way for initializing superwatcher components. If you don't need to interact with these components, you can use `NewSuperWatcherDefault` instead.
func NewEmitter ¶
func NewEmitter( conf *superwatcher.Config, client superwatcher.EthClient, stateDataGateway superwatcher.GetStateDataGateway, poller superwatcher.EmitterPoller, syncChan <-chan struct{}, pollResultChan chan<- *superwatcher.PollerResult, errChan chan<- error, ) superwatcher.Emitter
func NewEmitterClient ¶
func NewEmitterClient( conf *superwatcher.Config, syncChan chan<- struct{}, pollResultChan <-chan *superwatcher.PollerResult, errChan <-chan error, ) superwatcher.EmitterClient
func NewEmitterClientOptions ¶
func NewEmitterClientOptions(options ...Option) superwatcher.EmitterClient
func NewEmitterOptions ¶
func NewEmitterOptions(options ...Option) superwatcher.Emitter
func NewEmitterWithPoller ¶
func NewEmitterWithPoller( conf *superwatcher.Config, client superwatcher.EthClient, stateDataGateway superwatcher.GetStateDataGateway, addresses []common.Address, topics [][]common.Hash, syncChan <-chan struct{}, pollResultChan chan<- *superwatcher.PollerResult, errChan chan<- error, ) superwatcher.Emitter
NewWithPoller returns a new, default Emitter, with a default WatcherPoller. It is the preferred way to init a Emitter if you have not implement WatcherPoller yet yourself.
func NewEngine ¶
func NewEngine( emitterClient superwatcher.EmitterClient, serviceEngine superwatcher.ServiceEngine, stateDataGateway superwatcher.SetStateDataGateway, logLevel uint8, ) superwatcher.Engine
func NewEngineOptions ¶
func NewEngineOptions(options ...Option) superwatcher.Engine
func NewEngineWithEmitterClient ¶
func NewEngineWithEmitterClient( conf *superwatcher.Config, serviceEngine superwatcher.ServiceEngine, stateDataGateway superwatcher.SetStateDataGateway, syncChan chan<- struct{}, pollResultChan <-chan *superwatcher.PollerResult, errChan <-chan error, ) superwatcher.Engine
NewEngineWithEmitterClient creates a new superwatcher.Engine, and pair it with an superwatcher.EmitterClient. This is the preferred way of creating a new superwatcher.Engine
func NewPoller ¶
func NewPoller( addresses []common.Address, topics [][]common.Hash, doReorg bool, doHeader bool, filterRange uint64, client superwatcher.EthClient, logLevel uint8, policy superwatcher.Policy, ) superwatcher.EmitterPoller
func NewPollerOptions ¶
func NewPollerOptions(options ...Option) superwatcher.EmitterPoller
func NewSuperWatcher ¶
func NewSuperWatcher( emitter superwatcher.Emitter, engine superwatcher.Engine, logLevel uint8, ) superwatcher.SuperWatcher
func NewSuperWatcherDefault ¶
func NewSuperWatcherDefault( conf *superwatcher.Config, ethClient superwatcher.EthClient, getStateDataGateway superwatcher.GetStateDataGateway, setStateDataGateway superwatcher.SetStateDataGateway, serviceEngine superwatcher.ServiceEngine, addresses []common.Address, topics [][]common.Hash, ) superwatcher.SuperWatcher
func NewSuperWatcherOptions ¶
func NewSuperWatcherOptions(options ...Option) superwatcher.SuperWatcher
func NewThinEngine ¶
func NewThinEngine( emitterClient superwatcher.EmitterClient, serviceEngine superwatcher.ThinServiceEngine, stateDataGateway superwatcher.SetStateDataGateway, logLevel uint8, ) superwatcher.Engine
NewThinEngine returns thinEngine implementation of superwatcher.Engine
func NewThinEngineWithEmitter ¶
func NewThinEngineWithEmitter( conf *superwatcher.Config, getStateDataGateway superwatcher.GetStateDataGateway, setStateDataGateway superwatcher.SetStateDataGateway, addresses []common.Address, topics [][]common.Hash, client superwatcher.EthClient, policy superwatcher.Policy, serviceEngine superwatcher.ThinServiceEngine, ) (superwatcher.Emitter, superwatcher.Engine)
NewThinEngine creates an EmitterPoller and and an EmitterClient, before using the created objects to create new thinEngine implementation of superwatcher.Engine. The channels shared by emitterClient and thinEngine are created within the functions and kept private by the implementation.
Types ¶
type Option ¶
type Option func(*componentConfig)
func WithAddresses ¶
func WithConfig ¶
func WithConfig(conf *superwatcher.Config) Option
func WithDoHeader ¶
func WithDoReorg ¶
func WithErrChan ¶
func WithEthClient ¶
func WithEthClient(client superwatcher.EthClient) Option
func WithFilterRange ¶
func WithFilterResultChan ¶
func WithFilterResultChan(resultChan chan *superwatcher.PollerResult) Option
func WithGetStateDataGateway ¶
func WithGetStateDataGateway(gateway superwatcher.GetStateDataGateway) Option
func WithLogLevel ¶
func WithPolicy ¶
func WithPolicy(level superwatcher.Policy) Option
func WithServiceEngine ¶
func WithServiceEngine(service superwatcher.ServiceEngine) Option
func WithSetStateDataGateway ¶
func WithSetStateDataGateway(gateway superwatcher.SetStateDataGateway) Option
func WithSyncChan ¶
func WithSyncChan(syncChan chan struct{}) Option