Documentation
¶
Index ¶
- type DeliverySnapshot
- type DispatchAuthority
- type FTPArtifactPermit
- type Metrics
- type Repository
- func (Repository) BindProposal(ctx context.Context, tx postgres.DBTX, id uuid.UUID, ...) (bool, error)
- func (Repository) BindSource(ctx context.Context, db postgres.DBTX, id uuid.UUID, org string, ...) error
- func (Repository) BindUser(ctx context.Context, tx postgres.DBTX, id uuid.UUID, org string, ...) error
- func (Repository) Cancel(ctx context.Context, db postgres.DBTX, id uuid.UUID) (bool, error)
- func (Repository) CheckDispatch(ctx context.Context, db postgres.DBTX, expected DispatchAuthority) (bool, error)
- func (Repository) CheckFTPArtifactRead(ctx context.Context, db postgres.DBTX, permit FTPArtifactPermit, ...) (bool, error)
- func (Repository) Claim(ctx context.Context, db postgres.DBTX, id uuid.UUID) (Request, bool, error)
- func (Repository) ClaimNext(ctx context.Context, db postgres.DBTX) (Request, bool, error)
- func (Repository) ClaimedProposalAuthorization(ctx context.Context, tx postgres.DBTX, id, claim uuid.UUID) (model.AuthorizationFacts, error)
- func (Repository) Complete(ctx context.Context, db postgres.DBTX, id, claimToken uuid.UUID, result []byte, ...) error
- func (Repository) Create(ctx context.Context, tx postgres.DBTX, request Request, expiresAt time.Time) error
- func (Repository) DeleteExpired(ctx context.Context, db postgres.DBTX, cutoff time.Time) (int64, error)
- func (Repository) FTPArtifactSubmissionToken(ctx context.Context, db postgres.DBTX, deliveryID uuid.UUID, request Request, ...) (uuid.UUID, error)
- func (Repository) Find(ctx context.Context, db postgres.DBTX, id uuid.UUID, organizationSlug string) (Request, error)
- func (Repository) FindForDelivery(ctx context.Context, db postgres.DBTX, id uuid.UUID) (DeliverySnapshot, bool, error)
- func (Repository) Heartbeat(ctx context.Context, db postgres.DBTX, id, claimToken uuid.UUID) (bool, error)
- func (Repository) LockExpired(ctx context.Context, db postgres.DBTX) (time.Time, error)
- func (Repository) LockInitiatingAccount(ctx context.Context, tx postgres.DBTX, user slug.Slug) error
- func (Repository) MarkFTPArtifactSubmitted(ctx context.Context, tx postgres.DBTX, deliveryID uuid.UUID, request Request, ...) (bool, error)
- func (Repository) Metrics(ctx context.Context, db postgres.DBTX) (Metrics, error)
- func (Repository) PollResponse(ctx context.Context, db postgres.DBTX, id uuid.UUID, organizationSlug string) (Request, error)
- func (Repository) Preflight(ctx context.Context, db postgres.DBTX) error
- func (Repository) PreflightDelivery(ctx context.Context, db postgres.DBTX) error
- func (Repository) SpendFTPArtifactPermit(ctx context.Context, tx postgres.DBTX, permit FTPArtifactPermit) (bool, error)
- type Request
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliverySnapshot ¶
type DispatchAuthority ¶
type FTPArtifactPermit ¶
type Repository ¶
type Repository struct{}
func New ¶
func New() Repository
func (Repository) BindProposal ¶
func (Repository) BindSource ¶
func (Repository) BindUser ¶
func (Repository) BindUser(ctx context.Context, tx postgres.DBTX, id uuid.UUID, org string, user slug.Slug) error
BindUser serializes admission with account removal. The service keeps this lock and the new request in the same transaction until dispatch is committed.
func (Repository) CheckDispatch ¶
func (Repository) CheckDispatch(ctx context.Context, db postgres.DBTX, expected DispatchAuthority) (bool, error)
CheckDispatch exposes only authority for the claimed UUID, never source data.
func (Repository) CheckFTPArtifactRead ¶
func (Repository) ClaimNext ¶
ClaimNext obtains the next opaque execution capability through a SECURITY DEFINER function. The executor role has no direct table access.
func (Repository) ClaimedProposalAuthorization ¶
func (Repository) ClaimedProposalAuthorization(ctx context.Context, tx postgres.DBTX, id, claim uuid.UUID) (model.AuthorizationFacts, error)
func (Repository) DeleteExpired ¶
func (Repository) DeleteExpired(ctx context.Context, db postgres.DBTX, cutoff time.Time) (int64, error)
DeleteExpired expires encrypted envelopes while retaining unresolved processing metadata. Its count includes only deleted rows, not scrubbed payloads. It runs on the control-plane connection; executors have no table DELETE privilege.
func (Repository) FTPArtifactSubmissionToken ¶
func (Repository) FindForDelivery ¶
func (Repository) FindForDelivery( ctx context.Context, db postgres.DBTX, id uuid.UUID, ) (DeliverySnapshot, bool, error)
FindForDelivery locks one opaque River delivery so the service can decide its disposition without racing another claimant.
func (Repository) Heartbeat ¶
func (Repository) Heartbeat(ctx context.Context, db postgres.DBTX, id, claimToken uuid.UUID) (bool, error)
Heartbeat renews the scoped capability and reports cancellation/deadline.
func (Repository) LockExpired ¶
LockExpired serializes expiry against new checkpoint pins. The caller must keep this transaction open through DeleteExpired's fresh-snapshot recheck.
func (Repository) LockInitiatingAccount ¶
func (Repository) MarkFTPArtifactSubmitted ¶
func (Repository) Metrics ¶
Metrics reads only fixed queue aggregates through the executor capability.
func (Repository) PollResponse ¶
func (Repository) PollResponse(ctx context.Context, db postgres.DBTX, id uuid.UUID, organizationSlug string) (Request, error)
PollResponse returns the envelopes needed to handle the observed state.
func (Repository) Preflight ¶
Preflight verifies the executor's complete capability set without claiming or mutating work. Missing migration/functions or grants fail startup closed.
func (Repository) PreflightDelivery ¶
PreflightDelivery verifies the app worker can claim one opaque River delivery and then heartbeat and complete the resulting request.
func (Repository) SpendFTPArtifactPermit ¶
func (Repository) SpendFTPArtifactPermit(ctx context.Context, tx postgres.DBTX, permit FTPArtifactPermit) (bool, error)
type Request ¶
type Request struct {
ClaimToken uuid.UUID
ObservedAt time.Time
ObservedLocallyAt time.Time
ID uuid.UUID
OrganizationSlug string
DataSourceSlug string
Kind string
State State
RequestCiphertext []byte
ResultCiphertext []byte
DeadlineAt time.Time
CancelRequestedAt *time.Time
LeaseExpiresAt *time.Time
QueueDeadlineAt *time.Time
ConcurrencyLimit int
QueueCapacity int
}