Documentation
¶
Overview ¶
Package hooks manages webhooks on VCS repos.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
Types ¶
type NewServiceOptions ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(opts NewServiceOptions) *Service
func (*Service) Hook ¶
Hook hooks up a resource to a VCS repository, so that it may subscribe to its VCS events. A webhook is configured on the repo if one doesn't exist already. The caller provides a callback with which to establish a relationship in the DB between a resource and the hook.
func (*Service) Unhook ¶
Unhook unhooks a resource from a VCS repository. If no other resources are hooked up then the webhook is deleted from the repo. The caller provides a callback with which to remove the relationship between the hook and the resource in the DB.
NOTE: if the webhook cannot be deleted from the repo then this is not deemed fatal and the hook is still deleted from the database.