peer

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package peer implements APRS-IS core-peer links: server-to-server connections that exchange raw APRS packet lines (no login envelope), identified by the remote address. Each configured peer uses either UDP (connectionless datagrams) or TCP (a persistent stream), and a group may mix both.

Loop-prevention rules:

  • Traffic from core peers is delivered to local clients.
  • Traffic from local clients is relayed to core peers.
  • Traffic does NOT pass between peers and upstream uplinks.
  • A packet received from a peer is never echoed back to that peer.

Index

Constants

View Source
const WriterPrefix = uplink.WriterPeerPrefix

WriterPrefix tags stream packets that originated from a peer, as "peer:<id>". Consumers use it to avoid echoing packets back to their source and to keep peer/uplink traffic separate. It aliases the canonical tag defined in the uplink package.

Variables

This section is empty.

Functions

func Init

func Init()

Init creates and starts a peer manager per configured group. It is a no-op when no peers are configured. The legacy single-group config ('peer') and the 'peergroups' list are both honoured.

func Reload

func Reload()

Reload restarts the peer managers from the (already reloaded) configuration, so changed peer groups take effect on SIGHUP.

func Stop

func Stop()

Stop shuts every peer-group manager down.

Types

type Info

type Info struct {
	Name string
	ID   string
	Addr string
}

Info describes a configured remote peer for status reporting.

func List

func List() []Info

List returns the configured peers across all groups. Safe to call when no peer manager is running (returns nil).

type Manager

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

Manager owns a peer group's transports (a shared UDP socket for UDP peers and a TCP listener for TCP peers) and the set of configured peers.

Jump to

Keyboard shortcuts

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