Documentation
¶
Index ¶
- Constants
- Variables
- type AcceptRequest
- type Acceptance
- type DeliveryDiagnostic
- type PipelineExecutor
- type Producer
- type SecretResolver
- type Service
- func (s *Service) Accept(ctx context.Context, request AcceptRequest) (Acceptance, error)
- func (s *Service) ExecuteDelivery(ctx context.Context, args jobs.PipelineWebhookDeliveryArgs) error
- func (s *Service) GetDelivery(ctx context.Context, ...) (DeliveryDiagnostic, error)
- func (s *Service) ListDeliveries(ctx context.Context, ...) (model.ListResponse[DeliveryDiagnostic], error)
- func (s *Service) ReplayDelivery(ctx context.Context, ...) (DeliveryDiagnostic, error)
Constants ¶
View Source
const (
MaxDeliveryBodyBytes = pipelinerun.MaxEventInputBytes
)
Variables ¶
View Source
var ( ErrInvalidDelivery = xerror.InvalidInput(xerror.PipelineTrigger) ErrVerificationFailed = xerror.New(xerror.KindUnauthorized, "PIPELINE_WEBHOOK_VERIFICATION_FAILED", "pipeline webhook verification failed") ErrDeliveryConflict = xerror.New(xerror.KindAlreadyExists, "PIPELINE_WEBHOOK_DELIVERY_CONFLICT", "pipeline webhook delivery identity conflict") )
Functions ¶
This section is empty.
Types ¶
type AcceptRequest ¶
type Acceptance ¶
type Acceptance struct{ Replay bool }
type DeliveryDiagnostic ¶
type DeliveryDiagnostic struct {
ReceiverID, DeliveryID, PayloadDigest, Status string
TriggerSlug, PipelineSlug slug.Slug
TriggerRevision int64
PayloadSizeBytes int64
MappedInputNames []string
LinkedRunSlug *slug.Slug
AttemptNumber, DuplicateCount int
FailureKind, FailureReason *string
NextRetryAt, StartedAt, CompletedAt *time.Time
ReceivedAt, UpdatedAt time.Time
LastDuplicateAt *time.Time
ReplayAvailable bool
}
type PipelineExecutor ¶
type PipelineExecutor interface {
FailUnadmittedRun(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug) error
AcceptQueuedRun(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug, slug.Slug, pipelinerun.RunSourceSummary, time.Time, int64) error
EnsureQueuedTriggerRun(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug, slug.Slug, pipelinerun.RunSourceSummary, time.Time, int64) error
StartQueuedRun(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug, time.Time) error
ExecuteVerifiedEvent(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug, *slug.Slug, model.EventActor, pipelinerun.RunSourceSummary, map[string]any, json.RawMessage) (*pipelinesvc.PipelineRunDetail, error)
ExecuteVerifiedEventVersion(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug, string, *slug.Slug, model.EventActor, pipelinerun.RunSourceSummary, map[string]any, json.RawMessage) (*pipelinesvc.PipelineRunDetail, error)
GetRun(context.Context, slug.Slug, slug.Slug, slug.Slug, string) (*pipelinesvc.PipelineRunDetail, error)
}
type SecretResolver ¶
type SecretResolver interface {
ResolvePipelineWebhookSecret(context.Context, credentialssvc.ResolvePipelineWebhookSecretParams) ([]byte, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( txm postgres.TransactionManager, repo pipelinewebhooks.Repository, secrets SecretResolver, producer Producer, executor PipelineExecutor, cipher crypto.CredentialCipher, clk clock.Clock, notifier notificationsvc.CandidateProducer, ) (*Service, error)
func (*Service) Accept ¶
func (s *Service) Accept(ctx context.Context, request AcceptRequest) (Acceptance, error)
func (*Service) ExecuteDelivery ¶
func (*Service) GetDelivery ¶
func (*Service) ListDeliveries ¶
func (s *Service) ListDeliveries(ctx context.Context, orgSlug, projectSlug, environmentSlug, triggerSlug slug.Slug, includeHistory bool, req model.ListRequest) (model.ListResponse[DeliveryDiagnostic], error)
func (*Service) ReplayDelivery ¶
Click to show internal directories.
Click to hide internal directories.