gateway

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package gateway runs Factor as a daemon: channels, cron, heartbeat, background jobs, and a local health endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Daemonize added in v0.18.0

func Daemonize(configPath string, passthrough []string) (int, error)

Daemonize starts `factor gateway` as a background process detached from this terminal and reports its pid once it is up. The pid comes from the pid file rather than the spawn: writePidFile records the writer's own pid, and it is the child, not this process, that serves. passthrough carries the flags that must survive the re-spawn. A detached gateway is a fresh process, so anything that configured this one — the proxy above all — has to be handed over on its command line, or the child runs without it and the log says nothing about the difference.

func LogPath added in v0.18.0

func LogPath() string

LogPath is where a backgrounded gateway writes what a foreground one would say on stderr.

func ReadPidFile

func ReadPidFile() (int, bool)

ReadPidFile reports the daemon pid and whether that process is alive.

func RequestStop added in v0.18.0

func RequestStop()

RequestStop asks the gateway running in this process to shut down cleanly.

func Run

func Run(configPath string) error

Run starts the daemon and blocks until SIGINT/SIGTERM — or until an upgrade asks it to reload, in which case it shuts down cleanly and then execs the binary now on disk. The exec happens out here, after serve has closed the sidecars and dropped the pid file, so the new process inherits nothing the old one was still holding.

func SignalRestart added in v0.7.0

func SignalRestart(pid int) error

SignalRestart asks the gateway running as pid to reload into the binary currently on disk.

func StatusLines added in v0.18.0

func StatusLines() []string

StatusLines reports the running daemon's health as tray-menu rows. Before serve has come up — the tray starts beside it, not after it — there is only the one line to say.

Types

This section is empty.

Jump to

Keyboard shortcuts

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