Documentation
¶
Overview ¶
Package gateway is the capability gateway and operation ledger for work-tracker connections (§10.1, §10.3, contracts.md "Gateway and operation ledger"). An operation id is recorded before any side effect, duplicate idempotency keys return the recorded operation instead of re-executing, and a lost response is resolved by read-back or recorded as unknown, never blindly replayed (A10).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrForbidden = errors.New("operation not granted") ErrInvalid = errors.New("invalid request") )
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
Ledger Ledger
Trackers Trackers
Metrics *metrics.Metrics
Log *slog.Logger
// Attempts bounds tries of a retryable failure; Backoff is the first delay.
Attempts int
Backoff time.Duration
}
Gateway invokes tracker operations on behalf of seats.
type Ledger ¶
type Ledger interface {
BeginOperation(ctx context.Context, f store.Fence, in store.NewOperation) (*runtimeapi.Operation, bool, error)
FinishOperation(ctx context.Context, id, status, receipt string, result json.RawMessage, errText string, attempts int) error
}
Ledger is the durable operation record.
Click to show internal directories.
Click to hide internal directories.