destinations

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package destinations holds the bookkeeping both packet counters keep to apply a per-destination limit given by name: which resolved addresses each debuglet's connections to that name reached.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolved

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

Resolved counts, for each debuglet and the destination address it asked for, the live attachments to each IP that address resolved to. The zero value is ready to use. It does no locking of its own: the packet counter that owns it holds its lock around every call.

func (*Resolved) Add

func (r *Resolved) Add(addr string, id uuid.UUID, ip netutil.IPv6)

Add records one more attachment of debuglet id, which asked for addr, to ip.

func (*Resolved) Remove

func (r *Resolved) Remove(addr string, id uuid.UUID, ip netutil.IPv6) (remaining int, ok bool)

Remove drops one attachment recorded by Add. It reports how many attachments of debuglet id through addr to ip remain, and false when there was none to drop, in which case nothing changes.

func (*Resolved) Targets

func (r *Resolved) Targets(addr string, id uuid.UUID) iter.Seq[netutil.IPv6]

Targets yields the IPs a limit that debuglet id sets on addr applies to: addr itself when it is an IP literal, otherwise every IP its attachments to addr currently reach. The caller must not call Add or Remove while iterating.

Jump to

Keyboard shortcuts

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