publicrelay

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package publicrelay defines and measures croc's ordered public relay pool.

Index

Constants

View Source
const ProbeTimeout = time.Second

Variables

This section is empty.

Functions

func Relays

func Relays() []string

Relays returns a copy of the protocol-ordered public relay pool.

func SelectFirst

func SelectFirst(ctx context.Context, addresses []string, timeout time.Duration, probe Probe) (int, time.Duration, error)

SelectFirst races one probe to every relay and returns as soon as the first relay completes a successful croc ping/pong exchange. Outstanding probes are canceled before returning.

Types

type Probe

type Probe func(ctx context.Context, address string, timeout time.Duration) (time.Duration, error)

Probe measures one complete croc ping/pong exchange.

type UmamiReporter

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

UmamiReporter sends events to Umami without blocking its callers.

func NewUmamiReporter

func NewUmamiReporter(baseURL, websiteID, siteURL, version string) (*UmamiReporter, error)

NewUmamiReporter constructs and starts an Umami event reporter.

func (*UmamiReporter) Close

func (r *UmamiReporter) Close()

Close cancels in-flight reporting and drops any queued events.

func (*UmamiReporter) Track

func (r *UmamiReporter) Track(name string)

Track queues an event if reporting is active and capacity is available.

func (*UmamiReporter) TrackPath

func (r *UmamiReporter) TrackPath(name, eventPath string)

TrackPath queues an event for a root-relative path without a query or fragment.

Jump to

Keyboard shortcuts

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