Documentation
¶
Index ¶
- type Atomic
- type Channel
- type Option
- type Options
- type Proc
- func (p *Proc) CMDLine() []string
- func (p *Proc) CPUPercent() (float64, error)
- func (p *Proc) CloseSig(sig syscall.Signal) error
- func (p *Proc) CreatedAt() (time.Time, error)
- func (p *Proc) Cwd() (string, error)
- func (p *Proc) Exe() (string, error)
- func (p *Proc) ExitCode() int
- func (p *Proc) IOCounters() (*process.IOCountersStat, error)
- func (p *Proc) IsRunning() (bool, error)
- func (p *Proc) Kill() error
- func (p *Proc) MemoryInfo() (*process.MemoryInfoStat, error)
- func (p *Proc) Name() string
- func (p *Proc) NumConnections() (int, error)
- func (p *Proc) NumFDs() (int32, error)
- func (p *Proc) NumThreads() (int32, error)
- func (p *Proc) PID() int
- func (p *Proc) Signal(signal syscall.Signal) error
- func (p *Proc) Start() error
- func (p *Proc) StderrPipe(name string) *Stream
- func (p *Proc) StdinPipe(name string) *Stream
- func (p *Proc) StdoutPipe(name string) *Stream
- func (p *Proc) Terminate() error
- func (p *Proc) Wait() error
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel[T any] struct { // contains filtered or unexported fields }
Channel is channel that you can tell if it closed
func MakeChannel ¶
type Option ¶
type Option func(*Options)
Option apply option into *Options
func WithCommand ¶
func WithMaxWaitTime ¶
func WithStderr ¶
func WithStderr() Option
func WithStdout ¶
func WithStdout() Option
func WithWorkDir ¶
type Proc ¶
type Proc struct {
// contains filtered or unexported fields
}
Proc represent a child process of dontstarve
func (*Proc) CPUPercent ¶
CPUPercent returns how many percent of the CPU time this process uses
func (*Proc) ExitCode ¶
ExitCode returns the exit code of the exited process, or -1 if the process hasn't exited or was terminated by a signal.
func (*Proc) IOCounters ¶
func (p *Proc) IOCounters() (*process.IOCountersStat, error)
IOCounters returns IO Counters.
func (*Proc) Kill ¶
Kill causes the Process to exit immediately. Kill does not wait until the Process has actually exited
func (*Proc) MemoryInfo ¶
func (p *Proc) MemoryInfo() (*process.MemoryInfoStat, error)
MemoryInfo returns generic process memory information, such as RSS and VMS.
func (*Proc) NumConnections ¶
NumConnections the number of Connections used by the process. This returns all kind of the connection. This means TCP, UDP or UNIX.
func (*Proc) NumThreads ¶
NumThreads returns the number of threads used by the process.
func (*Proc) StderrPipe ¶
StderrPipe return a named stream pipe with stderr
func (*Proc) StdoutPipe ¶
StdoutPipe return a named stream pipe with stdout