Documentation
¶
Overview ¶
Package webhooks contains logic relating to manipulating GitHub webhooks
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubWebhookClient ¶
type GitHubWebhookClient interface {
CreateHook(ctx context.Context, owner, repo string, hook *github.Hook) (*github.Hook, error)
DeleteHook(ctx context.Context, owner, repo string, id int64) (*github.Response, error)
ListHooks(ctx context.Context, owner, repo string) ([]*github.Hook, error)
}
GitHubWebhookClient defines the methods from the GitHub client which we need. This allows us to create a stub for testing.
type WebhookManager ¶
type WebhookManager interface {
CreateWebhook(
ctx context.Context,
client GitHubWebhookClient,
repoOwner string,
repoName string,
) (string, *github.Hook, error)
DeleteWebhook(
ctx context.Context,
client GitHubWebhookClient,
repoOwner string,
repoName string,
hookID int64,
) error
}
WebhookManager encapsulates logic for creating and deleting GitHub webhooks
func NewWebhookManager ¶
func NewWebhookManager(webhookConfig server.WebhookConfig) WebhookManager
NewWebhookManager instantiates an instances of the WebhookManager interface
Click to show internal directories.
Click to hide internal directories.