Help us shape the future of Go! Take the 2026 Go Developer Survey

desktopendpoint

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package desktopendpoint records where a running Hive Desktop serves its loopback HTTP server, so the hive CLI can find it without configuration.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRunning = errors.New("hive desktop is not running")

ErrNotRunning means no endpoint file exists: Hive Desktop is not running, or it has not started its HTTP server yet.

Functions

func Path

func Path(dataDir string) string

Path returns the endpoint file path under the hive data directory.

func Remove

func Remove(dataDir string) error

Remove deletes the endpoint file. A missing file is not an error.

func Write

func Write(dataDir string, e Endpoint) error

Write stores e atomically, so a concurrent Read sees the old file or the new one and never a partial write.

Types

type Endpoint

type Endpoint struct {
	// URL is the base URL of the loopback server, without a trailing path.
	URL       string    `json:"url"`
	PID       int       `json:"pid"`
	StartedAt time.Time `json:"startedAt"`
}

Endpoint is the content of the endpoint file.

func Read

func Read(dataDir string) (Endpoint, error)

Read loads the endpoint file. It returns an error wrapping ErrNotRunning when the file is missing. It does not check that the PID is alive: a file left by a crash surfaces as a connection error to the caller.

Jump to

Keyboard shortcuts

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