Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseChannel ¶
type BaseChannel struct {
Bus *bus.MessageBus
AllowList map[string]bool
}
BaseChannel provides common functionality
func (*BaseChannel) IsAllowed ¶
func (b *BaseChannel) IsAllowed(senderID string) bool
IsAllowed checks if sender is permitted
func (*BaseChannel) PublishInbound ¶
func (b *BaseChannel) PublishInbound(msg *bus.InboundMessage)
PublishInbound sends message to bus
type Channel ¶
type Channel interface {
Name() string
Start(ctx context.Context) error
Stop(ctx context.Context) error
Send(ctx context.Context, msg *bus.OutboundMessage) error
IsAllowed(senderID string) bool
}
Channel interface for chat platforms
type DeliveryPolicy ¶ added in v0.5.1
type DeliveryPolicy struct {
MaxConcurrentSends int
RetryMaxAttempts int
RetryBaseBackoff time.Duration
RetryMaxBackoff time.Duration
RateLimitPerSecond int
DedupWindow time.Duration
}
DeliveryPolicy defines outbound retry, backoff, rate limit and dedup behavior.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates all channels
func NewManager ¶
func NewManager(msgBus *bus.MessageBus) *Manager
NewManager creates a channel manager
func NewManagerWithLimit ¶ added in v0.1.4
func NewManagerWithLimit(msgBus *bus.MessageBus, maxConcurrentSends int) *Manager
NewManagerWithLimit creates a channel manager with bounded outbound send concurrency.
func NewManagerWithPolicy ¶ added in v0.5.1
func NewManagerWithPolicy(msgBus *bus.MessageBus, policy DeliveryPolicy) *Manager
NewManagerWithPolicy creates a manager with custom outbound delivery policy.
func (*Manager) RouteOutbound ¶
RouteOutbound sends outbound messages to appropriate channels
func (*Manager) SetRuntimeMetrics ¶ added in v0.4.2
func (m *Manager) SetRuntimeMetrics(recorder *metrics.RuntimeMetrics)
SetRuntimeMetrics attaches a recorder used for outbound send metrics.
Click to show internal directories.
Click to hide internal directories.