Documentation
¶
Overview ¶
Package turncontrol defines session-authenticated TURN delegation messages. It contains wire values only; issuers, sockets and account policy stay outside core.
Index ¶
Constants ¶
Variables ¶
var ErrMessage = errors.New("invalid TURN path control")
Functions ¶
Types ¶
type Available ¶
Available replaces the bounded profile inventory. Its header sequence is the sender configuration revision, independent of receiver demand sequences.
type Grant ¶
type Grant struct {
Authority Header
PathID [IdentityBytes]byte
Replaces [IdentityBytes]byte
Provider, Account, Profile string
CredentialKind CredentialKind
Username, Password string
ValidFor time.Duration
URLs []string
}
Fixed passwords have no WindShare-enforced expiry. Expiring grants carry a remaining duration, so receiver clock skew cannot postpone replacement.
type Header ¶
type Header struct {
SessionID [IdentityBytes]byte
OwnerPathID [IdentityBytes]byte
Sequence uint64
}
type Lane ¶
Lane identifies an authenticated connection incarnation within the session. Epoch prevents a late readiness message from authorizing a later attempt.
type Message ¶
type Message interface {
Header() Header
// contains filtered or unexported methods
}
type Quality ¶
type Quality struct {
Authority Header
PathID [IdentityBytes]byte
Lane Lane
NetworkGeneration [IdentityBytes]byte
SampleSequence uint64
ContentBytes uint64
BusyMilliseconds uint64
PendingBytes uint64
}
Quality is a per-incarnation content measurement. Report remains the cumulative accounting observation across incarnations; neither is a command authorizing retirement. BusyMilliseconds excludes intervals without work.
type Ready ¶
type Ready struct {
Authority Header
PathID [IdentityBytes]byte
Lane Lane
}
Ready acknowledges receiver admission for one exact lane. Replays are idempotent; only matching, still-live sender admission can commit a handoff.
type Recover ¶
type Recover struct {
Authority Header
PathID [IdentityBytes]byte
Reason RecoveryReason
}
Recover requests a bounded replacement without retiring a still-usable lane. The grant authority and path ID make duplicate or stale requests harmless.
type RecoveryReason ¶
type RecoveryReason uint8
const ( AllocationStateMismatch RecoveryReason = iota + 1 )
type Report ¶
type Report struct {
Authority Header
PathID [IdentityBytes]byte
UsefulBytes uint64
}
Report carries receiver-confirmed useful content, not a billing assertion. The cumulative counter makes retries on surviving control lanes idempotent.
type Retire ¶
type Retire struct {
Authority Header
PathID [IdentityBytes]byte
Reason RetireReason
}
type RetireReason ¶
type RetireReason uint8
const ( Idle RetireReason = iota + 1 Replaced Expired BudgetExhausted ProviderRevoked Unhelpful )
type Unavailable ¶
type Unavailable struct {
}
func (Unavailable) Header ¶
func (m Unavailable) Header() Header