Documentation
¶
Overview ¶
Package serveaddr owns the home-root run directory that a live `gadak serve` writes so other processes can find it without guessing ports.
These files answer which loopback ports currently serve the UI. They are not leftover serve-origin.json (ignored since GDK-936) and they do not grant origin-write ownership.
Index ¶
Constants ¶
const Rel = "run"
Rel is the directory name under the gadak home root.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir is <gadak-home>/run, shared across workspaces. findServeTarget prefers a same-profile hit and falls back to any other live serve, so discovery must see every profile's serve — not only the caller's profile directory (config.Dir()). config.DirFor("") is the home root.
func Publish ¶
Publish writes the bound address into Dir and returns a cleanup that removes that file. Callers that must not take the server down on a write failure log err and continue.
Types ¶
type Record ¶
type Record struct {
Addr string `json:"addr"`
Profile string `json:"profile"`
PID int `json:"pid"`
StartedAt string `json:"startedAt"`
Port string `json:"-"`
}
Record is one live-serve file. Addr is the bound listen address (after port fallback), not the preferred --addr. Port is the file key (from the filename) and is not stored in the JSON.