Versions in this module Expand all Collapse all v0 v0.1.0 Aug 16, 2026 Changes in this version + const DataFrameOverhead + const LaneIDSize + const MaxClientHelloSize + const MaxDiagnosticSize + const MaxEncodedFrameSize + const MaxFrameContentSize + const MaxPacketLifetimeMicros + const MaxPacketSize + const MaxProbePayloadSize + const NonceSize + const PathGroupIDSize + const ProbeFrameOverhead + const SessionIDSize + const SessionSecretSize + const Version + var ErrAuthenticationFailed = errors.New("authentication failed") + var ErrDiagnosticTooLarge = errors.New("diagnostic too large") + var ErrFrameTooLarge = errors.New("frame too large") + var ErrInvalidClientHello = errors.New("invalid client hello") + var ErrInvalidControlFrame = errors.New("invalid control frame") + var ErrInvalidDataFrame = errors.New("invalid data frame") + var ErrInvalidFrameType = errors.New("invalid frame type") + var ErrInvalidMagic = errors.New("invalid protocol magic") + var ErrInvalidServerHello = errors.New("invalid server hello") + var ErrMissingAuthKey = errors.New("missing authentication key") + var ErrProbeTooLarge = errors.New("probe too large") + var ErrTrailingFrameData = errors.New("trailing frame data") + var ErrUnsupportedVersion = errors.New("unsupported protocol version") + func AppendDataFrame(destination []byte, data Data) ([]byte, error) + func AppendFrame(destination []byte, frame Frame) ([]byte, error) + func DataFrameSize(data Data) (int, error) + func MarshalClientHello(hello ClientHello) ([]byte, error) + func MarshalDataFrame(data Data) ([]byte, error) + func MarshalFrame(frame Frame) ([]byte, error) + func MarshalServerHello(hello ServerHello) ([]byte, error) + func SignClientHello(hello *ClientHello, key []byte) error + func SignServerHello(hello *ServerHello, key []byte) error + func VerifyClientHello(hello ClientHello, key []byte) error + func VerifyServerHello(hello ServerHello, key []byte) error + func WriteClientHello(writer io.Writer, hello ClientHello) error + func WriteServerHello(writer io.Writer, hello ServerHello) error + type AuthTag [sha256.Size]byte + type ClientHello struct + AuthTag AuthTag + Generation uint64 + LaneID LaneID + Mode HelloMode + MonotonicMicros uint64 + Nonce Nonce + PathGroupID PathGroupID + SessionID SessionID + Target target.Endpoint + UnixSeconds int64 + func ParseClientHello(encoded []byte) (ClientHello, error) + func ReadClientHello(reader io.Reader) (ClientHello, error) + type ClockSync struct + ClientReceiveMicros uint64 + ClientSendMicros uint64 + ServerReceiveMicros uint64 + ServerSendMicros uint64 + func ParseClockSync(frame Frame) (ClockSync, error) + type CloseReason uint8 + const CloseClientShutdown + func ParseSessionClose(frame Frame) (CloseReason, error) + func (r CloseReason) Valid() bool + type Data struct + DeadlineMicros uint64 + PacketID uint64 + Payload []byte + func ParseData(frame Frame) (Data, error) + type DeliveryReport struct + DataBytes uint64 + DataPackets uint64 + Generation uint64 + LaneID LaneID + ProbeBytes uint64 + ProbePackets uint64 + func ParseDeliveryReport(frame Frame) (DeliveryReport, error) + type ErrorClass uint8 + const ErrorLaneRejected + const ErrorRetryable + const ErrorSessionGone + const ErrorSessionRejected + func (c ErrorClass) Valid() bool + type ErrorCode uint16 + const ErrorAuthentication + const ErrorClockSkew + const ErrorInternal + const ErrorLaneLimit + const ErrorMalformed + const ErrorProtocolViolation + const ErrorRateLimited + const ErrorReplay + const ErrorSessionLimit + const ErrorSessionNotFound + const ErrorStaleGeneration + const ErrorTargetDenied + const ErrorUnavailable + const ErrorUnsupportedVersion + func (c ErrorCode) Valid() bool + type ErrorFrame struct + Class ErrorClass + Code ErrorCode + Diagnostic string + Generation uint64 + LaneID LaneID + Scope ErrorScope + func ParseErrorFrame(frame Frame) (ErrorFrame, error) + type ErrorScope uint8 + const ErrorScopeLane + const ErrorScopeSession + func (s ErrorScope) Valid() bool + type Frame struct + Payload []byte + Type FrameType + func AppendFrames(destination []Frame, message []byte) ([]Frame, error) + func MarshalClockSync(sync ClockSync) (Frame, error) + func MarshalData(data Data) (Frame, error) + func MarshalDeliveryReport(report DeliveryReport) (Frame, error) + func MarshalErrorFrame(value ErrorFrame) (Frame, error) + func MarshalLaneAbandon(lane LaneGeneration) (Frame, error) + func MarshalLaneAccepted(accepted LaneAccepted) (Frame, error) + func MarshalProbe(probe Probe) (Frame, error) + func MarshalSessionClose(reason CloseReason) (Frame, error) + func MarshalSessionCreated(created SessionCreated) (Frame, error) + func MarshalTimingPing(ping TimingPing) (Frame, error) + func MarshalTimingPong(pong TimingPong) (Frame, error) + func ParseFrames(message []byte) ([]Frame, error) + func ReadFrame(reader io.Reader) (Frame, error) + type FrameReader struct + func (r *FrameReader) Read(reader io.Reader) (Frame, error) + type FrameSequence struct + func ParseFrameSequence(message []byte) (FrameSequence, error) + func (s *FrameSequence) Next() (Frame, bool) + type FrameType uint8 + const FrameClockSync + const FrameData + const FrameDeliveryReport + const FrameError + const FrameLaneAbandon + const FrameLaneAccepted + const FramePing + const FramePong + const FrameProbe + const FrameSessionClose + const FrameSessionCreated + func (t FrameType) Valid() bool + type HelloMode uint8 + const HelloCreate + const HelloJoin + func (m HelloMode) Valid() bool + type LaneAccepted struct + PathGroupID PathGroupID + ReceiveMicros uint64 + SendMicros uint64 + SessionID SessionID + func ParseLaneAccepted(frame Frame) (LaneAccepted, error) + type LaneGeneration struct + Generation uint64 + LaneID LaneID + func ParseLaneAbandon(frame Frame) (LaneGeneration, error) + type LaneID [LaneIDSize]byte + func NewLaneID() LaneID + func ParseLaneID(value string) (LaneID, error) + func (id LaneID) IsZero() bool + func (id LaneID) String() string + type Nonce [NonceSize]byte + func NewNonce() Nonce + func ParseNonce(value string) (Nonce, error) + func (nonce Nonce) String() string + type PathGroupID [PathGroupIDSize]byte + func NewPathGroupID() PathGroupID + func ParsePathGroupID(value string) (PathGroupID, error) + func (id PathGroupID) IsZero() bool + func (id PathGroupID) String() string + type Probe struct + ID uint64 + Payload []byte + func ParseProbe(frame Frame) (Probe, error) + type ServerHello struct + AuthTag AuthTag + Diagnostic string + ErrorClass ErrorClass + ErrorCode ErrorCode + ErrorScope ErrorScope + PathGroupID PathGroupID + ReceiveMicros uint64 + RequestNonce Nonce + Result ServerHelloResult + SendMicros uint64 + ServerUnixSeconds int64 + SessionID SessionID + SessionSecret SessionSecret + func ParseServerHello(encoded []byte) (ServerHello, error) + func ReadServerHello(reader io.Reader) (ServerHello, error) + type ServerHelloResult uint8 + const ServerLaneAccepted + const ServerRejected + const ServerSessionCreated + func (r ServerHelloResult) Valid() bool + type SessionCreated struct + PathGroupID PathGroupID + ReceiveMicros uint64 + SendMicros uint64 + SessionID SessionID + SessionSecret SessionSecret + func ParseSessionCreated(frame Frame) (SessionCreated, error) + type SessionID [SessionIDSize]byte + func NewSessionID() SessionID + func ParseSessionID(value string) (SessionID, error) + func (id SessionID) IsZero() bool + func (id SessionID) String() string + type SessionSecret [SessionSecretSize]byte + func NewSessionSecret() SessionSecret + type TimingPing struct + ID uint64 + SendMicros uint64 + func ParseTimingPing(frame Frame) (TimingPing, error) + type TimingPong struct + ID uint64 + PingSendMicros uint64 + ReceiveMicros uint64 + SendMicros uint64 + func ParseTimingPong(frame Frame) (TimingPong, error)