daemon

package
v0.20.0 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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

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

Daemon is an interface to provide simple methods for long-running processes.

func New

func New(executable string, opts ...Option) (*Daemon, error)

New creates the Daemon.

func (*Daemon) Run

func (d *Daemon) Run() error

Run executes the daemon and waits for termination.

func (*Daemon) Stop

func (d *Daemon) Stop()

Stop terminates the daemon.

func (*Daemon) String

func (d *Daemon) String() string

String returns a description of the daemon. Do not depend on its content.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a Daemon.

func WithArguments

func WithArguments(args ...string) Option

WithArguments sets command line arguments for a daemon.

func WithEnvironments

func WithEnvironments(envs map[string]string) Option

WithEnvironments sets environment variables for a daemon.

func WithOutputChannel

func WithOutputChannel(outputChan chan<- string) Option

WithOutputChannel sets a channel to receive stdout and stderr.

Jump to

Keyboard shortcuts

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