grace

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 4 Imported by: 10

README

Grace

Build Status GoDoc codecov

Package grace implements set of helper functions around syscal.Signals for gracefully shutdown and reload (micro|macro|nano) services.

go get -u github.com/chapsuk/grace

No breaking changes, follows SemVer strictly.

Testing

go test -v -cover ./...

Documentation

Overview

Package grace implements set of helper functions around syscal.Signals for gracefully shutdown and reload the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReloadChannel added in v0.5.0

func ReloadChannel(ctx context.Context) <-chan struct{}

ReloadContext returns child context which will be canceled on syscall.SIGHUP signal

func ShutdownContext

func ShutdownContext(c context.Context) context.Context

ShutdownContext returns child context from passed context which will be canceled on incoming signals: SIGINT, SIGTERM, SIGHUP. Ends immediately by os.Exit(1) after second signal

func StopContext added in v0.5.0

func StopContext(c context.Context) context.Context

ReloadContext returns child context which will be canceled on syscall.SIGINT or syscall.SIGTERM signal

Types

This section is empty.

Jump to

Keyboard shortcuts

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