repohooks

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package repohooks manages webhooks for VCS events

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRepohookOptions

type CreateRepohookOptions struct {
	VCSProviderID string // vcs provider of repo
	RepoPath      string
}

type EventUnmarshaler

type EventUnmarshaler func(r *http.Request, secret string) (*vcs.EventPayload, error)

EventUnmarshaler validates the request using the secret and unmarshals the event contained in the request body. If the request is to be ignored then the unmarshaler should return vcs.ErrIgnoreEvent, explaining why the event was ignored.

type Options

type Options struct {
	logr.Logger

	OrganizationService *organization.Service
	VCSProviderService  *vcsprovider.Service
	GithubAppService    *github.Service
	VCSEventBroker      *vcs.Broker

	*sql.DB
	*internal.HostnameService
}

type Service

type Service struct {
	logr.Logger
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx context.Context, opts Options) *Service

func (Service) AddHandlers added in v0.2.2

func (h Service) AddHandlers(r *mux.Router)

func (*Service) CreateRepohook

func (s *Service) CreateRepohook(ctx context.Context, opts CreateRepohookOptions) (uuid.UUID, error)

func (*Service) DeleteUnreferencedRepohooks

func (s *Service) DeleteUnreferencedRepohooks(ctx context.Context) error

func (*Service) RegisterCloudHandler

func (s *Service) RegisterCloudHandler(kind vcs.Kind, h EventUnmarshaler)

Jump to

Keyboard shortcuts

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