Documentation
¶
Index ¶
- Constants
- type DBNotifMan
- func (nm *DBNotifMan) AddFollow(ctx context.Context, follower, followed models.Uid, recid uint) error
- func (nm *DBNotifMan) AddMention(ctx context.Context, user models.Uid, postid uint, mentioned models.Uid) error
- func (nm *DBNotifMan) AddReplyTo(ctx context.Context, user models.Uid, replyid uint, replyto *models.FeedPost) error
- func (nm *DBNotifMan) AddRepost(ctx context.Context, op models.Uid, repost uint, reposter models.Uid) error
- func (nm *DBNotifMan) AddUpVote(ctx context.Context, voter models.Uid, postid uint, voteid uint, ...) error
- func (nm *DBNotifMan) GetCount(ctx context.Context, user models.Uid) (int64, error)
- func (nm *DBNotifMan) GetNotifications(ctx context.Context, user models.Uid) ([]*appbskytypes.NotificationListNotifications_Notification, error)
- func (nm *DBNotifMan) UpdateSeen(ctx context.Context, usr models.Uid, seen time.Time) error
- type GetRecord
- type HydratedNotification
- type NotifRecord
- type NotifSeen
- type NotificationManager
- type NullNotifs
- func (nn *NullNotifs) AddFollow(ctx context.Context, follower, followed models.Uid, recid uint) error
- func (nn *NullNotifs) AddMention(ctx context.Context, user models.Uid, postid uint, mentioned models.Uid) error
- func (nn *NullNotifs) AddReplyTo(ctx context.Context, user models.Uid, replyid uint, replyto *models.FeedPost) error
- func (nn *NullNotifs) AddRepost(ctx context.Context, op models.Uid, repost uint, reposter models.Uid) error
- func (nn *NullNotifs) AddUpVote(ctx context.Context, voter models.Uid, postid uint, voteid uint, ...) error
- func (nn *NullNotifs) GetCount(ctx context.Context, user models.Uid) (int64, error)
- func (nn *NullNotifs) GetNotifications(ctx context.Context, user models.Uid) ([]*appbskytypes.NotificationListNotifications_Notification, error)
- func (nn *NullNotifs) UpdateSeen(ctx context.Context, usr models.Uid, seen time.Time) error
Constants ¶
View Source
const ( NotifKindReply = 1 NotifKindMention = 2 NotifKindUpVote = 3 NotifKindFollow = 4 NotifKindRepost = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBNotifMan ¶
type DBNotifMan struct {
// contains filtered or unexported fields
}
func NewNotificationManager ¶
func NewNotificationManager(db *gorm.DB, getrec GetRecord) *DBNotifMan
func (*DBNotifMan) AddMention ¶
func (*DBNotifMan) AddReplyTo ¶
func (*DBNotifMan) GetNotifications ¶
func (nm *DBNotifMan) GetNotifications(ctx context.Context, user models.Uid) ([]*appbskytypes.NotificationListNotifications_Notification, error)
func (*DBNotifMan) UpdateSeen ¶
type HydratedNotification ¶
type HydratedNotification struct { Record any IsRead bool IndexedAt time.Time Uri string Cid string Author *appbskytypes.ActorDefs_ProfileViewBasic Reason string ReasonSubject *string }
type NotifRecord ¶
type NotificationManager ¶
type NotificationManager interface { GetNotifications(ctx context.Context, user models.Uid) ([]*appbskytypes.NotificationListNotifications_Notification, error) GetCount(ctx context.Context, user models.Uid) (int64, error) UpdateSeen(ctx context.Context, usr models.Uid, seen time.Time) error AddReplyTo(ctx context.Context, user models.Uid, replyid uint, replyto *models.FeedPost) error AddMention(ctx context.Context, user models.Uid, postid uint, mentioned models.Uid) error AddUpVote(ctx context.Context, voter models.Uid, postid uint, voteid uint, postauthor models.Uid) error AddFollow(ctx context.Context, follower, followed models.Uid, recid uint) error AddRepost(ctx context.Context, op models.Uid, repost uint, reposter models.Uid) error }
type NullNotifs ¶
type NullNotifs struct { }
func (*NullNotifs) AddMention ¶
func (*NullNotifs) AddReplyTo ¶
func (*NullNotifs) GetNotifications ¶
func (nn *NullNotifs) GetNotifications(ctx context.Context, user models.Uid) ([]*appbskytypes.NotificationListNotifications_Notification, error)
func (*NullNotifs) UpdateSeen ¶
Click to show internal directories.
Click to hide internal directories.