Documentation
¶
Overview ¶
Package framechannel defines the transport-neutral byte channel consumed by suite-02 protocol sessions.
Index ¶
- Constants
- Variables
- func ClassifyDeadline(channel any, cause error) error
- func RejectSend(cause error) error
- func RetireSend(cause error) error
- func WithCapacityWait(channel any, cause error) error
- type BandwidthWaitError
- type CapacityPressure
- type Channel
- type ChannelState
- type Frame
- type SendDisposition
Constants ¶
const MaxFrameSize = 64 * 1024
Variables ¶
var ( ErrSendRejected = errors.New("frame channel rejected send before transport acceptance") ErrSendRetired = errors.New("frame channel retired before transport acceptance") )
Functions ¶
func ClassifyDeadline ¶
func RejectSend ¶
RejectSend reports a local or caller-controlled rejection that either never reached transport ownership or was transactionally retracted before exposure. It is not evidence that the channel retired.
func RetireSend ¶
RetireSend reports that channel retirement won the transport admission race. Session owners may treat this exact disposition as natural lane completion; they must continue surfacing every accepted or unclassified delivery error.
func WithCapacityWait ¶
WithCapacityWait is called only at a progress/deadline boundary, never for authentication, protocol, EOF or explicit cancellation failures.
Types ¶
type BandwidthWaitError ¶
func (*BandwidthWaitError) Error ¶
func (err *BandwidthWaitError) Error() string
func (*BandwidthWaitError) Unwrap ¶
func (err *BandwidthWaitError) Unwrap() error
type CapacityPressure ¶
CapacityPressure is optional transport evidence. Its bounded lifetime and independent heartbeat preserve failure detection while recovery backs off.
type Channel ¶
type Channel interface {
Send(context.Context, Frame) error
SendTerminal(context.Context, Frame) error
Recv() <-chan Frame
State() ChannelState
Close() error
}
Channel exposes only ordered frame delivery and lifecycle. Relay, WebRTC, and in-memory tests implement it without importing session or content semantics.
type ChannelState ¶
type ChannelState uint8
const ( Connecting ChannelState = iota Open Closed )
func (ChannelState) DiagnosticName ¶
func (value ChannelState) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type SendDisposition ¶
type SendDisposition uint8
SendDisposition describes whether a transport acquired ownership of a send before returning an error. Unclassified errors are deliberately treated as accepted: once ownership is uncertain, a protocol caller must not erase a potentially observed frame or retry it as though no transport saw it.
const ( SendAccepted SendDisposition = iota + 1 SendRejected SendRetired )
func SendDispositionOf ¶
func SendDispositionOf(err error) SendDisposition
SendDispositionOf returns the conservative ownership interpretation of err. A nil result means successful transport acceptance; a raw non-nil error is also accepted because the transport did not prove pre-acceptance rejection.
func (SendDisposition) DiagnosticName ¶
func (value SendDisposition) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.