daemon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlistFilePath               = "Library/LaunchAgents"
	PlistSudoFilePath           = "/Library/LaunchDaemons"
	PlistName                   = "oda.plist"
	UserServicedFilePath        = ".config/systemd/user"
	RootServicedFilePath        = "/etc/systemd/system"
	ServicedName                = "oda.service"
	LinuxDaemonTemplateLocation = "services/oda.service"
	MacOSDaemonTemplateLocation = "services/oda.plist"
	ServicePermission           = 0644
	DirPermission               = 0755
	BaseCollectCommand          = "collect"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ExePath             string
	HomeDir             string
	Os                  config.OSType
	IsRoot              bool
	SudoExecUser        *user.User
	AutoCredential      bool
	IsWorkspace         bool
	ShellTypeToLocation map[config.ShellType]string
	BaseCommandPath     string
}

Config is the configuration for the daemon service

type Daemon

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

Daemon is the service that configures background service

func NewDaemon

func NewDaemon(conf *Config, logger zerolog.Logger) *Daemon

NewDaemon creates a new daemon service

func (*Daemon) DestroyDaemonConfiguration

func (d *Daemon) DestroyDaemonConfiguration() error

DestroyDaemonConfiguration removes the daemon service configuration

func (*Daemon) InstallDaemonConfiguration

func (d *Daemon) InstallDaemonConfiguration() error

InstallDaemonConfiguration installs the daemon service configuration

func (*Daemon) ReloadDaemon

func (d *Daemon) ReloadDaemon() error

ReloadDaemon signals the daemon to reload its configuration.

func (*Daemon) StartDaemon

func (d *Daemon) StartDaemon() error

StartDaemon starts the daemon service

func (*Daemon) StopDaemon

func (d *Daemon) StopDaemon() error

StopDaemon stops the daemon service

Jump to

Keyboard shortcuts

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