Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultListenCoolDown = 30 * time.Second DefaultSendCoolDown = 500 * time.Millisecond DefaultNotificationDeadline = 24 * time.Hour // Requires <userName>, <authorName> and <communityName> // Mentions <userName> DefaultPermissionMessage = `` /* 234-byte string literal not displayed */ // Requires <userName>, <authorName>, <communityName>, <botUserName> and <authorName> // Mentions <userName> and <botUserName> DefaultNotificationMessage = `` /* 148-byte string literal not displayed */ // Requires <userName>, <authorName>, <communityName>, <customText>, <botUserName> and <authorName> // Mentions <userName> and <botUserName> DefaultCustomNotificationMessage = `` /* 151-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationManager ¶
type NotificationManager struct {
// contains filtered or unexported fields
}
NotificationManager is a manager that listens for new notifications registered in the database and sends them to the users via the farcaster API.
func New ¶
func New(ctx context.Context, config *NotifificationManagerConfig) (*NotificationManager, error)
New creates a new NotificationManager instance with the given context, database and farcaster API. It also sets the listen cool down duration.
func (*NotificationManager) Start ¶
func (nm *NotificationManager) Start()
Start starts the notification manager and listens for new notifications in the database to send them to the users. It uses a cool down duration to avoid spamming the farcaster API. It runs in the background and send notifications in parallel.
func (*NotificationManager) Stop ¶
func (nm *NotificationManager) Stop()
Stop stops the notification manager and cancels the context.
Click to show internal directories.
Click to hide internal directories.