publisher

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerTag = "EVENT_PUBLISHER"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Providers is a list of event providers.
	Providers []EventProvider

	// EventSigner is a list of Signers used to sign events.
	Signers []EventSigner

	// Transport is used to send events to the Oracle network.
	Transport transport.Transport

	// Logger is a current logger interface used by the EventPublisher.
	Logger log.Logger
}

Config is the configuration for the EventPublisher.

type EventProvider added in v0.6.0

type EventProvider interface {
	Start(ctx context.Context) error
	Events() chan *messages.Event
}

EventProvider provides events to EventPublisher.

type EventPublisher

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

EventPublisher collects event messages from event providers, signs them and publishes them using the transport interface.

func New

func New(cfg Config) (*EventPublisher, error)

New returns a new instance of the EventPublisher struct.

func (*EventPublisher) Start

func (l *EventPublisher) Start(ctx context.Context) error

Start implements the supervisor.Service interface.

func (*EventPublisher) Wait

func (l *EventPublisher) Wait() <-chan error

Wait implements the supervisor.Service interface.

type EventSigner added in v0.7.1

type EventSigner interface {
	Sign(event *messages.Event) (bool, error)
}

EventSigner signs events.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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