event

package
v7.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Code generated by hack/gen-logs.sh; DO NOT EDIT. This file is created and regenerated automatically. Anything added here might get removed.

Index

Constants

View Source
const (
	EventHead                      = "head"
	EventHeadV2                    = "head_v2"
	EventExecutionPayloadAvailable = "execution_payload_available"

	EventError           = "error"
	EventConnectionError = "connection_error"
)

Variables

View Source
var (

	// LegacyEventTopicMapping maps newer event topics to their legacy equivalents for fallback purposes.
	LegacyEventTopicMapping = map[string]string{
		EventHeadV2: EventHead,
	}
	DefaultEventTopics = []string{EventHeadV2, EventExecutionPayloadAvailable}
)

Functions

func LegacyTopicFallback added in v7.1.7

func LegacyTopicFallback(topics []string) ([]string, bool)

LegacyTopicFallback returns topics with any topics in the input that have a legacy equivalent replaced by their legacy topic. Boolean return value indicates whether any replacements were made.

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) error

Subscribe opens the events stream and dispatches received events on eventsChannel until the context is canceled or an error ends the stream.

type EventStreamClient

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

Jump to

Keyboard shortcuts

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