servicemanager

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePlist

func GeneratePlist(cfg LaunchdConfig) string

GeneratePlist generates a launchd property list (plist) file

func GenerateSystemUnit

func GenerateSystemUnit(cfg SystemdConfig) string

GenerateSystemUnit generates a systemd system-level unit file

func GenerateUserUnit

func GenerateUserUnit(cfg SystemdConfig) string

GenerateUserUnit generates a systemd user-level unit file

func GetBinaryPath

func GetBinaryPath() (string, error)

GetBinaryPath attempts to locate the memorizer binary Tries in order: os.Executable(), ~/.local/bin, PATH

func GetLaunchdSystemInstructions

func GetLaunchdSystemInstructions(plistContent, plistPath string) string

GetLaunchdSystemInstructions returns formatted instructions for system-level launchd setup

func GetLaunchdUserInstructions

func GetLaunchdUserInstructions(plistPath, user string) string

GetLaunchdUserInstructions returns formatted instructions for user-level launchd setup

func GetSystemDaemonPath

func GetSystemDaemonPath(user string) string

GetSystemDaemonPath returns the path for a system-level launchd daemon plist

func GetSystemUnitPath

func GetSystemUnitPath() string

GetSystemUnitPath returns the path for a system-level systemd unit file

func GetSystemdSystemInstructions

func GetSystemdSystemInstructions(unitContent string) string

GetSystemdSystemInstructions returns formatted instructions for system-level systemd setup

func GetSystemdUserInstructions

func GetSystemdUserInstructions(unitPath string) string

GetSystemdUserInstructions returns formatted instructions for user-level systemd setup

func GetUserAgentPath

func GetUserAgentPath(home, user string) (string, error)

GetUserAgentPath returns the path for a user-level launchd agent plist

func GetUserUnitPath

func GetUserUnitPath(home string) (string, error)

GetUserUnitPath returns the path for a user-level systemd unit file

func InstallUserAgent

func InstallUserAgent(plistContent, plistPath string) error

InstallUserAgent writes a user-level launchd agent plist file

func InstallUserUnit

func InstallUserUnit(unitContent string, home string) error

InstallUserUnit writes a user-level systemd unit file

func IsPlatformSupported

func IsPlatformSupported() bool

IsPlatformSupported returns true if the current platform supports service manager integration

Types

type LaunchdConfig

type LaunchdConfig struct {
	BinaryPath string
	User       string
	Home       string
	LogFile    string
}

LaunchdConfig holds configuration for generating launchd plist files

type Platform

type Platform int

Platform represents a supported operating system platform

const (
	PlatformUnknown Platform = iota
	PlatformLinux
	PlatformDarwin
)

func DetectPlatform

func DetectPlatform() Platform

DetectPlatform returns the current operating system platform

func (Platform) String

func (p Platform) String() string

String returns the string representation of the platform

type SystemdConfig

type SystemdConfig struct {
	BinaryPath string
	User       string
	Home       string
	LogFile    string
}

SystemdConfig holds configuration for generating systemd unit files

Jump to

Keyboard shortcuts

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