event

package
v6.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventHead = "head"

	EventError           = "error"
	EventConnectionError = "connection_error"
)

Variables

View Source
var DefaultEventTopics = []string{EventHead}

Functions

This section is empty.

Types

type Event

type Event struct {
	EventType string
	Data      []byte
}

type EventStream

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

EventStream is responsible for subscribing to the Beacon API events endpoint and dispatching received events to subscribers.

func NewEventStream

func NewEventStream(ctx context.Context, httpClient *http.Client, host string, topics []string) (*EventStream, error)

func (*EventStream) Subscribe

func (h *EventStream) Subscribe(eventsChannel chan<- *Event)

type EventStreamClient

type EventStreamClient interface {
	Subscribe(eventsChannel chan<- *Event)
}

Jump to

Keyboard shortcuts

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