launchagent

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: GPL-3.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package launchagent writes the macOS login-service definition for bsbctl.

Index

Constants

View Source
const Label = "dev.bsbctl"

Variables

View Source
var ErrNotLoaded = errors.New("LaunchAgent is not loaded")
View Source
var ErrPartial = errors.New("service operation partially completed")

Functions

This section is empty.

Types

type Config

type Config struct {
	Executable string
	ConfigPath string
	SocketPath string
	LogPath    string
	StdoutPath string
	StderrPath string
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(runner Runner, uid int) *Manager

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, path string, config Config) (Result, error)

func (*Manager) Restart

func (m *Manager) Restart(ctx context.Context, path string) (Result, error)

Restart asks launchd to terminate and immediately re-exec the currently loaded, bsbctl-owned service without changing its plist or desired state.

func (*Manager) Status

func (m *Manager) Status(ctx context.Context, path string) (Result, error)

func (*Manager) Uninstall

func (m *Manager) Uninstall(ctx context.Context, path string) (Result, error)

type Result

type Result struct {
	Status       State `json:"status"`
	PlistMatches bool  `json:"plist_matches"`
	Changed      bool  `json:"changed,omitempty"`
}

type Runner

type Runner interface {
	Run(context.Context, ...string) error
}

type State

type State string
const (
	StateNotInstalled       State = "not_installed"
	StateInstalledNotLoaded State = "installed_not_loaded"
	StateLoaded             State = "loaded"
	StateDegraded           State = "degraded"
)

Jump to

Keyboard shortcuts

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