Documentation ¶
Index ¶
- Variables
- type Process
- func (p *Process) GetPid() (int64, error)
- func (p *Process) Reload() error
- func (p *Process) Restart(ctx context.Context) error
- func (p *Process) Save(path string) error
- func (p *Process) SetApparmor(profile string)
- func (p *Process) SetCreds(uid uint32, gid uint32)
- func (p *Process) SetUserns(userns *idmap.IdmapSet)
- func (p *Process) Signal(signal int64) error
- func (p *Process) Start(ctx context.Context) error
- func (p *Process) StartWithFiles(ctx context.Context, fds []*os.File) error
- func (p *Process) Stop() error
- func (p *Process) Wait(ctx context.Context) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNotRunning = fmt.Errorf("The process isn't running")
ErrNotRunning is returned when performing an action against a stopped process.
Functions ¶
This section is empty.
Types ¶
type Process ¶
type Process struct { Name string `yaml:"name"` Args []string `yaml:"args,flow"` Apparmor string `yaml:"apparmor"` PID int64 `yaml:"pid"` Stdin io.ReadCloser `yaml:"-"` Stdout io.WriteCloser `yaml:"-"` Stderr io.WriteCloser `yaml:"-"` UID uint32 `yaml:"uid"` GID uint32 `yaml:"gid"` SetGroups bool `yaml:"set_groups"` SysProcAttr *syscall.SysProcAttr // contains filtered or unexported fields }
Process struct. Has ability to set runtime arguments.
func ImportProcess ¶
ImportProcess imports a saved process into a subprocess object.
func NewProcess ¶
NewProcess is a constructor for a process object. Represents a process with argument config. stdoutPath and stderrPath arguments are optional. Returns an address to process.
func NewProcessWithFds ¶
func NewProcessWithFds(name string, args []string, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) *Process
NewProcessWithFds is a constructor for a process object. Represents a process with argument config. Returns an address to process.
func (*Process) Save ¶
Save will save the given process object to a YAML file. Can be imported at a later point.
func (*Process) SetApparmor ¶
SetApparmor allows setting the AppArmor profile.
func (*Process) Signal ¶
Signal will send a signal to the given process object given a signal value.
func (*Process) StartWithFiles ¶
StartWithFiles will start the given process object with extra file descriptors.