appd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AppdStopped = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Appd

type Appd struct {
	// contains filtered or unexported fields
}

Appd represents the appd binary

func New

func New(name string, bin []byte, cfg ...CfgOption) (*Appd, error)

New takes a binary and untar it in a temporary directory.

func (*Appd) CreateExecCommand

func (a *Appd) CreateExecCommand(args ...string) *exec.Cmd

CreateExecCommand creates an exec.Cmd for the appd binary.

func (*Appd) Pid

func (a *Appd) Pid() int

Pid returns the pid of the appd process.

func (*Appd) Start

func (a *Appd) Start(args ...string) error

Start starts the appd binary with the given arguments.

func (*Appd) Stop

func (a *Appd) Stop() error

Stop terminates the running appd process if it exists.

type CfgOption

type CfgOption func(*Appd) *Appd

func WithStdErr

func WithStdErr(stderr io.Writer) CfgOption

WithStdErr configures the standard error of the app.

func WithStdIn

func WithStdIn(stdin io.Reader) CfgOption

WithStdIn configures the standard input of the app.

func WithStdOut

func WithStdOut(stdout io.Writer) CfgOption

WithStdOut configures the standard output of the app.

Jump to

Keyboard shortcuts

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