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 ¶
- type Announcer
- type Config
- type ExternalReachabilityEvidence
- func (e *ExternalReachabilityEvidence) Observe(observer yagomodel.Hash, classification yagomodel.PeerType)
- func (e *ExternalReachabilityEvidence) PeerType(ctx context.Context) (yagomodel.PeerType, bool)
- func (e *ExternalReachabilityEvidence) PublishedPeerType(context.Context) yagomodel.PeerType
- func (e *ExternalReachabilityEvidence) Reachable(ctx context.Context) bool
- func (e *ExternalReachabilityEvidence) Snapshot(context.Context) ExternalReachabilitySnapshot
- type ExternalReachabilitySnapshot
- type Observer
- type PeerNews
- type SelfSeed
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)
}
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) PublishedPeerType ¶
func (e *ExternalReachabilityEvidence) PublishedPeerType(context.Context) yagomodel.PeerType
func (*ExternalReachabilityEvidence) Reachable ¶
func (e *ExternalReachabilityEvidence) Reachable(ctx context.Context) bool
func (*ExternalReachabilityEvidence) Snapshot ¶
func (e *ExternalReachabilityEvidence) Snapshot(context.Context) ExternalReachabilitySnapshot
Source Files
¶
Click to show internal directories.
Click to hide internal directories.