Documentation
¶
Overview ¶
Package nodeinput composes verified Go source transport with worker-local encoder input. It supplies no remote source retirement proof.
Index ¶
- Constants
- Variables
- type Accounting
- type Gateway
- func (g *Gateway) Admit(ctx context.Context, s remotetranscode.Start, grant nodesource.Grant, ...) (*Input, error)
- func (g *Gateway) Close() error
- func (*Gateway) GoString() string
- func (g *Gateway) Reconcile() Accounting
- func (g *Gateway) Serve(ctx context.Context) error
- func (g *Gateway) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (*Gateway) String() string
- type Input
- func (in *Input) ClaimInput(callback func(error)) error
- func (in *Input) GatewayInput(id remotetranscode.Identity, handle string) (string, core.EncoderInputLease, error)
- func (*Input) GoString() string
- func (in *Input) HeadersForInput(raw string) (map[string]string, error)
- func (in *Input) InputDone() <-chan struct{}
- func (in *Input) InputErr() error
- func (in *Input) ReadRecoveryAt(ctx context.Context, expectedRevision string, p []byte, off int64) (int, error)
- func (in *Input) RecoverySourceIdentity() (revision string, size int64, err error)
- func (in *Input) Renew(ctx context.Context, n remotetranscode.Renewal, ...) (RenewalEvidence, error)
- func (in *Input) SealInput()
- func (*Input) String() string
- type Options
- type RenewalEvidence
Constants ¶
const MaxRecoveryRead = 64 << 10
MaxRecoveryRead bounds each optional index read. Larger indexes must use multiple bounded calls; the caller separately bounds total bytes and work.
Variables ¶
var ErrDenied = errors.New("nodeinput: unavailable input")
Functions ¶
This section is empty.
Types ¶
type Accounting ¶
type Accounting struct{ Retained, Pending, Requests int }
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway owns its loopback listener. Host runs Serve and drives Reconcile even during drain. Capacity includes all retained admissions, including failed opens; records are never evicted during this gateway lifetime.
func (*Gateway) Admit ¶
func (g *Gateway) Admit(ctx context.Context, s remotetranscode.Start, grant nodesource.Grant, size int64) (*Input, error)
Admit opens one exact Reader itself: callers cannot substitute a Reader/source. A nonnil Input is responsibility even on error; SealInput and Reconcile it. Authority expiry must cover Start on the composing host's conservative clock policy. This local comparison does not establish cross-host clock agreement.
func (*Gateway) Close ¶
Close seals all admissions, cancels reads, closes sockets (including blocked writers), and returns without waiting for producers. Reconcile retains proof.
func (*Gateway) Reconcile ¶
func (g *Gateway) Reconcile() Accounting
Reconcile releases registry ownership before signaling Done/callback outside locks. Pending=0 means no retained producers, not callback completion. A sealed callback is immutable; concurrent reconciliation publishes it once. Tombstones retain only bounded identity/capability state, never a Reader.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is an opaque, exact lease and trusted gateway capability. Never serialize it. String formatting deliberately hides its URL, grant, and scope.
func (*Input) ClaimInput ¶
func (*Input) GatewayInput ¶
func (in *Input) GatewayInput(id remotetranscode.Identity, handle string) (string, core.EncoderInputLease, error)
GatewayInput binds the exact remote execution and stable authority handle.
func (*Input) HeadersForInput ¶
func (*Input) ReadRecoveryAt ¶
func (in *Input) ReadRecoveryAt(ctx context.Context, expectedRevision string, p []byte, off int64) (int, error)
ReadRecoveryAt reads only a complete bounded range of the same claimed input. On error n is zero and callers must discard p. Errors expose no source details. It creates no read goroutine: cancellation is not completion, and the existing Input tracker retains this call until the actual Reader operation returns.
func (*Input) RecoverySourceIdentity ¶
RecoverySourceIdentity describes the already authenticated, immutable source of this claimed input. It is not current remote authority, retained output/AU evidence, or permission to claim another input or start another encoder.
func (*Input) Renew ¶
func (in *Input) Renew(ctx context.Context, n remotetranscode.Renewal, authority func(context.Context, nodesource.Grant) (nodesource.Grant, error)) (RenewalEvidence, error)
Renew may conservatively extend source authority even if stop or worker CAS later rejects acceptance. It never attests worker acceptance or placement. One operation may validate at a time; contention fails closed without waiting. Successful source operations are never replayed as current authority evidence: if worker acceptance is uncertain, reconcile worker history. If unaccepted, retire this generation; source-validation replay is deliberately unsupported. Failed attempts may retry only their exact payload against fresh authority.
type Options ¶
type Options struct {
// ValidateScope checks current execution generation at the local byte consumer.
ValidateScope func(context.Context, nodesource.Scope) error
WatchAuthority func(string, func()) func()
Client *nodesource.Client
Recover func(context.Context, nodesource.Grant) (*nodesource.Client, nodesource.Grant, error)
ReadTimeout time.Duration
MaxRecoveries int
Capacity, MaxRequests int
RequestTimeout time.Duration
}
type RenewalEvidence ¶
type RenewalEvidence struct {
Renewal remotetranscode.Renewal
Identity remotetranscode.Identity
Handle string
Scope nodesource.Scope
Size int64
SourceUntil time.Time
InputLease core.EncoderInputLease
}
RenewalEvidence is local evidence for composing ValidateRenewal, not placement proof. No bearer is exposed and no raw expiry setter exists.