userservice

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 9 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 userservice runs gitd for the person signed in, under their system's own manager of user services: systemd's user instance on Linux, launchd on macOS. gitd then starts with their session and is restarted when it fails, with nothing to keep a terminal open for.

Index

Constants

View Source
const (
	Name  = "gitd"
	Label = "dev.gitd.gitd"
)

Name is the service's name: gitd.service for systemd; launchd's label is Label.

Variables

View Source
var ErrUnavailable = errors.New("no manager of user services here")

ErrUnavailable is a system with no manager of user services to reach: a container, a session without systemd's user instance, an SSH session on macOS with no GUI login.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Start installs the service to start with the user's session and starts it now,
	// restarting it when what it runs changed.
	Start(Service) error
	// Stop stops the service and removes it, so that it no longer starts.
	Stop() error
	// Installed says whether Start installed the service.
	Installed() bool
	// Log says where the service's output is read.
	Log() string
}

Manager starts gitd as a user service, and stops it.

func ForSystem

func ForSystem() (Manager, error)

ForSystem is systemd's user instance, when the session has one to reach.

type Service

type Service struct {
	Executable string
	Config     string
	GitHubCLI  string
}

Service is gitd run for one user: the Executable, the Config it reads, and the GitHub CLI whose token it is given as $GH_TOKEN each time it starts, when GitHubCLI names one.

Jump to

Keyboard shortcuts

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