eventreader

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventReader

type EventReader struct {
	// contains filtered or unexported fields
}

EventReader reads MntpSwap contract logs and filters fresh events. Posts the fresh events to the specified channel (to the swapper)

func New

func New(
	c *swapcontract.Contract,
	d db.DAO,
	chNewSwaps chan<- *types.Swap,
	logger *logrus.Entry,
) (*EventReader, error)

New instance

func (*EventReader) AddMetrics

func (er *EventReader) AddMetrics(m *Metrics)

AddMetrics adds metrics counters and should be called before service launch

func (*EventReader) Task

func (er *EventReader) Task(token *gotask.Token)

Task loop

type Metrics

type Metrics struct {
	LastBlock prometheus.Gauge
	Events    prometheus.Counter
}

Metrics data

Jump to

Keyboard shortcuts

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