turnsession

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package turnsession owns the lifetime of TURN authorization for one authenticated share session.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownGrant = errors.New("TURN grant is missing or expired")

Functions

This section is empty.

Types

type Capacity

type Capacity struct {
	// contains filtered or unexported fields
}

Capacity covers negotiation through authenticated attachment. An established lane owns its transport independently and no longer consumes this permit.

func NewCapacity

func NewCapacity() *Capacity

func (*Capacity) Acquire

func (c *Capacity) Acquire(ctx context.Context) (func(), error)

type Demand

type Demand struct {
	// contains filtered or unexported fields
}

Delivery clocks advance only while more network supply can help. A sink blocked on disk must not spend fallback quota even if its download is large.

func (*Demand) Observe

func (d *Demand) Observe(now time.Time, s lanes.SchedulingDemand) p.TURNMode

type OfferGrant

type OfferGrant struct {
	// contains filtered or unexported fields
}

OfferGrant authorizes one accepted offer while it waits for local ICE capacity. Later rotations change what a new offer can bind without revoking this one.

func (OfferGrant) GrantAt

func (g OfferGrant) GrantAt(now time.Time) (p.TURNGrant, bool)

GrantAt supplies local ICE credentials. Wire TTL rounding does not shorten an offer already in flight, even during the last fraction of a millisecond.

func (OfferGrant) ServiceID

func (g OfferGrant) ServiceID() string

type Provider

type Provider interface {
	Issue(context.Context, turngrant.IssueRequest) turngrant.IssueResult
}

type Send

type Send func(context.Context, []byte) error

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

func NewSender

func NewSender(trace turngrant.Trace, provider Provider, now func() time.Time) *Sender

func (*Sender) BindOffer

func (s *Sender) BindOffer(id p.TURNGrantID) (OfferGrant, bool)

func (*Sender) Close

func (s *Sender) Close()

func (*Sender) Handle

func (s *Sender) Handle(ctx context.Context, body []byte, send Send) error

func (*Sender) Lookup

func (s *Sender) Lookup(id p.TURNGrantID) (p.TURNGrant, bool)

Lookup returns the remaining lifetime representable on the wire.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL