event

package
v0.0.0-...-00b5140 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package event implements an event streaming platform to communicate and allow sharing of all events to different servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTraces

func WithTraces(cfg trace.Config, logs *zap.Logger) func(*Event)

WithTraces configures Event instance with tracing options.

Types

type Event

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

Event represents a new adapter Event.

func New

func New(options ...func(*Event)) *Event

New creates a new Event instance with optional configurations.

func (*Event) CloseReaders

func (e *Event) CloseReaders()

CloseReaders closes all message reader channels.

func (*Event) CloseTraceReader

func (e *Event) CloseTraceReader(c trace.Channel)

CloseTraceReader closes the trace reader channel.

func (*Event) NewBlockReader

func (e *Event) NewBlockReader() chan validator.Validator

NewBlockReader creates a new block reader channel.

func (*Event) NewReader

func (e *Event) NewReader() chan Message

NewReader creates a new message reader channel.

func (*Event) NewTraceReader

func (e *Event) NewTraceReader() *trace.Channel

NewTraceReader creates a new trace reader channel.

func (*Event) Push

func (e *Event) Push(m Message)

Push pushes a message onto the channel.

func (*Event) PushBlock

func (e *Event) PushBlock(block validator.Validator)

PushBlock pushes a block onto the channel.

func (*Event) PushTrace

func (e *Event) PushTrace(blockID string, state trace.State)

PushTrace pushes a trace onto the channel.

type EventType

type EventType int

EventType represents a message event type.

const (
	BlockChain EventType = iota
	BlockChainFull
	NewBlock
	Wallet
	Pool
	Files
	Address
)

Constants for different event types.

func (EventType) String

func (e EventType) String() string

type Message

type Message struct {
	Type  EventType
	ID    string
	Value []byte
}

Message represents a message pushed on a channel.

type Stub

type Stub struct{}

Stub event instance

func (*Stub) CloseReaders

func (m *Stub) CloseReaders()

func (*Stub) NewReader

func (m *Stub) NewReader() chan Message

func (*Stub) Push

func (m *Stub) Push(Message)

Directories

Path Synopsis
Package trace implements a tracing mechanism to track the state of blockchain events.
Package trace implements a tracing mechanism to track the state of blockchain events.

Jump to

Keyboard shortcuts

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