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 ¶
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") )
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") )
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 ¶
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.