service

package
v6.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages a collection of services.

func NewManager

func NewManager() *Manager

func (*Manager) Register

func (sm *Manager) Register(s ...Service)

Register adds a new service to the ServiceManager.

func (*Manager) Run

func (sm *Manager) Run(ctx context.Context)

Run runs all registered services concurrently using an errgroup.

func (*Manager) Wait

func (sm *Manager) Wait() error

type Service

type Service interface {
	Run(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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