overwatch

package
v0.0.0-...-31b9ebf Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppManager

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

AppManager is the default implementation of overwatch service management

func (*AppManager) Add

func (m *AppManager) Add(service Service)

Add takes in a new service to manage. It stops the service if it already exist in the manager and is running It then starts the newly added service

func (*AppManager) Remove

func (m *AppManager) Remove(name string)

Remove shutdowns the service by name and removes it from its current management list

func (*AppManager) Services

func (m *AppManager) Services() []Service

Services returns all the current Services being managed

type Manager

type Manager interface {
	Add(Service)
	Remove(string)
	Services() []Service
}

Manager is based type to manage running services

func NewAppManager

func NewAppManager(callback ServiceCallback) Manager

NewAppManager creates a new overwatch manager

type Service

type Service interface {
	Name() string
	Type() string
	Hash() string
	Shutdown()
	Run() error
}

Service is the required functions for an object to be managed by the overwatch Manager

type ServiceCallback

type ServiceCallback func(string, string, error)

ServiceCallback is a service notify it's runloop finished. the first parameter is the service type the second parameter is the service name the third parameter is an optional error if the service failed

Jump to

Keyboard shortcuts

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