process

package
v1.15.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusStart = iota
	StatusExit
	StatusRunning
	StatusError
)
View Source
const (
	EnvDaemonName = "EO_DAEMON_IDX"
	EnvDaemonPath = "EO_DAEMON_PATH"
)

Variables

View Source
var (
	ErrorProcessHandlerConflict = errors.New("process handler name conflict")
)

Functions

func Cmd

func Cmd(name string, args []string) (*exec.Cmd, error)

func Register

func Register(name string, processHandler func()) error

Register 注册程序到进程处理器中

func Run

func Run() bool

run process

func RunDebug

func RunDebug(name string) bool

Types

type IConfigBuild

type IConfigBuild interface {
	Config() StartArgs
}

type IProcessUpdate

type IProcessUpdate interface {
	Update(cmd *exec.Cmd)
}

type IProcessUpdates

type IProcessUpdates []IProcessUpdate

func (IProcessUpdates) Update

func (I IProcessUpdates) Update(cmd *exec.Cmd)

type ProcessCmd

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

func NewProcessCmd

func NewProcessCmd(name string, cmd *exec.Cmd, reader io.Reader) *ProcessCmd

func (*ProcessCmd) Close

func (p *ProcessCmd) Close() error

func (*ProcessCmd) Cmd

func (p *ProcessCmd) Cmd() *exec.Cmd

func (*ProcessCmd) Pid

func (p *ProcessCmd) Pid() int

func (*ProcessCmd) Read

func (p *ProcessCmd) Read()

func (*ProcessCmd) Status

func (p *ProcessCmd) Status() int

func (*ProcessCmd) Wait

func (p *ProcessCmd) Wait() error

type ProcessController

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

func NewProcessController

func NewProcessController(ctx context.Context, name string, logWriter io.Writer, callback ...IProcessUpdate) *ProcessController

func (*ProcessController) Shutdown

func (pc *ProcessController) Shutdown()

func (*ProcessController) Start

func (pc *ProcessController) Start(configData []byte, extraFiles []*os.File) error

func (*ProcessController) Stop

func (pc *ProcessController) Stop()

func (*ProcessController) TryRestart

func (pc *ProcessController) TryRestart(configData []byte, extraFiles []*os.File)

type StartArgs

type StartArgs struct {
	Data       []byte
	ExtraFiles []*os.File
}

Jump to

Keyboard shortcuts

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