sysconf

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*SysConf)

Option configures the SysConf instance.

func WithFS

func WithFS(f fs.FS) Option

WithFS sets the filesystem that templates will be read out of.

func WithLogger

func WithLogger(l hclog.Logger) Option

WithLogger sets the parent logger for the sysconf.

type Runit

type Runit struct{}

Runit provides a handle to the service supervisor calls

func (*Runit) Disable

func (r *Runit) Disable(svc string) error

Disable removes a service from the boot set.

func (*Runit) Enable

func (r *Runit) Enable(svc string) error

Enable configures a service to start at boot and starts it.

func (*Runit) Restart

func (r *Runit) Restart(svc string) error

Restart requests runit to signal the service to stop, then starts it again.

func (*Runit) Start

func (r *Runit) Start(svc string) error

Start requests runit to immediately start a service.

func (*Runit) Stop

func (r *Runit) Stop(svc string) error

Stop requests runit to immediately stop a service.

type SysConf

type SysConf struct {
	*Runit
	// contains filtered or unexported fields
}

SysConf contains convenient functions for configuring a Void System

func New

func New(opts ...Option) *SysConf

New configures a SysConf instance and returns it.

func (*SysConf) InstallPkgs

func (sc *SysConf) InstallPkgs(pkgs ...string) error

InstallPkgs interfaces with the system package manager to install OS packages.

func (*SysConf) SetHostname

func (sc *SysConf) SetHostname(name string) error

SetHostname sets up the hostname both in the hostname file, and by changing the immediate machine hostname.

func (*SysConf) Template

func (sc *SysConf) Template(path, source string, mode fs.FileMode, data interface{}) error

Template installs a template from the configure fs.FS to a path on disk, creating directories as needed.

Jump to

Keyboard shortcuts

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