Documentation
¶
Overview ¶
Package repohooks manages webhooks for VCS events
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
Types ¶
type CreateRepohookOptions ¶
type EventUnmarshaler ¶
type EventUnmarshaler func(w http.ResponseWriter, r *http.Request, secret string) *vcs.EventPayload
EventUnmarshaler does two things: (a) handles incoming request (containing a VCS event) and sends appropriate response (b) unmarshals event from the request; if the event is irrelevant or invalid then nil is returned.
type Options ¶
type Options struct {
logr.Logger
*sql.DB
VCSEventBroker *vcs.Broker
internal.HostnameService
VCSProviderService vcsprovider.Service
organization.OrganizationService
github.GithubAppService
}
type RepohookService ¶
type RepohookService = Service
type Service ¶
type Service interface {
// CreateRepohook creates a webhook on a VCS repository. If the webhook
// already exists, it is updated if there are discrepancies; otherwise
// no action is taken. In any case an identifier is returned uniquely
// identifying the webhook.
CreateRepohook(ctx context.Context, opts CreateRepohookOptions) (uuid.UUID, error)
// RegisterCloudHandler registers a new cloud handler, to handle VCS
// events for a specific vcs hosting provider.
RegisterCloudHandler(kind vcs.Kind, h EventUnmarshaler)
// DeleteUnreferencedRepohooks deletes any repohooks no longer used
// by a VCS connection
DeleteUnreferencedRepohooks(ctx context.Context) error
}
RepohookService manages webhooks
Click to show internal directories.
Click to hide internal directories.