community

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0 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 community owns the native pull-only peer cache. Signed gossip and live reachability have independent lifetimes and are never imported into directory trust.

Index

Constants

View Source
const (
	RefreshInterval = 2 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

func New

func New(path string, policy publicdial.Policy, now func() time.Time, sink diagnostics.Sink) *Pool

func (*Pool) Candidates

func (p *Pool) Candidates(scope Scope) []relayplan.Candidate

func (*Pool) Close

func (p *Pool) Close()

Close aborts pool-owned refreshes and probes and joins their goroutines before releasing idle HTTP connections.

func (*Pool) RecordOriginForbidden

func (p *Pool) RecordOriginForbidden(scope Scope, identity string)

RecordOriginForbidden invalidates cached relay verification for scope and applies origin-scoped rejected backoff when a real relay dial receives HTTP 403 after background warming. Other frontend origins and origin-independent STUN observations remain unaffected.

func (*Pool) Refresh

func (p *Pool) Refresh(ctx context.Context, scope Scope, seeds Seeds)

Refresh coalesces startup bootstrapping and periodic pool maintenance. Shared I/O runs on the pool lifetime context so caller cancellation only unblocks that caller's wait without poisoning coalesced refreshers or probes.

func (*Pool) STUN

func (p *Pool) STUN(generation uint64) []icepolicy.Endpoint

STUN returns live-verified community STUN endpoints for the current network generation. Native UDP STUN does not depend on browser WebSocket Origin, so validity is keyed on network generation, descriptor lifetime, and dial policy.

func (*Pool) Transport

func (p *Pool) Transport() *http.Client

func (*Pool) Verify

func (p *Pool) Verify(ctx context.Context, scope Scope, identity string) error

type Scope

type Scope struct {
	Origin     string
	Generation uint64
}

type Seeds

type Seeds struct {
	Configured []string
	Active     []string
	Fallback   []string
}

Seeds groups untrusted bootstrap origins into ordered fallback tiers. Local cached peers are always consulted before any bootstrap tier.

Jump to

Keyboard shortcuts

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