wire

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 1 Imported by: 0

README

wire

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Sender() []byte
	Equal(Event) bool
}

The Event is an Entity that represents the Messages traveling on the EventBus. It would normally present always the same fields.

type EventCollector

type EventCollector interface {
	Collect(bytes.Buffer) error
}

EventCollector is the interface for collecting Events. Pretty much processors involves some degree of Event collection (either until a Quorum is reached or until a Timeout). This Interface is typically implemented by a struct that will perform some Event unmarshaling.

type EventDeserializer

type EventDeserializer interface {
	Deserialize(*bytes.Buffer) (Event, error)
}

EventDeserializer is the interface for those struct that allows deserialization of an event from scratch.

type EventMarshaller

type EventMarshaller interface {
	Marshal(*bytes.Buffer, Event) error
}

EventMarshaller is the specular operation of an EventUnmarshaller. Following Golang's way of defining interfaces, it exposes a Marshal method which allows for flexibility and reusability across all the different components that need to read the buffer coming from the EventBus into different structs.

type EventPrioritizer

type EventPrioritizer interface {
	Priority(Event, Event) bool
}

EventPrioritizer is used by the EventSelector to prioritize events (normally to return the best collected after a timespan). Return true if the first element has priority over the second, false otherwise.

type EventUnMarshaller

type EventUnMarshaller interface {
	EventMarshaller
	EventUnmarshaller
}

EventUnMarshaller is a convenient interface providing both Marshaling and Unmarshaling capabilities.

type EventUnmarshaller

type EventUnmarshaller interface {
	Unmarshal(*bytes.Buffer, Event) error
}

EventUnmarshaller unmarshals an Event from a buffer. Following Golang's way of defining interfaces, it exposes an Unmarshal method which allows for flexibility and reusability across all the different components that need to read the buffer coming from the EventBus into different structs.

type EventVerifier

type EventVerifier interface {
	Verify(Event) error
}

EventVerifier is the interface to verify an Event.

type Store

type Store interface {
	Insert(Event, string) int
	Clear()
	Contains(Event, string) bool
	Get(string) []Event
	All() []Event
}

Store abstract retrieval of Events.

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

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