runmanager

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInterruptHandler

func RunInterruptHandler(m *RunManager)

RunInterruptHandler runs an interrupt handler ontop of the RunManager.

func RunServices

func RunServices(ctx context.Context, services []Service)

RunServices starts up all given services.

Types

type RunManager

type RunManager struct {
	Context              context.Context
	WaitingGroupShutdown *sync.WaitGroup
	ErrChan              chan<- error
	Cancel               func()
}

RunManager can Run services while managing startup and Shutdown.

func (*RunManager) Run

func (m *RunManager) Run(r *Runner)

Run runs the Runner.

func (*RunManager) RunInterruptHandler

func (m *RunManager) RunInterruptHandler()

RunInterruptHandler runs an interrupt handler ontop of the RunManager.

type Runner

type Runner struct {
	Run      func() error
	Shutdown func() error
}

Runner incorporates a Run and a Shutdown method to control a service.

type Service

type Service func(m *RunManager)

Service is a runnable service.

Directories

Path Synopsis
runnables
sshtunnel/sshtunnelcmd
Package runs ssh tunnels.
Package runs ssh tunnels.

Jump to

Keyboard shortcuts

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