gerrit

package
v0.0.0-...-e98364e Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package gerrit implements activity.Service for Gerrit.

Index

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

func (s *Service) CountNotifications(ctx context.Context) (uint64, error)

CountNotifications implements notification.Service.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]event.Event, error)

List lists events.

func (*Service) ListNotifications

func (s *Service) ListNotifications(ctx context.Context, opt notification.ListOptions) ([]notification.Notification, error)

ListNotifications implements notification.Service.

func (*Service) Log

func (*Service) Log(_ context.Context, event event.Event) error

Log logs the event. event.Time time zone must be UTC.

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

func (s *Service) Status() string

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.

func (*Service) SubscribeThread

func (*Service) SubscribeThread(_ context.Context, namespace, threadType string, threadID uint64, subscribers []users.UserSpec) error

SubscribeThread implements notification.Service.

Jump to

Keyboard shortcuts

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