github

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: 37 Imported by: 0

Documentation

Overview

Package github implements activity.Service for GitHub.

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(
	fs webdav.FileSystem,
	activityMail http.FileSystem, newActivityMail <-chan struct{},
	clientV3 *githubv3.Client, clientV4 *githubv4.Client,
	user users.User, users users.Service,
	router github.Router,
) (*Service, error)

NewService creates a GitHub-backed activity.Service using the given GitHub activity mail filesystem and GitHub API clients. It serves the specified user only, whose activity mail and authenticated GitHub API clients must be provided, and cannot be used to serve multiple users.

This service uses Cache-Control: no-cache request header to disable caching.

newActivityMail delivers a value when there is new mail, and must not be closed.

If router is nil, github.DotCom router is used, which links to subjects on github.com.

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 "github.com/{owner}/{repo}". E.g., "github.com/google/go-cmp".

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