event

package
v5.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventHead                        = "head"
	EventBlock                       = "block"
	EventAttestation                 = "attestation"
	EventVoluntaryExit               = "voluntary_exit"
	EventBlsToExecutionChange        = "bls_to_execution_change"
	EventProposerSlashing            = "proposer_slashing"
	EventAttesterSlashing            = "attester_slashing"
	EventFinalizedCheckpoint         = "finalized_checkpoint"
	EventChainReorg                  = "chain_reorg"
	EventContributionAndProof        = "contribution_and_proof"
	EventLightClientFinalityUpdate   = "light_client_finality_update"
	EventLightClientOptimisticUpdate = "light_client_optimistic_update"
	EventPayloadAttributes           = "payload_attributes"
	EventBlobSidecar                 = "blob_sidecar"
	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