daemon

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPipeline

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

NewPipeline creates a new validation pipeline

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 Setup

func Setup() error

Setup creates the necessary files for the daemon. Is called also on daemon start

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 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