github

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package github provides a source implementation that integrates with GitHub via its REST API and inbound webhooks.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingEnvVariable reports missing mandatory environment variables.
	ErrMissingEnvVariable = errors.New("missing environment variable")
	// ErrInvalidEnvVariable reports malformed environment variable values.
	ErrInvalidEnvVariable = errors.New("invalid environment value")
)
View Source
var (
	// ErrGitHubSource wraps errors emitted by the GitHub source implementation.
	ErrGitHubSource = errors.New("github source")
	// ErrRetrievingAssets wraps errors that occur while fetching API resources.
	ErrRetrievingAssets = errors.New("error retrieving assets")
)
View Source
var ErrIteratorDone = errors.New("iterator done")

ErrIteratorDone signals that all pages have been consumed.

Functions

This section is empty.

Types

type Source

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

Source implements source.SyncableSource and source.WebhookSource for GitHub.

func NewSource

func NewSource() (*Source, error)

NewSource constructs a Source by reading its configuration from environment variables and initialising the underlying HTTP client. It returns ErrGitHubSource if the configuration is invalid.

func (*Source) GetWebhook

func (s *Source) GetWebhook(ctx context.Context, typesToStream map[string]source.Extra, results chan<- source.Data) (source.Webhook, error)

GetWebhook implements source.WebhookSource. It validates the webhook configuration and returns a Webhook that verifies HMAC-SHA256 signatures and dispatches events to the processor registry.

func (*Source) StartSyncProcess

func (s *Source) StartSyncProcess(ctx context.Context, typesToSync map[string]source.Extra, results chan<- source.Data) error

StartSyncProcess performs a full synchronisation of the requested resource types by querying the GitHub REST API and sending results to results. Only known data types are processed; unknown types are skipped with a debug log message.

Jump to

Keyboard shortcuts

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