Documentation
¶
Overview ¶
Package pipelinesinkeffects persists durable pipeline sink side-effect decisions.
Index ¶
- Variables
- func ConfirmFTPArtifactDelivery(ctx context.Context, tx postgres.DBTX, org slug.Slug, environmentID int64, ...) (bool, error)
- func CreateFTPArtifactIntent(ctx context.Context, tx postgres.DBTX, ...) (bool, error)
- func FindFTPArtifactIntent(ctx context.Context, db postgres.DBTX, org slug.Slug, environmentID int64, ...) (dbgen.PipelineArtifactDelivery, error)
- type Repository
- type RepositoryWithLogging
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPipelineSinkEffectNotFound indicates that no effect exists in the requested tenant scope. ErrPipelineSinkEffectNotFound = xerror.NotFound(xerror.PipelineSinkEffect).Detail("pipeline sink effect not found") // ErrProjectEnvironmentNotFound indicates that the requested tenant environment is unavailable. ErrProjectEnvironmentNotFound = xerror.NotFound(xerror.ProjectEnvironment) )
Functions ¶
func ConfirmFTPArtifactDelivery ¶
func ConfirmFTPArtifactDelivery(ctx context.Context, tx postgres.DBTX, org slug.Slug, environmentID int64, deliveryID, publishID uuid.UUID) (bool, error)
ConfirmFTPArtifactDelivery updates the original effect and its receipt together. Call only after validating the successful private broker response.
func CreateFTPArtifactIntent ¶
func CreateFTPArtifactIntent(ctx context.Context, tx postgres.DBTX, intent dbgen.CreateFTPArtifactIntentParams) (bool, error)
CreateFTPArtifactIntent joins the already claimed effect in the caller's transaction. False means the claim, scope, or preallocated identity refused it.
Types ¶
type Repository ¶
type Repository interface {
BeginOrGet(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
attempt pipelinerun.SinkEffectAttempt,
) (*pipelinerun.SinkEffect, error)
MarkSucceeded(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug, environmentSlug slug.Slug,
attempt pipelinerun.SinkEffectAttempt,
) error
}
Repository persists pre-effect claims and terminal success for one sink execution. Each method receives the caller's transaction explicitly so runtime orchestration can make the ledger durable before invoking an external provider.
func NewRepositoryWithLogging ¶
func NewRepositoryWithLogging(base Repository, logger *slog.Logger) Repository
NewRepositoryWithLogging wraps base with method completion logging.
type RepositoryWithLogging ¶
type RepositoryWithLogging struct {
// contains filtered or unexported fields
}
RepositoryWithLogging implements Repository with method completion logging.
func (RepositoryWithLogging) BeginOrGet ¶
func (_d RepositoryWithLogging) BeginOrGet(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, attempt pipelinerun.SinkEffectAttempt) (sp1 *pipelinerun.SinkEffect, err error)
BeginOrGet implements Repository.
func (RepositoryWithLogging) MarkSucceeded ¶
func (_d RepositoryWithLogging) MarkSucceeded(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, attempt pipelinerun.SinkEffectAttempt) (err error)
MarkSucceeded implements Repository.