winservice

package
v0.14.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: 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

Rendered for windows/amd64

Overview

Package winservice runs gitd as a Windows service, as systemd runs it on Linux: started with the machine, restarted when it fails, answering whoever is in the local group gitd.

The service runs as LocalSystem. What it makes is reached through the group, as a socket readable by a group is on Linux: members may connect to the socket, read the pools and templates their workspaces borrow from, and change only the workspaces themselves.

Index

Constants

View Source
const (
	Name  = "gitd"
	Group = "gitd"
)

Name is the service's name, and Group the local group whose members may use it.

Variables

This section is empty.

Functions

func GroupSID

func GroupSID() (*windows.SID, bool)

GroupSID is the group's security identifier, when the group exists.

func Install

func Install(executable, configPath, member, state string, roots []string) error

Install registers gitd at executable as a service started with the machine and restarted when it fails, serving with the configuration at configPath. It creates the group and adds member to it, gives the group its access to state and roots, and keeps the configuration, which holds credentials, to SYSTEM and Administrators.

func Run

func Run(serve func(context.Context) error) error

Run answers the service manager until serve returns, which it must when its context ends: the context ends when the service is stopped or the machine shuts down.

func Running

func Running() bool

Running says whether this process was started by the service manager.

func Start

func Start() error

Start starts the installed service and waits until it runs.

func State

func State() (string, error)

State says whether the service is installed and whether it runs.

func Stop

func Stop() error

Stop stops the service and waits until it has.

func Uninstall

func Uninstall() error

Uninstall stops the service if it runs and removes it. The group and what gitd made are left: removing the service is not removing the workspaces.

Types

This section is empty.

Jump to

Keyboard shortcuts

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