peerannouncement

package
v0.0.0-...-9b85f49 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package peerannouncement greets known peers on an interval: it announces this node to them and reports their reachability to the peer roster. It owns no peer data — it discovers candidates from the seed source on a cold start, reads targets from the roster, and writes reachability observations back.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Announcer

type Announcer interface {
	Run(ctx context.Context)
	// GreetDiscovered runs one verified hello exchange against a peer found
	// outside the roster (LAN discovery); a successful exchange lands the
	// peer and its known seeds in the roster like any greeted peer.
	GreetDiscovered(ctx context.Context, target yagomodel.Seed)
}

func New

func New(
	cfg Config,
	self SelfSeed,
	seeds bootstrap.SeedSource,
	roster peerRoster,
) Announcer

type Config

type Config struct {
	Client                       *http.Client
	NetworkName                  string
	Interval                     time.Duration
	GreetsPerCycle               int
	Observer                     Observer
	News                         PeerNews
	PreferHTTPS                  bool
	NetworkAccess                yagoproto.NetworkAccess
	ExternalReachabilityEvidence *ExternalReachabilityEvidence
	AdmitExternalObserverAddress func(netip.Addr) error
}

type ExternalReachabilityEvidence

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

func NewExternalReachabilityEvidence

func NewExternalReachabilityEvidence() *ExternalReachabilityEvidence

func (*ExternalReachabilityEvidence) Observe

func (e *ExternalReachabilityEvidence) Observe(
	observer yagomodel.Hash,
	classification yagomodel.PeerType,
)

func (*ExternalReachabilityEvidence) PeerType

func (*ExternalReachabilityEvidence) PublishedPeerType

func (*ExternalReachabilityEvidence) Reachable

func (*ExternalReachabilityEvidence) Snapshot

type ExternalReachabilitySnapshot

type ExternalReachabilitySnapshot struct {
	PeerType   yagomodel.PeerType
	ObservedAt time.Time
	Known      bool
}

type Observer

type Observer interface {
	ObservePeerProbeFailure()
}

type PeerNews

type PeerNews interface {
	RotateSeedNews(ctx context.Context)
	AcceptNewsAttachment(ctx context.Context, encoded string)
}

type SelfSeed

type SelfSeed interface {
	SelfSeed(ctx context.Context) yagomodel.Seed
}

Jump to

Keyboard shortcuts

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