pubaddr

package
v0.2.2-dev.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 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 pubaddr holds the panel's public address, which can change while the panel runs: readers take the current value on every use, and subscribers are told when it changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Holder

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

Holder is the current public URL ("https://panel.example.com"; "" = none). The zero value is not usable; call New.

func New

func New(publicURL string) *Holder

New is a Holder that starts at publicURL.

func (*Holder) PublicURL

func (h *Holder) PublicURL() string

PublicURL is the current public URL.

func (*Holder) Set

func (h *Holder) Set(publicURL string)

Set changes the public URL. When it differs from the current one, every subscriber is called with it, synchronously, in the order they subscribed.

func (*Holder) Subscribe

func (h *Holder) Subscribe(fn func(publicURL string))

Subscribe calls fn on every later change of the public URL. fn must not call Set or Subscribe.

Jump to

Keyboard shortcuts

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