supervisor

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RestartNever indicates to never restart the process
	RestartNever = RestartPolicy("never")
	// RestartOnFailure indicates to only restart the process after failures
	RestartOnFailure = RestartPolicy("on_failure")
	// RestartAlways indicates to always restart the process
	RestartAlways = RestartPolicy("always")
)

Variables

This section is empty.

Functions

func ParseOption

func ParseOption(c *caddy.Controller, options *Options)

ParseOption parses supervisor options

Types

type Options

type Options struct {
	Replicas               int
	Command                string
	Args                   []string
	Dir                    string
	Env                    []string
	RedirectStdout         string
	RedirectStderr         string
	RestartPolicy          RestartPolicy
	TerminationGracePeriod time.Duration
}

Options exposes settings to create a process supervisor

func CreateOptions

func CreateOptions() *Options

CreateOptions createnew SupervisorOptions with default settings

type RestartPolicy

type RestartPolicy string

RestartPolicy determines when a supervised process should be restarted

type Supervisor

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

Supervisor provides functionality to start and supervise a background process

func CreateSupervisors added in v0.1.1

func CreateSupervisors(options *Options) []*Supervisor

CreateSupervisors creates a new process supervisor

func (*Supervisor) Start

func (s *Supervisor) Start()

Start a process and supervise

func (*Supervisor) Stop

func (s *Supervisor) Stop()

Stop the supervised process

type TemplateData added in v0.1.1

type TemplateData struct {
	Replica int
}

TemplateData contains data to be accessed from templates

Jump to

Keyboard shortcuts

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