daemon

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package daemon manages yaad's background server lifecycle: PID file tracking, health checks, and auto-start logic.

Index

Constants

View Source
const (
	DefaultAddr = ":3456"
)

Variables

This section is empty.

Functions

func EnsureRunning

func EnsureRunning(projectDir, addr string) error

EnsureRunning checks health; if yaad is not running, launches it as a daemon. Returns the addr the server is (or will be) listening on.

func HealthCheck

func HealthCheck(addr string) error

HealthCheck pings the yaad health endpoint. Returns nil if healthy. addr can be ":port", "host:port", or a full "http://host:port" URL.

func IsRunning

func IsRunning(projectDir string) bool

IsRunning checks if the daemon process is alive (signal 0 check).

func PIDFile

func PIDFile(projectDir string) string

PIDFile returns the path to the PID file for the given project directory.

func ReadPID

func ReadPID(projectDir string) int

ReadPID reads the stored PID. Returns 0 if no PID file or invalid.

func RemovePID

func RemovePID(projectDir string)

RemovePID removes the PID file.

func Stop

func Stop(projectDir string) error

Stop sends SIGTERM to the daemon process.

func WritePID

func WritePID(projectDir string) error

WritePID writes the current process PID to the PID file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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