Documentation ¶
Overview ¶
Package github implements activity.Service for GitHub.
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( 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 ¶
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 "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 ¶
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.