Documentation
¶
Index ¶
- Variables
- type Bus
- type Handler
- type Message
- type Module
- func (m *Module) Configure(config config.Config) error
- func (m *Module) Dependencies() []string
- func (m *Module) GetMigrationSources(projectRoot string) []migration_runner.Source
- func (m *Module) Initialize(ctx context.Context, db *gorm.DB, router *gin.Engine) error
- func (m *Module) MigrationsDir() string
- func (m *Module) Name() string
- func (m *Module) Namespace() module.ModuleNamespace
- func (m *Module) NewConfig() config.Config
- func (m *Module) ProvidesMigrations() bool
- func (m *Module) Publish(ctx context.Context, event Message) error
- func (m *Module) PublishAsync(ctx context.Context, event Message) (<-chan error, error)
- func (m *Module) Run(ctx context.Context) error
- func (m *Module) RunHandlers(ctx context.Context) error
- func (m *Module) Shutdown(ctx context.Context) error
- func (m *Module) Subscribe(eventType, handlerName string, handler Handler) error
- func (m *Module) Unsubscribe(eventType string) error
- func (m *Module) Version() string
- type Publisher
- type RetryConfig
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRetryConfig = RetryConfig{ MaxRetries: 3, InitialWait: time.Second, MaxWait: time.Second * 10, }
DefaultRetryConfig provides sensible default retry settings
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus interface {
Publisher
Subscriber
}
type Handler ¶
func WithRecovery ¶
WithRecovery wraps a handler with panic recovery
func WithRetry ¶
func WithRetry(handler Handler, config RetryConfig) Handler
WithRetry wraps a handler with retry logic
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements the event system using Watermill
func (*Module) Dependencies ¶
Dependencies implements module.Module.
func (*Module) GetMigrationSources ¶
func (m *Module) GetMigrationSources(projectRoot string) []migration_runner.Source
GetMigrationSources implements module.Module.
func (*Module) Initialize ¶
Initialize implements core.Module interface
func (*Module) MigrationsDir ¶
MigrationsDir implements module.Module.
func (*Module) Namespace ¶
func (m *Module) Namespace() module.ModuleNamespace
Namespace implements module.Module.
func (*Module) ProvidesMigrations ¶
ProvidesMigrations implements module.Module.
func (*Module) PublishAsync ¶
func (*Module) Unsubscribe ¶
type RetryConfig ¶
RetryConfig defines retry behavior for event handlers
Click to show internal directories.
Click to hide internal directories.