subscription

package
v0.0.0-...-2140920 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskAggregateType string = "Task"
)

Variables

View Source
var (
	ErrUnknownEventType = errors.New("unknown event type")
)

Functions

func GetTopicName

func GetTopicName(eventStorePrefix string, aggregateType string) string

func NewSubscription

func NewSubscription(
	log logger.Logger,
	cfg *config.Config,
	eventSerializer *domain.EventSerializer,
	db *sql.DB,
) *subscription

func Unmarshal

func Unmarshal(data []byte, v any) error

Types

type AggregateType

type AggregateType string

AggregateType type of the Aggregate

type Event

type Event struct {
	EventID       string
	AggregateID   string
	EventType     EventType
	AggregateType AggregateType
	Version       uint64
	Data          []byte
	Metadata      []byte
	Timestamp     time.Time
}

Event is an internal representation of an event, returned when the Aggregate uses NewEvent to create a new event. The events loaded from the db is represented by each DBs internal event type, implementing Event.

type EventType

type EventType string

EventType is the type of any event, used as its unique identifier.

Jump to

Keyboard shortcuts

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