Documentation
¶
Overview ¶
Package icepolicy owns trusted, transport-independent ICE selection policy. Construct pools only from build, deployment, or explicit local configuration.
Index ¶
- Constants
- Variables
- type AttemptICEProfile
- type CandidateBudget
- type CandidateDecision
- type Endpoint
- type EndpointFact
- type FactStore
- func (s *FactStore) RecordEndpointFailure(profile AttemptICEProfile, endpointID string, now time.Time) bool
- func (s *FactStore) RecordProfile(profile AttemptICEProfile, produced bool, delay time.Duration, now time.Time)
- func (s *FactStore) SetGeneration(generation string)
- func (s *FactStore) Snapshot() GenerationFacts
- type GenerationFacts
- type ICEEndpointPool
- type ProfileFact
- type SelectionRequest
Constants ¶
const ( EndpointsPerProfile = 2 EndpointsPerWave = 4 MaximumCatalogEndpoints = 512 EndpointFailureCooldown = 30 * time.Second ProfileSuccessAge = 15 * time.Minute )
const CloudflareSTUNServer = "stun:stun.cloudflare.com:3478"
const DefaultCandidateLimit = 64
const ExistingDefaultSTUNServer = "stun:stun.l.google.com:19302"
const MaximumCandidateBytes = 4096
const MaximumProfileFacts = 64
const TwilioSTUNServer = "stun:global.stun.twilio.com:3478"
Variables ¶
var ErrConfiguration = errors.New("invalid trusted ICE endpoint configuration")
Functions ¶
This section is empty.
Types ¶
type AttemptICEProfile ¶
type AttemptICEProfile struct {
// contains filtered or unexported fields
}
AttemptICEProfile is a snapshot: accessors copy slices so a live attempt cannot change configuration when the owner's pool or observations change.
func RebindAttemptProfile ¶
func RebindAttemptProfile(profile AttemptICEProfile, request SelectionRequest, facts GenerationFacts) AttemptICEProfile
RebindAttemptProfile rechecks an existing wave's membership against a new network generation without granting another endpoint exploration allowance.
func SelectAttemptProfile ¶
func SelectAttemptProfile(pool ICEEndpointPool, request SelectionRequest, facts GenerationFacts) AttemptICEProfile
func (AttemptICEProfile) EndpointIDs ¶
func (p AttemptICEProfile) EndpointIDs() []string
func (AttemptICEProfile) FailureDomains ¶
func (p AttemptICEProfile) FailureDomains() []string
func (AttemptICEProfile) ID ¶
func (p AttemptICEProfile) ID() string
func (AttemptICEProfile) NetworkGenerationID ¶
func (p AttemptICEProfile) NetworkGenerationID() string
func (AttemptICEProfile) URLs ¶
func (p AttemptICEProfile) URLs() []string
type CandidateBudget ¶
type CandidateBudget struct {
// contains filtered or unexported fields
}
func NewCandidateBudget ¶
func NewCandidateBudget(limit int) *CandidateBudget
func (*CandidateBudget) Accept ¶
func (b *CandidateBudget) Accept(candidate string) CandidateDecision
Accept prunes local gathering; it never validates remote signaling.
func (*CandidateBudget) AcceptMapped ¶
func (b *CandidateBudget) AcceptMapped(candidate string) CandidateDecision
AcceptMapped requires provider provenance, not a guess from srflx SDP.
type CandidateDecision ¶
type EndpointFact ¶
type FactStore ¶
type FactStore struct {
// contains filtered or unexported fields
}
FactStore records only current-network runtime facts. Endpoint errors must be explicitly attributable; profile production never implies endpoint success.
func NewFactStore ¶
func (*FactStore) RecordEndpointFailure ¶
func (*FactStore) RecordProfile ¶
func (*FactStore) SetGeneration ¶
func (*FactStore) Snapshot ¶
func (s *FactStore) Snapshot() GenerationFacts
type GenerationFacts ¶
type GenerationFacts struct {
NetworkGenerationID string
Endpoints []EndpointFact
Profiles []ProfileFact
}
type ICEEndpointPool ¶
type ICEEndpointPool struct {
// contains filtered or unexported fields
}
ICEEndpointPool keeps catalog entries separate from enabled trusted endpoints.
func DefaultPool ¶
func DefaultPool() ICEEndpointPool
Provider-published endpoints are fallbacks, not mainland reachability claims.
func DirectoryPool ¶
func DirectoryPool(directory nodedirectory.Payload) ICEEndpointPool
DirectoryPool consumes only an application's currently trusted snapshot.
func NewICEEndpointPool ¶
func NewICEEndpointPool(entries []Endpoint) (ICEEndpointPool, error)
func ParseLocalConfiguration ¶
func ParseLocalConfiguration(data []byte) (ICEEndpointPool, error)
ParseLocalConfiguration never resolves or contacts an endpoint.