controller

package
v0.0.0-...-7406747 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Config *config.Config

	Store storage.Storage

	// Bin is the OCIS single binary name.
	Bin string

	// BinPath is the OCIS single binary path withing the host machine.
	// The Controller needs to know the binary location in order to spawn new extensions.
	BinPath string

	// Terminated facilitates communication from Watcher <-> Controller. Writes to this
	// channel WILL always attempt to restart the crashed process.
	Terminated chan process.ProcEntry
	// contains filtered or unexported fields
}

Controller supervises processes.

func NewController

func NewController(o ...Option) Controller

NewController initializes a new controller.

func (*Controller) Kill

func (c *Controller) Kill(pe process.ProcEntry) error

Kill a managed process. Should a process managed by the runtime be allowed to be killed if the runtime is configured not to?

func (*Controller) List

func (c *Controller) List() string

List managed processes.

func (*Controller) Shutdown

func (c *Controller) Shutdown(ch chan struct{}) error

Shutdown a running runtime.

func (*Controller) Start

func (c *Controller) Start(pe process.ProcEntry) error

Start and watches a process.

type Option

type Option func(o *Options)

Option represents an option.

func WithConfig

func WithConfig(cfg *config.Config) Option

WithConfig sets Controller config.

func WithLog

func WithLog(l *zerolog.Logger) Option

WithLog sets Controller config.

type Options

type Options struct {
	Bin     string
	Restart bool
	Config  *config.Config
	Log     *zerolog.Logger
}

Options are the configurable options for a Controller.

func NewOptions

func NewOptions() Options

NewOptions returns a new Options struct.

Jump to

Keyboard shortcuts

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