nats

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	AddWallet(serviceTrans types.ServiceTransport, service string, callbackURL string, p ...mint.PublicKey) bool
	RemoveWallet(service string, p ...mint.PublicKey) bool
}

API provides API methods

type Metrics

type Metrics struct {
	RequestDuration      *prometheus.HistogramVec
	NotificationDuration prometheus.Histogram
}

Metrics data

type Nats

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

Nats is Nats server transport for service API

func New

func New(
	url string,
	subjPrefix string,
	api API,
	logger *logrus.Entry,
) (*Nats, func(), error)

New instance

func (*Nats) AddMetrics

func (n *Nats) AddMetrics(m *Metrics)

AddMetrics adds metrics counters and should be called before service launch

func (*Nats) NotifyRefilling

func (n *Nats) NotifyRefilling(service string, to, from mint.PublicKey, t mint.Token, a *amount.Amount, tx mint.Digest) error

NotifyRefilling sends an event

func (*Nats) Task

func (n *Nats) Task(token *gotask.Token)

Task loop

Jump to

Keyboard shortcuts

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