command

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package command provides a relatively thin wrapper around exec.Cmd, adding support for communicating with the dependent process using a channel.Channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	exec.Cmd
	// contains filtered or unexported fields
}

Command is a wrapper around exec.Cmd which adds needed operations which are os specific. Notably, it knows how to attach a channel.Channel.

func (*Command) AddEnvVar

func (cmd *Command) AddEnvVar(kv string)

AddEnvVar passes the given environment variable to the process.

The environment variables are passed when the process is spawned, so this method should only be called before .Start is called.

The argument kv is a key value pair in the form "key=value".

func (*Command) Kill

func (cmd *Command) Kill() error

Kill sends SIGKILL to cmd.

func (*Command) SetupCommsChannel

func (cmd *Command) SetupCommsChannel() (*channel.Channel, error)

SetupCommsChannel prepares a daemonServiceCommand to communicate with a DaemonService locally over an interprocess pipe.

func (*Command) SoftKill

func (cmd *Command) SoftKill() error

SoftKill sends SIGINT to cmd.

func (*Command) Start

func (cmd *Command) Start() error

Start refines exec.Cmd.Start.

Jump to

Keyboard shortcuts

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