mainrun

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mainrun.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnError

func OnError(f func(error) int)

When function that passed to Run is returned error or panic, run f, the returned int will be used to os.Exit function.

func Run

func Run(f func(ctx context.Context) error)

Run f

ctx passed to f will be canceled when graceful shutdown is requested, if f returned error or panic, then log it and run os.Exit(1), otherwise run os.Exit(0).

This function never return.

Types

This section is empty.

Jump to

Keyboard shortcuts

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