bootstrap

package
v0.0.0-...-5623d4f Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(serviceName string) error

Boot performs standard service startup tasks

func Run

func Run(processes ...Process)

Run takes a number of processes and concurrently runs them all. It will stop if all processes terminate or if a signal (SIGINT or SIGTERM) is received.

Types

type Process

type Process interface {
	// GetName returns a friendly name for the process for use in logs
	GetName() string

	// Start kicks off the task and only returns when the task has finished
	Start() error

	// Stop will try to gracefully end the task and should be safe to run regardless of whether the process is currently running
	Stop(context.Context) error
}

Process is a long-running task that provides service functionality

Jump to

Keyboard shortcuts

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