daemon

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPipeline

func NewPipeline() (*pipeline.Pipeline, error)

func Pid

func Pid() (int, error)

Pid returns the pid of the daemon. If the pid file cannot be read, it returns 0 with an *errors.CannotReadPidError. If the daemon is not running the returned pid is -1.

func ReloadDaemon

func ReloadDaemon() error

ReloadDaemon sends a SIGHUP to the daemon to force it to reload its configuration. If an error occurs the error will be of type *errors.CannotReloadDaemonError.

func Start

func Start(runOnStart bool) error

Start starts the daemon. If the daemon is already running it returns an *errors.CannotLockFileError because the already running daemon has the lock on the file.

func Stop

func Stop() error

Stop stops the daemon. If there is no daemon running it return an *errors.DaemonNotRunningError.

Types

type RpcDaemonManager

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

func (*RpcDaemonManager) ReloadDaemon

func (mgr *RpcDaemonManager) ReloadDaemon(retries *int, reply *int) error

type State

type State string

State represents the possible states of the daemon

const (
	UpStatus   State = "up"
	DownStatus State = "down"
)

func Status

func Status() (State, error)

Status returns the status of the daemon. If the status file cannot be read, it returns DOWN with an *errors.CannotReadStatusError.

Jump to

Keyboard shortcuts

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