daemon

package module
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 18 Imported by: 0

README

Systemd Daemon

Build Status Go Report Card GoDoc

A daemon package for use with Go (golang) systemd services

License

MIT Public License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InstanceTag = ""
)

Functions

func AddCommand

func AddCommand(cmds ...*cobra.Command)

func CreateUnit added in v2.0.5

func CreateUnit(binName, desc, path string, args ...string) ([]byte, error)

func Execute

func Execute(action ActionFunc)

func RegisterConfig added in v2.1.7

func RegisterConfig(v any)

func RootCmd

func RootCmd() *cobra.Command

func SetUnitConfig added in v2.0.5

func SetUnitConfig(section, name, value string)

Types

type ActionFunc

type ActionFunc func(cmd *cobra.Command, args []string) error

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

func New

func New(name, desc, version string) (*Daemon, error)

New - Create a new daemon

func (*Daemon) Description

func (d *Daemon) Description() string

func (*Daemon) Install

func (d *Daemon) Install(args ...string) error

func (*Daemon) Kill

func (d *Daemon) Kill(all bool, tags ...string) error

Kill the service

func (*Daemon) Name

func (d *Daemon) Name() string

func (*Daemon) Reload added in v2.0.5

func (d *Daemon) Reload(all bool, tags ...string) error

Reload the service

func (*Daemon) Remove

func (d *Daemon) Remove() error

Remove the service

func (*Daemon) Restart

func (d *Daemon) Restart(all bool, tags ...string) error

Restart the service

func (*Daemon) Start

func (d *Daemon) Start(num int, tags ...string) error

Start the service

func (*Daemon) Status

func (d *Daemon) Status(show bool) ([]systemd.UnitStatus, error)

Status - Get service status

func (*Daemon) Stop

func (d *Daemon) Stop(all bool, tags ...string) error

Stop the service

func (*Daemon) Version

func (d *Daemon) Version() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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