supervisor

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(*process)

func WithEnv

func WithEnv(env map[string]string) Opt

func WithRestart added in v0.0.5

func WithRestart(limit int, delay time.Duration) Opt

WithRestart restarts the process if it exists. If limit is 0 it will restart forever.

func WithRootDir

func WithRootDir(dir string) Opt

func WithStopSignal

func WithStopSignal(sig os.Signal) Opt

type Supervisor

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

func New

func New(name string, timeout time.Duration) *Supervisor

func (*Supervisor) AddProcess

func (h *Supervisor) AddProcess(name string, command string, opts ...Opt)

func (*Supervisor) Run

func (h *Supervisor) Run() error

func (*Supervisor) StartHttpListener

func (h *Supervisor) StartHttpListener()

func (*Supervisor) Stop

func (h *Supervisor) Stop()

func (*Supervisor) StopOnSignal added in v0.0.5

func (h *Supervisor) StopOnSignal(sigs ...os.Signal)

Jump to

Keyboard shortcuts

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