Documentation
¶
Overview ¶
Package redelivery implements a daemon that periodically re-delivers failed GitHub webhook deliveries.
Index ¶
Constants ¶
View Source
const ( GitHubAppIDEnvVar = "APP_GITHUB_APP_ID" GitHubAppInstallationIDEnvVar = "APP_GITHUB_APP_INSTALLATION_ID" GitHubAppPrivateKeyEnvVar = "APP_GITHUB_APP_PRIVATE_KEY_VALUE" GitHubPathEnvVar = "APP_GITHUB_PATH" WebhookIDEnvVar = "APP_WEBHOOK_ID" RedeliveryIntervalEnvVar = "APP_REDELIVERY_INTERVAL" )
Environment variable names for redelivery configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// GitHubAppID is the GitHub App ID for app-based authentication.
GitHubAppID int64
// GitHubAppInstallationID is the GitHub App installation ID.
GitHubAppInstallationID int64
// GitHubAppPrivateKey is the PEM-encoded private key for the GitHub App.
GitHubAppPrivateKey string
// GitHubOrg is the GitHub organization where the webhook is registered.
GitHubOrg string
// GitHubRepo is the GitHub repository (optional, for repo-level webhooks).
GitHubRepo string
// WebhookID is the identifier of the webhook to check deliveries for.
WebhookID int64
// Interval is the polling interval between redelivery checks.
// Defaults to 10 minutes if zero.
Interval time.Duration
}
Config holds the configuration for the redelivery daemon.
func ConfigFromEnv ¶
ConfigFromEnv builds a redelivery config from environment variables. Returns nil if redelivery is not configured (missing github path or webhook ID).
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon periodically checks for failed webhook deliveries and re-delivers them.
type GitHubClient ¶
type GitHubClient interface {
ListDeliveries(ctx context.Context, org, repo string, hookID int64, since time.Time) ([]*github.HookDelivery, error)
RedeliverDelivery(ctx context.Context, org, repo string, hookID, deliveryID int64) error
}
GitHubClient abstracts GitHub API operations for webhook delivery management.
Click to show internal directories.
Click to hide internal directories.