service

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package service manages the current user's Overgent background service. On Linux that is a systemd user unit driven by "systemctl --user".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v0.1.1

type Account struct {
	Home string
	UID  int
}

Account identifies the logged-in member a service is installed for.

It is build tagged because the identity genuinely differs. macOS and Linux address the per-user manager by numeric uid - launchd's gui/<uid> domain and loginctl's user record both take one - so that is what the account carries here. Windows has no numeric uid at all, which is why account_windows.go exists rather than a runtime.GOOS branch at every call site.

func CurrentAccount added in v0.1.1

func CurrentAccount() (Account, error)

CurrentAccount resolves the account the calling process runs as.

type Manager

type Manager struct {
	Executable string
	ConfigRoot string
	Home       string
	UID        int
}

Manager installs and controls the one per-user production service.

func NewManager added in v0.1.1

func NewManager(executable, configRoot string, account Account) Manager

NewManager binds a Manager to an account. It is the only construction site callers outside this package need, so adding a platform whose identity is not a uid does not touch them.

func (Manager) Install

func (m Manager) Install(ctx context.Context) error

func (Manager) Remove

func (m Manager) Remove(ctx context.Context) error

func (Manager) Start

func (m Manager) Start(ctx context.Context) error

func (Manager) Status

func (m Manager) Status(ctx context.Context) (Status, error)

func (Manager) Stop

func (m Manager) Stop(ctx context.Context) error

type Status

type Status struct {
	Installed bool   `json:"installed"`
	Running   bool   `json:"running"`
	Label     string `json:"label"`
}

Jump to

Keyboard shortcuts

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