webhook

package
v0.0.0-...-94d0466 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

WireSet provides a wire set for this package.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	authorizer authz.Authorizer,
	spaceStore store.SpaceStore,
	repoStore store.RepoStore,
	webhookService *webhook.Service,
	encrypter encrypt.Encrypter,
	preprocessor Preprocessor,
) *Controller

func ProvideController

func ProvideController(authorizer authz.Authorizer,
	spaceStore store.SpaceStore, repoStore store.RepoStore,
	webhookService *webhook.Service, encrypter encrypt.Encrypter,
	preprocessor Preprocessor,
) *Controller

func (*Controller) CreateRepo

func (c *Controller) CreateRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	in *types.WebhookCreateInput,
) (*types.Webhook, error)

CreateRepo creates a new repo webhook.

func (*Controller) CreateSpace

func (c *Controller) CreateSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	in *types.WebhookCreateInput,
) (*types.Webhook, error)

CreateSpace creates a new webhook.

func (*Controller) DeleteRepo

func (c *Controller) DeleteRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	webhookIdentifier string,
) error

DeleteRepo deletes an existing webhook.

func (*Controller) DeleteSpace

func (c *Controller) DeleteSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	webhookIdentifier string,
) error

DeleteSpace deletes an existing webhook.

func (*Controller) FindExecutionRepo

func (c *Controller) FindExecutionRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	webhookIdentifier string,
	webhookExecutionID int64,
) (*types.WebhookExecution, error)

FindExecutionRepo finds a webhook execution.

func (*Controller) FindExecutionSpace

func (c *Controller) FindExecutionSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	webhookIdentifier string,
	webhookExecutionID int64,
) (*types.WebhookExecution, error)

FindExecutionSpace finds a webhook execution.

func (*Controller) FindRepo

func (c *Controller) FindRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	webhookIdentifier string,
) (*types.Webhook, error)

FindRepo finds a webhook from the provided repository.

func (*Controller) FindSpace

func (c *Controller) FindSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	webhookIdentifier string,
) (*types.Webhook, error)

FindSpace finds a webhook from the provided repository.

func (*Controller) ListExecutionsRepo

func (c *Controller) ListExecutionsRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	webhookIdentifier string,
	filter *types.WebhookExecutionFilter,
) ([]*types.WebhookExecution, int64, error)

ListExecutionsRepo returns the executions of the webhook.

func (*Controller) ListExecutionsSpace

func (c *Controller) ListExecutionsSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	webhookIdentifier string,
	filter *types.WebhookExecutionFilter,
) ([]*types.WebhookExecution, int64, error)

ListExecutionsSpace returns the executions of the webhook.

func (*Controller) ListRepo

func (c *Controller) ListRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	inherited bool,
	filter *types.WebhookFilter,
) ([]*types.Webhook, int64, error)

ListRepo returns the webhooks from the provided repository.

func (*Controller) ListSpace

func (c *Controller) ListSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	inherited bool,
	filter *types.WebhookFilter,
) ([]*types.Webhook, int64, error)

ListSpace returns the webhooks from the provided space.

func (*Controller) RetriggerExecutionRepo

func (c *Controller) RetriggerExecutionRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	webhookIdentifier string,
	webhookExecutionID int64,
) (*types.WebhookExecution, error)

RetriggerExecutionRepo retriggers an existing webhook execution.

func (*Controller) RetriggerExecutionSpace

func (c *Controller) RetriggerExecutionSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	webhookIdentifier string,
	webhookExecutionID int64,
) (*types.WebhookExecution, error)

RetriggerExecutionSpace retriggers an existing webhook execution.

func (*Controller) UpdateRepo

func (c *Controller) UpdateRepo(
	ctx context.Context,
	session *auth.Session,
	repoRef string,
	webhookIdentifier string,
	in *types.WebhookUpdateInput,
) (*types.Webhook, error)

UpdateRepo updates an existing webhook.

func (*Controller) UpdateSpace

func (c *Controller) UpdateSpace(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	webhookIdentifier string,
	in *types.WebhookUpdateInput,
) (*types.Webhook, error)

UpdateSpace updates an existing webhook.

type NoopPreprocessor

type NoopPreprocessor struct {
}

func (NoopPreprocessor) IsInternalCall

func (p NoopPreprocessor) IsInternalCall(enum.PrincipalType) bool

func (NoopPreprocessor) PreprocessCreateInput

func (p NoopPreprocessor) PreprocessCreateInput(
	enum.PrincipalType,
	*types.WebhookCreateInput,
) (bool, error)

PreprocessCreateInput always return false for internal.

func (NoopPreprocessor) PreprocessFilter

func (p NoopPreprocessor) PreprocessFilter(_ enum.PrincipalType, filter *types.WebhookFilter)

func (NoopPreprocessor) PreprocessUpdateInput

func (p NoopPreprocessor) PreprocessUpdateInput(
	enum.PrincipalType,
	*types.WebhookUpdateInput,
) (bool, error)

PreprocessUpdateInput always return false for internal.

type Preprocessor

type Preprocessor interface {
	PreprocessCreateInput(enum.PrincipalType, *types.WebhookCreateInput) (bool, error)
	PreprocessUpdateInput(enum.PrincipalType, *types.WebhookUpdateInput) (bool, error)
	PreprocessFilter(enum.PrincipalType, *types.WebhookFilter)
	IsInternalCall(enum.PrincipalType) bool
}

func ProvidePreprocessor

func ProvidePreprocessor() Preprocessor

Jump to

Keyboard shortcuts

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