Documentation
¶
Overview ¶
Package app holds the product identity in one place. Everything user-visible (binary name, env var prefix, service labels, directories) derives from it.
Index ¶
Constants ¶
const ( // Name is the user-visible product name. Name = "Portside" // ID is the lowercase identifier used for the binary, directories and hostnames. ID = "portside" // ServiceLabel identifies the background service in launchd. ServiceLabel = "app.foreverbeta.portside" // MenuBarAppID is the macOS menu bar app's bundle identifier. MenuBarAppID = ServiceLabel + ".app" // DefaultPort is where the daemon serves the dashboard, API and *.localhost proxy. DefaultPort = 7878 // PeerHeader marks requests between daemons on the owner's devices. // Browsers cannot add it without a CORS preflight, which is never granted. PeerHeader = "X-" + Name + "-Peer" )
Variables ¶
var Version = "dev"
Version is the build's version; the command sets it from its -ldflags value.
Functions ¶
func Env ¶
Env returns the name of an environment variable in the product namespace, for example Env("CONFIG") == "PORTSIDE_CONFIG".
func FallbackPorts ¶
func FallbackPorts() []int
FallbackPorts are the ports, in order, that a daemon whose config sets no port tries when DefaultPort is taken: 7879-7899, then 17879-17899. Both ranges lie below the ephemeral ports of macOS (49152 and up) and Linux (32768 and up), so a port chosen once stays free of outgoing connections.
func Newer ¶ added in v0.5.0
Newer reports whether v is a release newer than this build, under the same rules as Older: a development or snapshot build is never newer.
func Older ¶ added in v0.5.0
Older reports whether v, such as a running daemon's version, is a release older than this build. Only plain releases (MAJOR.MINOR.PATCH with an optional leading v) compare; a development or snapshot build on either side never counts as older, so nothing replaces a daemon on a guess.
func Replacement ¶ added in v0.5.0
Replacement words what replacing a daemon of version from with this build does: upgraded or downgraded between releases, otherwise replaced (an equal version, or a development build on either side).
Types ¶
This section is empty.