Documentation
¶
Overview ¶
Package eventmap provides code generation for mapping between domain events and pupsourcing event sourcing types (es.Event and es.PersistedEvent).
This package supports versioned events where directory structure determines event version (v1, v2, etc.), similar to protobuf package versioning.
The generated code is explicit, readable, and does not use runtime reflection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
InputDir string // Directory containing domain events
OutputDir string // Directory where generated code will be written
OutputFile string // Name of the generated file (default: event_mapping.gen.go)
PackageName string // Package name for generated code
ModulePath string // Go module path for generating import paths
}
Config configures the code generation.
type EventInfo ¶
type EventInfo struct {
Name string
PackageName string
ImportPath string
Fields []FieldInfo
Version int
}
EventInfo represents a discovered domain event struct.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates event mapping code.
func NewGenerator ¶
NewGenerator creates a new generator with the given configuration.
Click to show internal directories.
Click to hide internal directories.