networkruntime

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0 Imports: 26 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 networkruntime assembles directory trust, recent connection facts and frontend health without giving library callers implicit infrastructure.

Index

Constants

View Source
const (
	NoRelayCandidates networkdirectory.BlockingReason = "no_relay_candidates"
	AliasUnavailable  networkdirectory.BlockingReason = "alias_unavailable"
)

Variables

Functions

func AdmissionRecord

func AdmissionRecord(value relayset.Admission) diagnostics.Record

Types

type Runtime

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

func New

func New(config *networkconfig.Config, now func() time.Time, selectionSeed string, sink diagnostics.Sink) (*Runtime, error)

func (*Runtime) Accounts

func (r *Runtime) Accounts() *account.Service

func (*Runtime) Close

func (r *Runtime) Close()

func (*Runtime) ICEPool

func (r *Runtime) ICEPool() icepolicy.ICEEndpointPool

func (*Runtime) Observer

func (r *Runtime) Observer(selection Selection, sink diagnostics.Sink) func(string, senderrelay.Attempt)

func (*Runtime) Plan

func (r *Runtime) Plan(ctx context.Context, intent relayprofile.Intent, frontend string) (Selection, error)

func (*Runtime) Resolve

func (r *Runtime) Resolve(capability link.Link) ([]string, func(context.Context) ([]string, error), error)

Resolve returns immediately usable endpoints and optional bounded expansion. The relay race owns expansion so known paths never wait for an unknown alias.

func (*Runtime) ServerRetryAt added in v0.1.5

func (r *Runtime) ServerRetryAt(identity string) time.Time

func (*Runtime) Unavailability

func (r *Runtime) Unavailability() *networkdirectory.UnavailableError

Unavailability reads the current default-network decision without fetching. Applications can reject a retry during cooldown without claiming admission started; all timing and coalescing still belong to the directory.

type Selection

type Selection struct {
	Relays []relayprofile.Registration

	Plan              relayplan.Plan
	Frontend          string
	AlternateFrontend string

	Decision networkconfig.Decision
	// contains filtered or unexported fields
}

func (Selection) DiagnosticRecord

func (s Selection) DiagnosticRecord() diagnostics.Record

func (Selection) PublishRelayHints

func (selection Selection) PublishRelayHints(capability *link.Link, rejected []string)

PublishRelayHints retains pending registrations so a healthy relay can publish immediately. An initial registration that has already ended cannot serve this share.

func (Selection) ReleaseAuthorization added in v0.1.4

func (selection Selection) ReleaseAuthorization()

Jump to

Keyboard shortcuts

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