Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("registry: entry not found")
ErrNotFound is returned by Read when no entry exists for the given cwd.
var HealthTimeout = 500 * time.Millisecond
Functions ¶
func IsAlive ¶
IsAlive returns true if BOTH (a) the recorded HubPID is alive on this host AND (b) GET <HubURL> succeeds at the TCP/HTTP level within HealthTimeout. Both checks are required because a recycled PID can pass (a) but fail (b).
The HTTP probe doesn't require any specific endpoint — any HTTP response (including 4xx) means the port is bound and serving, which is what we actually want to know. The Fossil HTTP server bones uses doesn't expose a /health endpoint and we deliberately don't add a sidecar HTTP server just for the probe.
func RegistryDir ¶
func RegistryDir() string
RegistryDir returns the directory that holds workspace entry files.
func WorkspaceID ¶
WorkspaceID returns a deterministic 16-hex-char identifier for an absolute cwd. Used as the registry filename: ~/.bones/workspaces/<id>.json
Types ¶
type Entry ¶
type Entry struct {
Cwd string `json:"cwd"`
Name string `json:"name"`
HubURL string `json:"hub_url"`
NATSURL string `json:"nats_url"`
HubPID int `json:"hub_pid"`
StartedAt time.Time `json:"started_at"`
}
Entry is one workspace's registry record. One JSON file per Entry at ~/.bones/workspaces/<WorkspaceID>.json.