service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 11 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 registers the daemon as a user service (launchd, systemd --user, Windows scheduled task).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environ

func Environ(environ []string) ([]string, error)

Environ picks the allowed variables that change where the daemon looks for files; a bad value is an error.

func Install

func Install(s Spec, run func(name string, args ...string) error) error

Install writes the service definition and starts it via run.

func Render

func Render(s Spec) (path string, content []byte, err error)

Render returns the file path and content for the OS (path is "" on windows: the task XML is imported, not stored).

func Uninstall

func Uninstall(s Spec, run func(name string, args ...string) error) error

Uninstall stops and removes the service. Stop errors are ignored (it may not be running).

Types

type Spec

type Spec struct {
	GOOS, Exe, Home, DataDir, User string
	Env                            []string
}

Spec describes where and how to install. Paths use the separator of GOOS. User is the Windows account (DOMAIN\user); Env holds KEY=VALUE pairs for the service, see Environ.

Jump to

Keyboard shortcuts

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