Documentation
¶
Index ¶
- func AllowList(allowFrom, userID string) bool
- func NewChannel(name string, opts map[string]any) (channel.Channel, error)
- func NewMsgDedup() *msgDedup
- func RegisterChannel(name string, factory Factory)
- func StopAll()
- func TrackChannel(key string, p channel.Channel)
- type Dedup
- type Factory
- type HTTPRouter
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowList ¶
AllowList checks whether a user ID is permitted based on a comma-separated allow_from string. Returns true if allowFrom is empty or "*" (allow all), or if the userID is in the list. Comparison is case-insensitive.
func NewChannel ¶
NewChannel creates a new channel instance by name with the given options.
func RegisterChannel ¶
RegisterChannel registers a channel factory under the given name. Each channel package should call this in its init() function.
func TrackChannel ¶
TrackChannel adds a started channel to the registry with a unique key.
Types ¶
type Dedup ¶
type Dedup struct {
// contains filtered or unexported fields
}
Dedup provides message deduplication using Redis.
func NewDedup ¶
func NewDedup(rdb redis.UniversalClient) *Dedup
NewDedup creates a new Dedup instance with the given Redis client.
type HTTPRouter ¶
type HTTPRouter interface {
RegisterHTTPRoutes(r chi.Router, callbackPath string, handler channel.MessageHandler)
}
HTTPRouter is an optional interface for channels that support HTTP webhook callbacks. Implementations should register their GET (verification) and POST (message) handlers on the router.