Documentation
¶
Overview ¶
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 KeibiSoft S.R.L. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. Package discovery implements LAN peer discovery over UDP multicast, stdlib only. Beacons carry a random per-session two-word name and the listen port; no fingerprints, no identity data.
SPDX-License-Identifier: MPL-2.0 Copyright (c) 2025 KeibiSoft S.R.L. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Beacon ¶
type Beacon struct {
Name string `json:"n"` // random two-word name (e.g., "Cosmic Waffle")
Port int `json:"p"` // TCP listening port for KeibiDrop
Ver int `json:"v,omitempty"` // protocol version (1)
ID string `json:"i,omitempty"` // random per-session id; self-filter uses this, not Name
}
Beacon is the UDP payload broadcast by each peer.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles both advertising and browsing for KeibiDrop peers.
func (*Service) ClearPeers ¶ added in v0.3.0
func (s *Service) ClearPeers()
ClearPeers removes all discovered peers without stopping the service.