service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 10 Imported by: 0

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

View Source
const FormulaName = "cc-pool"

FormulaName is the Homebrew formula / brew-services name.

View Source
const Label = "com.yasyf.cc-pool"

Label is the LaunchAgent label / reverse-DNS identifier.

Variables

This section is empty.

Functions

func BrewInfo

func BrewInfo() (string, error)

BrewInfo returns `brew services info cc-pool` output for status display.

func BrewStart

func BrewStart() error

BrewStart starts the daemon via brew services (installs the user agent).

func BrewStop

func BrewStop() error

BrewStop stops and unloads the brew-managed 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 Loaded

func Loaded() bool

Loaded reports whether launchd currently knows about the agent.

func PlistPath

func PlistPath() (string, error)

PlistPath is the LaunchAgent plist location.

func Uninstall

func Uninstall() error

Uninstall boots out the agent and removes its plist. Missing is not an error.

func WritePlist

func WritePlist() (string, error)

WritePlist renders and writes the LaunchAgent plist for the current binary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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