githubnotifications

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: GPL-3.0 Imports: 34 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package githubnotifications collects a bounded GitHub notification view.

Index

Constants

View Source
const (
	PluginID          = "dev.bsbctl.github-notifications"
	PluginVersion     = "dev"
	AppID             = "github-notifications"
	ChannelSummary    = "summary"
	ChannelAttention  = "attention"
	ChannelConnection = "connection"
	ChannelLive       = "live"
	OperationStatus   = "status"
	OperationItems    = "items"
)

Variables

View Source
var ConfigSchema json.RawMessage
View Source
var ErrStaleNotification = errors.New("notification selection is stale")

ErrStaleNotification rejects an effect whose frozen item version is no longer current.

Functions

func AssetDeclarations

func AssetDeclarations() []assets.Declaration

AssetDeclarations describes the official GitHub mark packaged with the plugin.

func DefinitionForVersion

func DefinitionForVersion(version string) pluginsdk.Definition

DefinitionForVersion binds release metadata to the declared plugin contract.

func ErrorCode

func ErrorCode(err error) string

ErrorCode returns a content-free stable failure code.

func IsCredentialRejected

func IsCredentialRejected(err error) bool

IsCredentialRejected distinguishes confirmed credential rejection from transport or throttling failures.

func RunSetup

func RunSetup(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer, host appsetup.Host) error

RunSetup configures an installed GitHub Notifications app without exposing provider credential policy to the core CLI.

func ValidateRepositories

func ValidateRepositories(repositories []Repository) error

ValidateRepositories checks a bounded optional filter of unique GitHub.com names and public aliases.

Types

type Config

type Config struct {
	Repositories        []Repository
	Label               string
	RearDetails         bool
	PollInterval        time.Duration
	Configured          bool
	NotificationReasons []string
}

Config contains validated collection and presentation settings.

func DecodeConfig

func DecodeConfig(raw json.RawMessage) (Config, error)

DecodeConfig accepts an exact empty object or a complete strict configuration.

type Handler

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

Handler owns configured workers. New does not perform provider I/O.

func New

func New(host Host) *Handler

New constructs the production handler with a package-owned HTTP client.

func (*Handler) EndSession

func (h *Handler) EndSession(ctx context.Context, r protocol.SessionEndRequest) error

func (*Handler) HandleSessionInput

func (*Handler) Health

func (*Handler) InvokeOperation

func (h *Handler) InvokeOperation(_ context.Context, request protocol.OperationRequest) (protocol.OperationResult, error)

func (*Handler) ReplaceInstances

func (h *Handler) ReplaceInstances(ctx context.Context, instances []protocol.Instance) error

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context) error

func (*Handler) StartSession

func (h *Handler) StartSession(ctx context.Context, r protocol.SessionStartRequest) error

StartSession binds a panel to an exact observation or launcher; effects require a later input after core has promoted this session.

type Host

Host is the notification plugin's generation-scoped publication and effect boundary.

type Identity

type Identity struct {
	ID    int64  `json:"id"`
	Login string `json:"login"`
}

Identity is the authenticated GitHub user. It is never emitted by plugin queries.

func Authorize

func Authorize(ctx context.Context, client *http.Client, token string, repositories []Repository) (Identity, error)

Authorize proves identity, notification capability, and access to each repository using read requests. The borrowed client's transport is preserved; redirects, cookies, and request time are restricted.

type Repository

type Repository struct {
	Name  string `json:"name"`
	Alias string `json:"alias"`
}

Repository optionally selects one source repository and its public-safe display alias.

Jump to

Keyboard shortcuts

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