eventcatalog

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

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

func NewCatalog

func NewCatalog(cfg *Config) *Catalog

func (*Catalog) Config

func (c *Catalog) Config() *Config

func (*Catalog) GetDeliveryClass

func (c *Catalog) GetDeliveryClass(eventType string) (DeliveryClass, bool)

func (*Catalog) GetTopicForEvent

func (c *Catalog) GetTopicForEvent(eventType string) (string, bool)

func (*Catalog) IsDurableOutbox

func (c *Catalog) IsDurableOutbox(eventType string) bool

func (*Catalog) IsEventRegistered

func (c *Catalog) IsEventRegistered(eventType string) bool

type Config

type Config struct {
	Version string                 `yaml:"version"`
	Topics  map[string]TopicConfig `yaml:"topics"`
	Events  map[string]EventConfig `yaml:"events"`
}

func Load

func Load(path string) (*Config, error)

func LoadWithOptions

func LoadWithOptions(path string, opts ValidateOptions) (*Config, error)

func Parse

func Parse(data []byte) (*Config, error)

func ParseWithOptions

func ParseWithOptions(data []byte, opts ValidateOptions) (*Config, error)

func (*Config) GetDeliveryClass

func (c *Config) GetDeliveryClass(eventType string) (DeliveryClass, bool)

func (*Config) GetTopicName

func (c *Config) GetTopicName(eventType string) (string, bool)

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) ValidateWithOptions

func (c *Config) ValidateWithOptions(opts ValidateOptions) error

type DeliveryClass

type DeliveryClass string
const (
	DeliveryClassBestEffort    DeliveryClass = "best_effort"
	DeliveryClassDurableOutbox DeliveryClass = "durable_outbox"
)

func (DeliveryClass) Valid

func (c DeliveryClass) Valid() bool

type DeliveryClassResolver

type DeliveryClassResolver interface {
	GetDeliveryClass(eventType string) (DeliveryClass, bool)
}

type EventConfig

type EventConfig struct {
	Topic       string        `yaml:"topic"`
	Delivery    DeliveryClass `yaml:"delivery"`
	Aggregate   string        `yaml:"aggregate"`
	Domain      string        `yaml:"domain"`
	Description string        `yaml:"description"`
	Handler     string        `yaml:"handler"`
}

type TopicConfig

type TopicConfig struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
}

type TopicResolver

type TopicResolver interface {
	GetTopicForEvent(eventType string) (string, bool)
}

type ValidateOptions

type ValidateOptions struct {
	RequireHandler bool
}

ValidateOptions controls which catalog rules are enforced by shared callers.

Jump to

Keyboard shortcuts

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