Documentation
¶
Index ¶
- type Callback
- type FileState
- type Processor
- type RedisConsumer
- func (r *RedisConsumer) ContractCancelled(ctx context.Context) (<-chan pkg.ContractCancelledEvent, error)
- func (r *RedisConsumer) ContractLocked(ctx context.Context) (<-chan pkg.ContractLockedEvent, error)
- func (r *RedisConsumer) PowerTargetChange(ctx context.Context) (<-chan pkg.PowerTargetChangeEvent, error)
- func (r *RedisConsumer) PublicConfig(ctx context.Context) (<-chan pkg.PublicConfigEvent, error)
- type RedisStream
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(events *substrate.EventRecords)
type FileState ¶
type FileState struct {
// contains filtered or unexported fields
}
func (*FileState) Get ¶
func (e *FileState) Get(cl *gsrpc.SubstrateAPI) (types.BlockNumber, error)
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Events processor receives all events starting from the given state and for each set of events calls callback cb
type RedisConsumer ¶
type RedisConsumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(address, id string) (*RedisConsumer, error)
NewConsumer creates a new event consumer on given redis address, and consumer id, consumer id has to be unique
func (*RedisConsumer) ContractCancelled ¶
func (r *RedisConsumer) ContractCancelled(ctx context.Context) (<-chan pkg.ContractCancelledEvent, error)
func (*RedisConsumer) ContractLocked ¶
func (r *RedisConsumer) ContractLocked(ctx context.Context) (<-chan pkg.ContractLockedEvent, error)
func (*RedisConsumer) PowerTargetChange ¶
func (r *RedisConsumer) PowerTargetChange(ctx context.Context) (<-chan pkg.PowerTargetChangeEvent, error)
func (*RedisConsumer) PublicConfig ¶
func (r *RedisConsumer) PublicConfig(ctx context.Context) (<-chan pkg.PublicConfigEvent, error)
type RedisStream ¶
type RedisStream struct {
// contains filtered or unexported fields
}
func NewRedisStream ¶
func (*RedisStream) Start ¶
func (r *RedisStream) Start(ctx context.Context)
type State ¶
type State interface { Set(num types.BlockNumber) error Get(cl *gsrpc.SubstrateAPI) (types.BlockNumber, error) }
State is used to track the blocks already processed by the processor
func NewFileState ¶
Click to show internal directories.
Click to hide internal directories.