process

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 19 Imported by: 1

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 added in v0.5.0

type IConfigBuild interface {
	Config() StartArgs
}

type IProcessUpdate added in v0.5.0

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

type IProcessUpdates added in v0.5.0

type IProcessUpdates []IProcessUpdate

func (IProcessUpdates) Update added in v0.5.0

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

type ProcessCmd added in v0.5.0

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

func NewProcessCmd added in v0.5.0

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

func (*ProcessCmd) Close added in v0.5.0

func (p *ProcessCmd) Close() error

func (*ProcessCmd) Cmd added in v0.5.0

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

func (*ProcessCmd) Pid added in v0.5.0

func (p *ProcessCmd) Pid() int

func (*ProcessCmd) Read added in v0.5.0

func (p *ProcessCmd) Read()

func (*ProcessCmd) Status added in v0.5.0

func (p *ProcessCmd) Status() int

func (*ProcessCmd) Wait added in v0.5.0

func (p *ProcessCmd) Wait() error

type ProcessController added in v0.5.0

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

func NewProcessController added in v0.5.0

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

func (*ProcessController) Shutdown added in v0.5.0

func (pc *ProcessController) Shutdown()

func (*ProcessController) Start added in v0.5.0

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

func (*ProcessController) Stop added in v0.5.0

func (pc *ProcessController) Stop()

func (*ProcessController) TryRestart added in v0.5.0

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

type StartArgs added in v0.5.0

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