eventflux

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 12 Imported by: 0

README

EventFlux

EventFlux allows the creation of synchronized event stores using a message bus like NATS. With EventFlux, you can easily handle and manage events, enabling seamless communication between different components of your system.

Every store is independent but synchronizes contained events with other stores. This allows for the creation of local projections without the need to read data from a store connected via a message bus. The data is replicated to ensure synchronization.

License

EventFlux is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTypedMessageBus

func NewTypedMessageBus(
	bus fluxcore.MessageBus,
) *typedMessageBus

Types

type MessageBaseEvent

type MessageBaseEvent struct {
	StoreId       fluxcore.StoreId
	StoreMetadata fluxcore.Metadata
}

func FromSubStore

func FromSubStore(subStore fluxcore.SubStore) MessageBaseEvent

type MessageCommittedEvent added in v0.0.2

type MessageCommittedEvent struct {
	MessageBaseEvent
	core.Event
}

func (*MessageCommittedEvent) Type added in v0.0.2

func (m *MessageCommittedEvent) Type() string

type MessageHeartBeat

type MessageHeartBeat struct {
	MessageBaseEvent
	LastVersion core.Version
}

func (*MessageHeartBeat) Type

func (m *MessageHeartBeat) Type() string

type MessageRequestResync

type MessageRequestResync struct {
	MessageBaseEvent
	From core.Version
}

func (*MessageRequestResync) Type

func (m *MessageRequestResync) Type() string

type MessageResyncEvents

type MessageResyncEvents struct {
	MessageBaseEvent
	Events []core.Event
}

func (*MessageResyncEvents) Type

func (m *MessageResyncEvents) Type() string

type Option

type Option func(*Stores)

func WithHeartBeatInterval added in v0.0.2

func WithHeartBeatInterval(d time.Duration) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

type Stores

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

func NewStores

func NewStores(
	ctx context.Context,
	manager fluxcore.StoreManager,
	mb fluxcore.MessageBus,
	opts ...Option,
) (*Stores, error)

type Typer

type Typer interface {
	Type() string
}

Directories

Path Synopsis
cmd
example command
store

Jump to

Keyboard shortcuts

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