Documentation
¶
Index ¶
- type DeliverySnapshot
- type DispatchAuthority
- type Metrics
- type Repository
- 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) 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) 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) (int64, 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) LockInitiatingAccount(ctx context.Context, tx postgres.DBTX, user slug.Slug) error
- func (Repository) Metrics(ctx context.Context, db postgres.DBTX) (Metrics, error)
- func (Repository) Preflight(ctx context.Context, db postgres.DBTX) error
- func (Repository) PreflightDelivery(ctx context.Context, db postgres.DBTX) 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 Repository ¶
type Repository struct{}
func New ¶
func New() Repository
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) ClaimNext ¶
ClaimNext obtains the next opaque execution capability through a SECURITY DEFINER function. The executor role has no direct table access.
func (Repository) DeleteExpired ¶
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) 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) LockInitiatingAccount ¶
func (Repository) Metrics ¶
Metrics reads only fixed queue aggregates through the executor capability.
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.
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
}