Documentation ¶
Overview ¶
Package v2tov1 provides a notifv1.Service wrapper on top of a notifv2.Service implementation.
Index ¶
- func NewNotifyPayloadSource() *eventsService
- type Service
- func (s Service) Count(ctx context.Context, opt interface{}) (uint64, error)
- func (s Service) List(ctx context.Context, opt notifv1.ListOptions) (notifv1.Notifications, error)
- func (s Service) MarkAllRead(ctx context.Context, repo notifv1.RepoSpec) error
- func (s Service) MarkRead(ctx context.Context, repo notifv1.RepoSpec, threadType string, threadID uint64) error
- func (s Service) Notify(ctx context.Context, repo notifv1.RepoSpec, threadType string, threadID uint64, ...) error
- func (s Service) Subscribe(ctx context.Context, repo notifv1.RepoSpec, threadType string, threadID uint64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNotifyPayloadSource ¶
func NewNotifyPayloadSource() *eventsService
NewNotifyPayloadSource creates a NotifyPayloadSource for use in Service. Its return value implements events.Service and it should be passed to issue tracker v1 alongside with the Service. It's used to capture the notification payload to implement Service.Notify without losing information.
Types ¶
type Service ¶
type Service struct { V2 notifv2.Service // NotifyPayloadSource, if non-nil, enables Notify to work. NotifyPayloadSource *eventsService }
Service implements notifv1.Service using V2.
func (Service) Count ¶
Count notifications for authenticated user. Returns a permission error if no authenticated user.
func (Service) List ¶
func (s Service) List(ctx context.Context, opt notifv1.ListOptions) (notifv1.Notifications, error)
List notifications for authenticated user. Returns a permission error if no authenticated user.
func (Service) MarkAllRead ¶
MarkAllRead marks all notifications in the specified repository as read. Returns a permission error if no authenticated user.
func (Service) MarkRead ¶
func (s Service) MarkRead(ctx context.Context, repo notifv1.RepoSpec, threadType string, threadID uint64) error
MarkRead marks the specified thread as read. Returns a permission error if no authenticated user.
func (Service) Notify ¶
func (s Service) Notify(ctx context.Context, repo notifv1.RepoSpec, threadType string, threadID uint64, nr notifv1.NotificationRequest) error
Notify notifies subscribers of the specified thread of a notification. Returns a permission error if no authenticated user.
func (Service) Subscribe ¶
func (s Service) Subscribe(ctx context.Context, repo notifv1.RepoSpec, threadType string, threadID uint64, subscribers []users.UserSpec) error
Subscribe subscribes subscribers to the specified thread. If threadType and threadID are zero, subscribers are subscribed to watch the entire repo. Returns a permission error if no authenticated user.