v2tov1

package
v0.0.0-...-c858694 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package v2tov1 provides a notifv1.Service wrapper on top of a notifv2.Service implementation.

Index

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

func (s Service) Count(ctx context.Context, opt interface{}) (uint64, error)

Count notifications for authenticated user. Returns a permission error if no authenticated user.

func (Service) List

List notifications for authenticated user. Returns a permission error if no authenticated user.

func (Service) MarkAllRead

func (s Service) MarkAllRead(ctx context.Context, repo notifv1.RepoSpec) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL