webhooks

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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

Directories

Path Synopsis
Package mockghhook is a generated GoMock package.
Package mockghhook is a generated GoMock package.

Jump to

Keyboard shortcuts

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