Documentation
¶
Overview ¶
Package service manages the cc-pool user LaunchAgent. It must be a user agent (not a root LaunchDaemon) because credential refresh needs access to the user's login Keychain, which a root daemon cannot read.
Index ¶
Constants ¶
const FormulaName = "cc-pool"
FormulaName is the Homebrew formula / brew-services name.
const Label = "com.yasyf.cc-pool"
Label is the LaunchAgent label / reverse-DNS identifier.
Variables ¶
This section is empty.
Functions ¶
func BrewStart ¶
func BrewStart() error
BrewStart starts the daemon via brew services (installs the user agent).
func Install ¶
func Install() error
Install writes the plist and (re)bootstraps the agent so it runs now and at every login. Idempotent: an existing instance is booted out first.
func IsBrewManaged ¶
func IsBrewManaged() bool
IsBrewManaged reports whether this binary was installed via Homebrew, in which case the daemon should be managed with `brew services` rather than the self-rolled launchctl path. It inspects the executable path only (no shelling out), so it is cheap enough for any code path.
func Uninstall ¶
func Uninstall() error
Uninstall boots out the agent and removes its plist. Missing is not an error.
func WritePlist ¶
WritePlist renders and writes the LaunchAgent plist for the current binary.
Types ¶
This section is empty.