servicemanager

package
v1.0.50 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	Init(ctx context.Context) error
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Service is an interface for services that can be started and stopped.

type ServiceManager

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

func NewServiceManager

func NewServiceManager() *ServiceManager

func (*ServiceManager) AddService

func (sm *ServiceManager) AddService(name string, service Service)

func (*ServiceManager) StartAllAndWait

func (sm *ServiceManager) StartAllAndWait(ctx context.Context) error

StartAllAndWait starts all services and waits for them to complete or error. If any service errors, all other services are stopped gracefully and the error is returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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