Documentation
¶
Overview ¶
Package networkruntime assembles directory trust, recent connection facts and frontend health without giving library callers implicit infrastructure.
Index ¶
- Constants
- Variables
- func AdmissionRecord(value relayset.Admission) diagnostics.Record
- type Runtime
- func (r *Runtime) Accounts() *account.Service
- func (r *Runtime) Close()
- func (r *Runtime) ICEPool() icepolicy.ICEEndpointPool
- func (r *Runtime) Observer(selection Selection, sink diagnostics.Sink) func(string, senderrelay.Attempt)
- func (r *Runtime) Plan(ctx context.Context, intent relayprofile.Intent, frontend string) (Selection, error)
- func (r *Runtime) Resolve(capability link.Link) ([]string, func(context.Context) ([]string, error), error)
- func (r *Runtime) ServerRetryAt(identity string) time.Time
- func (r *Runtime) Unavailability() *networkdirectory.UnavailableError
- type Selection
Constants ¶
const ( NoRelayCandidates networkdirectory.BlockingReason = "no_relay_candidates" )
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) 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) 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 (*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 ¶
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()