retriever

package
v0.0.0-...-2646333 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package retriever contains all components for events retriever, which gets all past events

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRetriever

type EventRetriever struct {

	// PastEvents is a slice that holds all past Events requested
	PastEvents []*model.Event
	// contains filtered or unexported fields
}

EventRetriever handles the iterator returned from retrieving past events

func NewEventRetriever

func NewEventRetriever(client bind.ContractBackend, filterers []model.ContractFilterers) *EventRetriever

NewEventRetriever creates a EventRetriever given a list of ContractFilterers and connection to client

func (*EventRetriever) AddFilterers

func (r *EventRetriever) AddFilterers(w model.ContractFilterers) error

AddFilterers add filterers to the retriever

func (*EventRetriever) RemoveFilterers

func (r *EventRetriever) RemoveFilterers(w model.ContractFilterers) error

RemoveFilterers remove given filterers from the retriever

func (*EventRetriever) Retrieve

func (r *EventRetriever) Retrieve(nonSubOnly bool) error

Retrieve gets all events from StartBlock until now If nonSubOnly is true, retrieve only event types that are not subscribed to by the watchers. This is useful when polling for events alongside setting up watchers for events.

func (*EventRetriever) SortEventsByBlock

func (r *EventRetriever) SortEventsByBlock(events []*model.Event) error

SortEventsByBlock sorts events in PastEvents by block number NOTE(IS): This is not optimal, but for now checking that values exist outside of sort Pass in nil if you want to sort retriever.PastEvents

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL