service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 13 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 service renders and manages systemd user and launchd service definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commander

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

type Definition

type Definition struct {
	Path        string            `json:"path"`
	Unit        string            `json:"unit"`
	Commands    [][]string        `json:"commands"`
	Environment map[string]string `json:"environment"`
	Warnings    []string          `json:"warnings,omitempty"`
}

func Apply

func Apply(ctx context.Context, o Options, action string, dry bool, cmd Commander) (Definition, error)

func Render

func Render(o Options) (Definition, error)

type Exec

type Exec struct{}

func (Exec) Run

func (Exec) Run(ctx context.Context, name string, args ...string) (string, error)

type Options

type Options struct {
	OS, Home, Binary, Path, ConfigDir, DataDir string
	MDKBRoot                                   string
	UID                                        int
	Clock                                      clock.Clock
}

func Current

func Current(binary, path, config, data string) (Options, error)

func (Options) Commands

func (o Options) Commands(action string) [][]string

type State

type State struct {
	Installed bool `json:"installed"`
	Active    bool `json:"active"`
}

func Status

func Status(ctx context.Context, o Options, cmd Commander) (State, error)

Jump to

Keyboard shortcuts

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