watcher

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	EventDuration prometheus.Histogram
	ReceivedMNT   prometheus.Counter
	Events        prometheus.Counter
}

Metrics data

type Watcher

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

Watcher listens for a refill event from mint-sender (watcher) service, then checks if transaction sender is registered (swap prepared for that address) and saves a new deposit into DB

func New

func New(
	d db.DAO,
	swapAddress mint.PublicKey,
	alerter alert.Alerter,
	mintsenderURL, mintsenderPrefix, mintsenderService string,
	logger *logrus.Entry,
) (*Watcher, error)

New instance

func (*Watcher) AddMetrics

func (w *Watcher) AddMetrics(m *Metrics)

AddMetrics adds metrics counters and should be called before service launch

func (*Watcher) Close

func (w *Watcher) Close() error

Close instance

func (*Watcher) RegisterSwapAddress

func (w *Watcher) RegisterSwapAddress(addr ...mint.PublicKey) error

RegisterSwapAddress registers specified addresses on mint-sender (watcher) service

func (*Watcher) Task

func (w *Watcher) Task(token *gotask.Token)

Task loop

Jump to

Keyboard shortcuts

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