Documentation
¶
Overview ¶
Package githubnotifications collects a bounded GitHub notification view.
Index ¶
- Constants
- Variables
- func AssetDeclarations() []assets.Declaration
- func DefinitionForVersion(version string) pluginsdk.Definition
- func ErrorCode(err error) string
- func IsCredentialRejected(err error) bool
- func RunSetup(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer, ...) error
- func ValidateRepositories(repositories []Repository) error
- type Config
- type Handler
- func (h *Handler) EndSession(ctx context.Context, r protocol.SessionEndRequest) error
- func (h *Handler) HandleSessionInput(ctx context.Context, r protocol.SessionInputRequest) (protocol.SessionInputResult, error)
- func (h *Handler) Health(context.Context) protocol.HealthResult
- func (h *Handler) InvokeOperation(_ context.Context, request protocol.OperationRequest) (protocol.OperationResult, error)
- func (h *Handler) ReplaceInstances(ctx context.Context, instances []protocol.Instance) error
- func (h *Handler) Shutdown(ctx context.Context) error
- func (h *Handler) StartSession(ctx context.Context, r protocol.SessionStartRequest) error
- type Host
- type Identity
- type Repository
Constants ¶
const ( PluginID = "dev.bsbctl.github-notifications" PluginVersion = "dev" AppID = "github-notifications" ChannelSummary = "summary" ChannelAttention = "attention" ChannelConnection = "connection" ChannelLive = "live" OperationStatus = "status" OperationItems = "items" )
Variables ¶
var ConfigSchema json.RawMessage
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 IsCredentialRejected ¶
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 (*Handler) EndSession ¶
func (*Handler) HandleSessionInput ¶
func (h *Handler) HandleSessionInput(ctx context.Context, r protocol.SessionInputRequest) (protocol.SessionInputResult, error)
func (*Handler) InvokeOperation ¶
func (h *Handler) InvokeOperation(_ context.Context, request protocol.OperationRequest) (protocol.OperationResult, error)
func (*Handler) ReplaceInstances ¶
func (*Handler) StartSession ¶
StartSession binds a panel to an exact observation or launcher; effects require a later input after core has promoted this session.
type Host ¶
type Host interface {
PublishObservation(context.Context, protocol.Observation) error
SaveCheckpoint(context.Context, protocol.CheckpointRequest) error
BeginSessionExecution(context.Context, protocol.SessionExecutionRequest) error
CompleteSession(context.Context, protocol.CompleteSessionRequest) error
Log(context.Context, protocol.LogNotification) error
}
Host is the notification plugin's generation-scoped publication and effect boundary.
type Identity ¶
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 ¶
Repository optionally selects one source repository and its public-safe display alias.