Versions in this module Expand all Collapse all v0 v0.2.0 Sep 2, 2026 v0.1.1 Aug 20, 2026 Changes in this version + type BaseChannel struct + ChannelName string + ChannelType MessageType + IsEnabled bool + func (b *BaseChannel) Enabled() bool + func (b *BaseChannel) Name() string + func (b *BaseChannel) Type() MessageType + type Channel interface + Enabled func() bool + Name func() string + Send func(ctx context.Context, msg Message) error + Type func() MessageType + type ChannelFunc struct + ChannelEnabled bool + ChannelName string + ChannelType MessageType + SendFunc func(ctx context.Context, msg Message) error + func NewChannelFunc(name string, typ MessageType, enabled bool, ...) *ChannelFunc + func (c *ChannelFunc) Enabled() bool + func (c *ChannelFunc) Name() string + func (c *ChannelFunc) Send(ctx context.Context, msg Message) error + func (c *ChannelFunc) SetEnabled(enabled bool) + func (c *ChannelFunc) Type() MessageType + type Dispatcher struct + func NewDispatcher() *Dispatcher + func NewDispatcherWithStore(store LogStore) *Dispatcher + func (d *Dispatcher) AddChannel(ch Channel) + func (d *Dispatcher) ChannelNames() []string + func (d *Dispatcher) Channels() []Channel + func (d *Dispatcher) EnabledChannelCount(typ MessageType) int + func (d *Dispatcher) RemoveChannel(name string) bool + func (d *Dispatcher) Send(ctx context.Context, msg Message) error + func (d *Dispatcher) SendToType(ctx context.Context, typ MessageType, to, subject, body string) error + func (d *Dispatcher) SetLogStore(store LogStore) + type LogEntry struct + ChannelName string + Content string + CreatedAt time.Time + ErrorMsg string + ID string + IPAddress string + MessageID string + RetryCount int + SentAt time.Time + Status string + Subject string + To string + Type MessageType + type LogStore interface + CreateLog func(entry LogEntry) error + GetLog func(id string) (*LogEntry, error) + UpdateStatus func(id, status, errorMsg string) error + type Message struct + ActionLabel string + ActionURL string + Body string + Content string + CountryCode int + Data map[string]any + Event string + Extras map[string]any + HTML string + IPAddress string + Locale string + PhoneNumber string + SignName string + Subject string + Template string + Timestamp time.Time + Title string + To string + Type MessageType + URL string + UserID string + func NewEmailMessage(to, subject, body string) Message + func NewIMMessage(title, content string) Message + func NewInboxMessage(userID, title, content string) Message + func NewPushMessage(token, title, body string) Message + func NewSMSMessage(phone, content string) Message + func NewWebhookMessage(event, url string, data map[string]any) Message + type MessageType string + const TypeEmail + const TypeIM + const TypeInbox + const TypePush + const TypeSMS + const TypeWebhook + type NoopLogStore struct + func (NoopLogStore) CreateLog(entry LogEntry) error + func (NoopLogStore) GetLog(id string) (*LogEntry, error) + func (NoopLogStore) UpdateStatus(id, status, errorMsg string) error + type TemplateStore interface + LoadTemplate func(code, locale string) (subject, body string, err error)