github

package
v0.0.0-...-c936f35 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Overview

Package github provides a barista module to show github notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module represents a GitHub barista module that displays notification counts.

func New

func New(clientID, clientSecret string) *Module

New creates a GitHub module using the given clientID and secret.

func (*Module) Output

func (m *Module) Output(outputFunc func(Notifications) bar.Output) *Module

Output sets the output format for this module.

func (*Module) Stream

func (m *Module) Stream(sink bar.Sink)

Stream starts the module.

type Notifications

type Notifications map[string]int

Notifications represents the notifications grouped by reasons. The key is the reason ("comment", "mention"), and the value is the number of notifications for that reason. See https://developer.github.com/v3/activity/notifications/#notification-reasons for a list of reasons.

func (Notifications) Total

func (n Notifications) Total() int

Total returns the total number of unread notifications across all categories.

Jump to

Keyboard shortcuts

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