Documentation
¶
Overview ¶
Package publicrelay defines and measures croc's ordered public relay pool.
Index ¶
Constants ¶
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 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.