publisher

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package publisher provides interfaces and implementations for publishing Merkle DAG nodes to external event streaming systems.

Index

Constants

View Source
const (
	// SchemaNodeV1 is the schema identifier for node publish events.
	SchemaNodeV1 = "tapes.node.v1"
)

Variables

View Source
var ErrEmptyRootHash = errors.New("cannot create event with empty root hash")

ErrEmptyRootHash indicates an empty root hash was provided where a value is required.

View Source
var ErrNilNode = errors.New("cannot create event from nil node")

ErrNilNode indicates a nil node was provided where a value is required.

Functions

This section is empty.

Types

type Event

type Event struct {
	Schema     string      `json:"schema"`
	RootHash   string      `json:"root_hash"`
	OccurredAt time.Time   `json:"occurred_at"`
	Node       merkle.Node `json:"node"`
}

Event is the publish payload for a single Merkle node.

func NewEvent

func NewEvent(rootHash string, node *merkle.Node) (*Event, error)

NewEvent creates an Event from a Merkle node.

type Publisher

type Publisher interface {
	// Publish publishes one event.
	Publish(ctx context.Context, event *Event) error

	// Close releases any resources held by the publisher.
	Close() error
}

Publisher publishes events to an external sink.

Directories

Path Synopsis
Package kafka provides a Kafka-backed Publisher implementation.
Package kafka provides a Kafka-backed Publisher implementation.

Jump to

Keyboard shortcuts

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