Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/efureev/go-shutdown
Golang app shutdown
https://github.com/efureev/go-shutdown
graceful-shutdown shutdown
Last synced: about 7 hours ago
JSON representation
Golang app shutdown
- Host: GitHub
- URL: https://github.com/efureev/go-shutdown
- Owner: efureev
- License: mit
- Created: 2020-02-05T09:22:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T13:27:54.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T06:23:56.767Z (5 months ago)
- Topics: graceful-shutdown, shutdown
- Language: Go
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
![Go package](https://github.com/efureev/go-shutdown/workflows/Go%20package/badge.svg?branch=master)
[![Build Status](https://travis-ci.com/efureev/go-shutdown.svg?branch=master)](https://travis-ci.com/efureev/go-shutdown)
[![Go Report Card](https://goreportcard.com/badge/github.com/efureev/go-shutdown)](https://goreportcard.com/report/github.com/efureev/go-shutdown)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b9b3b425d3b34069a4094ef99a982a85)](https://www.codacy.com/manual/efureev/go-shutdown?utm_source=github.com&utm_medium=referral&utm_content=efureev/go-shutdown&utm_campaign=Badge_Grade)
[![Maintainability](https://api.codeclimate.com/v1/badges/b5c1678bafd0687f3070/maintainability)](https://codeclimate.com/github/efureev/go-shutdown/maintainability)# Shutdown
It's a package for graceful shutdown your app or process
## Install
```bash
go get -u github.com/efureev/go-shutdown
```Golang app shutdown.
## Examples
```go
import "github.com/efureev/go-shutdown"func main() {
//..
shutdown.Wait()
}
``````go
import "github.com/efureev/go-shutdown"func main() {
//..
shutdown.WaitWithLogger(logger, syscall.SIGINT, syscall.SIGTERM)
}
```
```go
import "github.com/efureev/go-shutdown"func main() {
//..
shutdown.
OnDestroy(func() {
module.processing.EndJobListen()
}).
SetLogger(module.Log()).
Wait()
}
```