processor

package
v0.0.0-...-b81d1be Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package processor provides a generic interface for processing requests using a list of processors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(logger *slog.Logger, req any, processors ...Processor) (*promotion.Bus, error)

Process is a function that processes a request using a list of processors.

Types

type AuthRequest

type AuthRequest struct {
	Body            []byte
	Headers         map[string]string
	EventProcessors map[event.Type][]Processor
}

AuthRequest is a struct that represents an authentication request.

type FeedbackRequest

type FeedbackRequest struct {
	Bus *promotion.Bus
	Err error
}

FeedbackRequest is a struct that represents a feedback request.

type Option

type Option = func(Processor)

Option is a function that applies an option to a Processor.

type Processor

type Processor interface {
	SetLogger(logger *slog.Logger)
	Process(any) (*promotion.Bus, error)
}

Processor is an interface that defines a method to process a request.

func NewAuthValidatorProcessor

func NewAuthValidatorProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewAuthValidatorProcessor initializes and returns a new Processor for validating authentication against Controller operations. It accepts a Controller and optional configuration options to customize its behavior.

func NewCheckRunFeedbackProcessor

func NewCheckRunFeedbackProcessor(githubController *github.Controller, opts ...Option) Processor

NewCheckRunFeedbackProcessor creates a new processor for handling feedback from check run events.

func NewCheckSuiteEventProcessor

func NewCheckSuiteEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewCheckSuiteEventProcessor initializes a Processor for handling check suite events with optional configurations.

func NewCommitStatusFeedbackProcessor

func NewCommitStatusFeedbackProcessor(githubController *github.Controller, opts ...Option) Processor

NewCommitStatusFeedbackProcessor creates a new processor for handling feedback from commit status checks.

func NewDeploymentStatusEventProcessor

func NewDeploymentStatusEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewDeploymentStatusEventProcessor initializes a Processor for handling deployment status events with optional configurations.

func NewDynamicPromotionPreProcessor

func NewDynamicPromotionPreProcessor(githubController *github.Controller, opts ...Option) Processor

NewDynamicPromotionPreProcessor initializes and returns a Processor for handling dynamic promotion, applying the given options.

func NewFastForwarderPostProcessor

func NewFastForwarderPostProcessor(githubController *github.Controller, opts ...Option) Processor

NewFastForwarderPostProcessor constructs a Processor instance for handling Controller status events with optional configurations.

func NewPullRequestEventProcessor

func NewPullRequestEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewPullRequestEventProcessor creates and returns a Processor to handle pull request events, initialized with given Controller controller and options.

func NewPullRequestReviewEventProcessor

func NewPullRequestReviewEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewPullRequestReviewEventProcessor initializes a Processor for handling pull request review events with optional configurations.

func NewPushEventProcessor

func NewPushEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewPushEventProcessor creates a push event processor with an optional configuration and attaches a Controller controller to it.

func NewS3UploaderPostProcessor

func NewS3UploaderPostProcessor(awsController *aws.Controller, opts ...Option) Processor

NewS3UploaderPostProcessor constructs a Processor instance for handling S3 upload post-processing with optional configurations.

func NewStatusEventProcessor

func NewStatusEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewStatusEventProcessor constructs a Processor instance for handling Controller status events with optional configurations.

func NewWorkflowRunEventProcessor

func NewWorkflowRunEventProcessor(githubController *internalGitHub.Controller, opts ...Option) Processor

NewWorkflowRunEventProcessor initializes a Processor for handling workflow run events with optional configurations.

Jump to

Keyboard shortcuts

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