Documentation ¶
Overview ¶
Package gerrit implements activity.Service for Gerrit.
Index ¶
- type Service
- func (s *Service) CountNotifications(ctx context.Context) (uint64, error)
- func (s *Service) List(ctx context.Context) ([]event.Event, error)
- func (s *Service) ListNotifications(ctx context.Context, opt notification.ListOptions) ([]notification.Notification, error)
- func (*Service) Log(_ context.Context, event event.Event) error
- func (s *Service) MarkThreadRead(ctx context.Context, namespace, threadType string, threadID uint64) error
- func (*Service) NotifyThread(_ context.Context, namespace, threadType string, threadID uint64, ...) error
- func (s *Service) Status() string
- func (s *Service) StreamNotifications(ctx context.Context, ch chan<- []notification.Notification) error
- func (*Service) SubscribeThread(_ context.Context, namespace, threadType string, threadID uint64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( ctx context.Context, wg *sync.WaitGroup, fs webdav.FileSystem, activityMail http.FileSystem, newActivityMail <-chan struct{}, cs change.Service, user users.User, users users.Service, router gerrit.Router, ) (*Service, error)
NewService creates a Gerrit-backed activity.Service using the given Gerrit activity mail filesystem and Gerrit-backed change service. It serves the specified user only, whose activity mail must be provided, and cannot be used to serve multiple users.
newActivityMail delivers a value when there is new mail, and must not be closed.
user.Login is used to detect mentions.
func (*Service) CountNotifications ¶
CountNotifications implements notification.Service.
func (*Service) ListNotifications ¶
func (s *Service) ListNotifications(ctx context.Context, opt notification.ListOptions) ([]notification.Notification, error)
ListNotifications implements notification.Service.
func (*Service) MarkThreadRead ¶
func (s *Service) MarkThreadRead(ctx context.Context, namespace, threadType string, threadID uint64) error
MarkThreadRead implements notification.Service.
Namespace must be of the form "{server}/{project}". E.g., "go.googlesource.com/image".
func (*Service) NotifyThread ¶
func (*Service) NotifyThread(_ context.Context, namespace, threadType string, threadID uint64, nr notification.NotificationRequest) error
NotifyThread implements notification.Service.
func (*Service) Status ¶
Status reports the status of the service. The status is "ok" if everything is okay, or an error description otherwise.
func (*Service) StreamNotifications ¶
func (s *Service) StreamNotifications(ctx context.Context, ch chan<- []notification.Notification) error
StreamNotifications implements notification.Service.