daemon

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: Zlib Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

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

func Run

func Run(args []string, cb ProcessCallback, config Config, env ...string) int

Run 守护进程启动一个子进程, 并循环监视

func Shell

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

func StripArgs

func StripArgs(args []string, arg string) []string

Types

type Config

type Config struct {
	MaxCount    int   `json:"maxCount" yaml:"maxCount" xml:"maxCount"`
	MaxError    int   `json:"maxError" yaml:"maxError" xml:"maxError"`
	MinExitTime int64 `json:"minExitTime" yaml:"minExitTime" xml:"minExitTime"`
}

type ProcessCallback

type ProcessCallback func(cmd *exec.Cmd, start bool, time int64)

Jump to

Keyboard shortcuts

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