daemon

package
v0.0.0-...-1564716 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	// Context for the daemon
	Context context.Context
	// Cwd is the working directory of the process
	Cwd string
	// Command for running the process
	Cmd string
	// Status of the process
	Status Status

	StartDelay time.Duration
	// contains filtered or unexported fields
}

Daemon is a wrapper for a process

func NewDaemon

func NewDaemon(cwd, cmd string) *Daemon

Return a new daemon

func (*Daemon) GetProcess

func (d *Daemon) GetProcess() *os.Process

func (*Daemon) Start

func (d *Daemon) Start() error

func (*Daemon) Stop

func (d *Daemon) Stop() error

type Status

type Status int

Status enum type for running or stopped process

const (
	// Stopped means the process is stopped
	Stopped Status = iota
	// Starting means the process is starting
	Starting
	// Running means the process is running
	Running
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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