event

package
v0.0.0-...-bc1f52c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package event implements an event streaming platform to communcate to 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 config.Trace, logs *zap.Logger) func(*Event)

Types

type Event

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

Event represent a new adapter Event.

func New

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

func (*Event) CloseReaders

func (e *Event) CloseReaders()

CloseReaders must close all readers.

func (*Event) CloseTraceReader

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

CloseTraceReader must close trace reader.

func (*Event) NewBlockReader

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

func (*Event) NewReader

func (e *Event) NewReader() chan Message

func (*Event) NewTraceReader

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

func (*Event) Push

func (e *Event) Push(m Message)

func (*Event) PushBlock

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

func (*Event) PushTrace

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

type EventType

type EventType int

EventType represent a message event type.

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

func (EventType) String

func (e EventType) String() string

type Message

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

Message represent a message push on a channel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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