pid

package
v0.0.0-...-17f7e16 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const WebServerName = "Web Server"

Variables

This section is empty.

Functions

func ToConfiguredProjects

func ToConfiguredProjects(shortenHomeDir bool) (map[string]*projects.ConfiguredProject, error)

Types

type PidFile

type PidFile struct {
	Dir        string   `json:"dir"`
	Watched    []string `json:"watch"`
	Pid        int      `json:"pid"`
	Port       int      `json:"port"`
	Scheme     string   `json:"scheme"`
	Args       []string `json:"args"`
	CustomName string   `json:"name"`
	// contains filtered or unexported fields
}

func AllWorkers

func AllWorkers(dir string) []*PidFile

func Load

func Load(path string) (*PidFile, error)

func New

func New(dir string, args []string) *PidFile

func (*PidFile) Binary

func (p *PidFile) Binary() string

func (*PidFile) CleanupDirectories

func (p *PidFile) CleanupDirectories()

func (*PidFile) Command

func (p *PidFile) Command() string

func (*PidFile) IsRunning

func (p *PidFile) IsRunning() bool

IsRunning returns true if the process is currently running

func (*PidFile) LogFile

func (p *PidFile) LogFile() string

func (*PidFile) LogReader

func (p *PidFile) LogReader() (io.ReadCloser, error)

func (*PidFile) LogWriter

func (p *PidFile) LogWriter() (io.WriteCloser, error)

LogWriter returns a writer to write logs to the log file. It creates the log file if it does not exist, and truncates it if it does. It is safe to call this method multiple times, it will only create the log file once per process lifetime: it is useful to have a single truncation (and thus a clean log file) at the beginning of the process management but not to truncate the log file when the process is restarted. Please note this method might not return a writer even if the error is nil (the error is returned only for the first call).

func (*PidFile) Name

func (p *PidFile) Name() string

func (*PidFile) PidFile

func (p *PidFile) PidFile() string

func (*PidFile) Remove

func (p *PidFile) Remove() error

Remove a pidfile

func (*PidFile) ShortName

func (p *PidFile) ShortName() string

func (*PidFile) Signal

func (p *PidFile) Signal(sig os.Signal) error

Signal sends a signal to the current process for this PidFile

func (*PidFile) Stop

func (p *PidFile) Stop() error

Stop kills the current process

func (*PidFile) String

func (p *PidFile) String() string

func (*PidFile) TempDirectory

func (p *PidFile) TempDirectory() string

func (*PidFile) WaitForExit

func (p *PidFile) WaitForExit() error

func (*PidFile) WaitForLogs

func (p *PidFile) WaitForLogs() error

func (*PidFile) WaitForPid

func (p *PidFile) WaitForPid() <-chan error

func (*PidFile) WorkerLogDir

func (p *PidFile) WorkerLogDir() string

func (*PidFile) WorkerPidDir

func (p *PidFile) WorkerPidDir() string

func (*PidFile) Write

func (p *PidFile) Write(pid, port int, scheme string) error

Write writes a pidfile

Jump to

Keyboard shortcuts

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