supervisor

package
v0.0.0-...-c0b5b33 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Review all configuration and start services as necessary
	Reload() error

	// Start a service
	Start(string) error

	// Stop a service
	Stop(string) error
}

Interface abstracts out the supervisor. This will eventually encapsulate all of systemd, launchd etc configuration and management.

func New

func New() (Interface, error)

New creates a new systemd supervisor

type Mock

type Mock struct {
	Reloads uint
	Starts  map[string]uint
	Stops   map[string]uint
	// contains filtered or unexported fields
}

Mock mocks the supervisor

func NewMock

func NewMock() *Mock

NewMock instantiates the mock properly.

func (*Mock) ErrorNext

func (m *Mock) ErrorNext(e error)

ErrorNext sets the error for the next call to return. The error is cleared after returning the error the first time.

func (*Mock) Reload

func (m *Mock) Reload() error

Reload reviews all configuration and starts services as necessary

func (*Mock) Reset

func (m *Mock) Reset()

Reset resets all counters and trackers

func (*Mock) Start

func (m *Mock) Start(svc string) error

Start a service

func (*Mock) Stop

func (m *Mock) Stop(svc string) error

Stop a service

Jump to

Keyboard shortcuts

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