eventflux

package module
v0.0.0-...-073cc3e Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 13 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 map[string]string
}

func FromSubStore

func FromSubStore(subStore fluxcore.SubStore) MessageBaseEvent

type MessageCommitedEvent

type MessageCommitedEvent struct {
	MessageBaseEvent
	core.Event
}

func (*MessageCommitedEvent) Type

func (m *MessageCommitedEvent) 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 WithLogger

func WithLogger(logger *slog.Logger) Option

type Stores

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

func NewStores

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

func (*Stores) LocalStore

func (s *Stores) LocalStore() fluxcore.SubStore

type Typer

type Typer interface {
	Type() string
}

Directories

Path Synopsis
cmd
store

Jump to

Keyboard shortcuts

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