Documentation
¶
Overview ¶
Package playbackcontinuity allocates durable output floors after authenticated retirement. It does not start encoders, release capacity, or serve manifests.
Index ¶
- Variables
- type Budget
- type DeliverySample
- type EvidenceVerifier
- type Floor
- type Mapping
- type Phase
- type PublicIdentity
- type RecoveryRequest
- type Reservation
- type RestartFacts
- type Retirement
- type Service
- func (s *Service) CommitRestart(ctx context.Context, session, token string, next placement.Fence, ...) (Mapping, error)
- func (s *Service) Lookup(ctx context.Context, session string) (State, error)
- func (s *Service) Open(ctx context.Context, binding SourceBinding, public PublicIdentity) (State, error)
- func (s *Service) RecordDelivery(ctx context.Context, session string, d DeliverySample) (State, error)
- func (s *Service) ReserveRecovery(ctx context.Context, r RecoveryRequest) (Reservation, error)
- type SourceBinding
- type SourceReopenVerifier
- type State
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalid = errors.New("playbackcontinuity: invalid contract") ErrStale = errors.New("playbackcontinuity: stale fence, epoch, phase or revision") ErrProof = errors.New("playbackcontinuity: authenticated evidence required") ErrUnsupported = errors.New("playbackcontinuity: media continuity or buffer budget unsupported") ErrUnknownOutcome = errors.New("playbackcontinuity: write outcome unknown; reconcile with Lookup") )
Functions ¶
This section is empty.
Types ¶
type Budget ¶
type Budget struct {
Detection, Fencing, Reopen, Encode, Publish, Safety time.Duration
Proof string
}
Budget consists of externally measured conservative upper bounds for this deployment and source. It is a feasibility requirement, not a seamless claim.
type DeliverySample ¶
type DeliverySample struct {
Fence placement.Fence
Epoch int64
Floor Floor
SourceEnd time.Duration
Buffered time.Duration
Proof string
}
DeliverySample must come from the final delivery authority, after packaging and URI mapping. Worker-to-controller Observe telemetry is never this proof. Buffered is surviving, contiguous downstream playable output measured at the sample, not merely files on the failed host. Proof binds every field, fence, epoch and authenticated viewer/buffer freshness; verifier must reject staleness.
type EvidenceVerifier ¶
type EvidenceVerifier interface {
VerifyDelivery(context.Context, State, DeliverySample) error
VerifyRetirement(context.Context, SourceBinding, Retirement) error
VerifyBudget(context.Context, SourceBinding, Budget) error
VerifyRestart(context.Context, Reservation, placement.Fence, RestartFacts) error
}
EvidenceVerifier is supplied by a trusted control/delivery adapter. It must authenticate evidence, not trust booleans or opaque strings from workers. Calls run outside SQL; CAS afterwards prevents a stale result taking effect. VerifyRestart also validates the proposed new placement fence's authority. It must reject an elapsed/exhausted downstream budget at publication: HTTP completion alone does not establish retained client buffer or decoded output.
type Floor ¶
Floor is the next unused public sequence and the exclusive media timestamp end in nanoseconds. Timestamp is an output clock, not the seekable title clock.
type Mapping ¶
type Mapping struct {
Public PublicIdentity
Epoch, Generation, FirstSequence int64
SourceStart, OutputStart, TimestampOffset time.Duration
// Delivery must add HLS discontinuity + init mapping, or a new DASH Period
// with a correct presentationTimeOffset. This package does not render either.
HLSDiscontinuity, DASHNewPeriod bool
}
type PublicIdentity ¶
type PublicIdentity struct{ SessionURI, GrantURI string }
PublicIdentity contains stable paths, never bearer secrets. The delivery layer must continue authenticating the original public session/grant on every use.
type RecoveryRequest ¶
type RecoveryRequest struct {
Operation string
ExpectedFence placement.Fence
ExpectedEpoch int64
Source SourceBinding
Final DeliverySample
Retirement Retirement
Budget Budget
// SeekTo nil resumes Final.SourceEnd. A seek increments the epoch and may
// move the title clock backwards, but never either output floor.
SeekTo *time.Duration
}
type Reservation ¶
type RestartFacts ¶
type RestartFacts struct {
Source SourceBinding
Sequence int64
SourceStart, OutputStart, OutputEnd time.Duration
Independent bool
Proof string
// ReopenProof is required when affinity changes; a release ID or matching
// filename is not an immutable source identity attestation.
ReopenProof string
}
RestartFacts describes a held, packaged first segment, NOT permission to start an encoder. Proof must cover every required audio/video representation, keyframe independence (including open GOP leading pictures), init/codec compatibility, actual PTS/DTS/tfdt and timescales, and exact immutable reopen. Only an actual muxed clock can satisfy OutputStart; changing XML is insufficient.
type Retirement ¶
type Retirement struct{ SourceProof, EncoderProof, HostFenceProof string }
Retirement proofs must authenticate BOTH source and encoder termination for the old exact binding/fence, or trusted external host fencing that covers both hosts and boots. Absence, timeout, lease expiry and heartbeats cannot qualify.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CommitRestart ¶
func (s *Service) CommitRestart(ctx context.Context, session, token string, next placement.Fence, f RestartFacts) (Mapping, error)
CommitRestart commits policy for an already held and verified packaged segment. Caller must enforce publication ordering and retirement independently. A token is never an encoder-start permit; replay never grants fresh authority.
func (*Service) Open ¶
func (s *Service) Open(ctx context.Context, binding SourceBinding, public PublicIdentity) (State, error)
Open records an initial execution. It is not a placement admission. Replaying the identical Open never resets generations, phases, epochs or output floors.
func (*Service) RecordDelivery ¶
func (s *Service) RecordDelivery(ctx context.Context, session string, d DeliverySample) (State, error)
RecordDelivery advances floors only from authenticated final delivery. A reserved transition freezes publication floors; authentic late reports fail. Delivery can continue serving/replaying already committed buffered media without changing these floors. This service never revokes that delivery.
func (*Service) ReserveRecovery ¶
func (s *Service) ReserveRecovery(ctx context.Context, r RecoveryRequest) (Reservation, error)
type SourceBinding ¶
SourceBinding pins the exact immutable source, including its owning process. Fence is the associated encoder execution, not a separate source placement.
type SourceReopenVerifier ¶
type SourceReopenVerifier interface {
VerifyReopen(context.Context, SourceBinding, SourceBinding, string) error
}
SourceReopenVerifier is an optional trusted capability. Without it, changing source owner or PlayID is unsupported. Providers must explicitly authenticate the old/new binding and identical immutable revision, including new affinity.