😴 A tiny library for handling system interrupts

Overview

Wait a bit

Tiny library for manage you application shutdown in graceful way by catching the OS signals.

Documentation

Installation

go get -u github.com/heartwilltell/waitabit

Usage

package main

import (
    "log"
    "os"

    "github.com/heartwilltell/waitabit"
)


func main() { 
	
    // call your application here ...
    
    wait := waitabit.NewWait(os.Interrupt)
    wait.WaitWithFunc(func() {
        log.Println("Bye")
    })
    
    // or ...
    
    waitabit.NewWait(os.Interrupt).WaitWithFunc(func() {
    	log.Println("Bye")
    })
    
}
Issues
  • Errgroup version?

    Errgroup version?

    Hello! I was really impressed by the developer ergonomics of your great library, but I wanted to get more familiar with errgroup, so I made an errgroup version of your library called grace which you might be interested in. I'd definitely appreciate any feedback, as you appear to have excellent taste!

    opened by StevenACoffman 1
Releases(v1.0.0)
Owner
Serhii Mariiekha
👨‍💻 Software Engineer, Gopher
Serhii Mariiekha
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Flamingo 305 Aug 4, 2022
This library provides a simple framework of microservice, which includes a configurator, a logger, metrics, and of course the handler

Microservice The framework for the creation of microservices, written in Golang. (note: http microservice) Architecture microservice includes: handle

Eduard 98 Aug 4, 2022
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).

WebGo v4.1.3 WebGo is a minimalistic framework for Go to build web applications (server side) with zero 3rd party dependencies. Unlike full-fledged fr

Kamaleshwar 253 Aug 8, 2022
gnark is a fast, open-source library for zero-knowledge proof protocols written in Go

gnark gnark is a framework to execute (and verify) algorithms in zero-knowledge. It offers a high-level API to easily design circuits and fast impleme

ConsenSys Software 533 Aug 1, 2022
gnark is a fast, open-source library for zero-knowledge proof protocols written in Go

gnark gnark is a framework to execute (and verify) algorithms in zero-knowledge. It offers a high-level API to easily design circuits and fast impleme

ConsenSys Software 1.3k Jun 1, 2021
Paramex is a library that binds http request parameters to a Go struct annotated with `param`.

paramex Paramex is a library that binds http request parameters to a Go struct annotated with param. Description To extract http parameters (headers,

Nipuna Pathirana 6 Aug 26, 2021
golang library for creating web application

RUI library The RUI (Remoute User Interface) library is designed to create web applications in the go language. The peculiarity of the library is that

Alexei Anoshenko 15 Dec 21, 2021
An example implementation of a REST interface in Golang using primarily the standard library.

REST API in Golang This is an example REST API implementation using primarily the standard library. The exceptions are as follows. github.com/gorilla/

Daniel 0 Jan 22, 2022
A library that implements over 500 food items in to dragonfly.

DragonFoods A library that implements over 500 food items in to dragonfly. Usage This library makes use of the Food's Plus addon creates by Dreampixel

Twisted 6 Jul 17, 2022
CBuild build system - A tiny build system for C

cuild - CBuild A build system for C Building $ go build . Usage Similar to GNU Make, a file named "Cuildfile" is required. You have a few flags to us

Laurentino Luna 0 Jan 17, 2022
A tiny Go library + client for downloading Youtube videos. The library is capable of fetching Youtube video metadata, in addition to downloading videos.

A tiny Go library + client (command line Youtube video downloader) for downloading Youtube videos. The library is capable of fetching Youtube video metadata, in addition to downloading videos. If ffmpeg is available, client can extract MP3 audio from downloaded video files.

Kunal Diwan 2 Jun 3, 2022
A comprehensive error handling library for Go

Highlights The errorx library provides error implementation and error-related utilities. Library features include (but are not limited to): Stack trac

Joom 879 Jul 31, 2022
Key event handling library for tcell - THIS IS A MIRROR - SEE LINK BELOW

cbind Key event handling library for tcell Features Set KeyEvent handlers Encode and decode KeyEvents as human-readable strings Usage // Create a new

Trevor Slocum 0 Jan 10, 2022
A tiny library for super simple Golang tables

Tabby A tiny library for super simple Golang tables Get Tabby go get github.com/cheynewallace/tabby Import Tabby import "github.com/cheynewallace/tabb

Cheyne Wallace 319 Jul 24, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

webview 10.3k Aug 6, 2022
tiny linear interpolation library for go (factored out from https://github.com/sgreben/yeetgif)

piecewiselinear A tiny library for linear interpolation. O(log(N)) per evaluation for N control points. import "github.com/sgreben/piecewiselinear" Ge

Sergey Grebenshchikov 22 Mar 5, 2022
gproxy is a tiny service/library for creating lets-encrypt/acme secured gRPC and http reverse proxies

gproxy is a reverse proxy service AND library for creating flexible, expression-based, lets-encrypt/acme secured gRPC/http reverse proxies GProxy as a

null 15 Mar 25, 2022
Tiny WebSocket library for Go.

RFC6455 WebSocket implementation in Go.

Sergey Kamardin 4.7k Aug 11, 2022
tiny Go library to normalize URLs

Purell Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know... Based on the wikipedia paper

null 429 Jul 29, 2022
💥 Fusion is a tiny stream processing library written in Go.

?? Fusion Fusion is a tiny stream processing library written in Go. See reactor for a stream processing tool built using fusion. Features Simple & lig

Shivaprasad Bhat 17 Jun 30, 2021
Tiny library to handle background jobs.

bgjob Tiny library to handle background jobs. Use PostgreSQL to organize job queues. Highly inspired by gue Features Durable job storage At-least-ones

null 1 Nov 16, 2021
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

webview 10.3k Aug 5, 2022
👻 Tiny Footprint Concurrent UI library for Fiber.

Development and Maintenance Status RancherOS 1.x is no longer being actively maintained. There are two significant reasons behind this product decisio

Matt D 0 Jan 5, 2022
Tiny structured logging abstraction or facade for various logging libraries, allowing the end user to plug in the desired logging library in main.go

Tiny structured logging abstraction or facade for various logging libraries, allowing the end user to plug in the desired logging library in main.go.

Jacek Olszak 12 Jul 30, 2022
Composable, observable and performant config handling for Go for the distributed processing era

Konfig Composable, observable and performant config handling for Go. Written for larger distributed systems where you may have plenty of configuration

Lalamove 626 Jul 30, 2022
Simple error handling primitives

errors Package errors provides simple error handling primitives. go get github.com/pkg/errors The traditional error handling idiom in Go is roughly ak

null 7.8k Aug 4, 2022
a tool for handling file uploads simple

baraka a tool for handling file uploads for http servers makes it easier to make operations with files from the http request. Contents Install Simple

Enes Furkan Olcay 44 Jul 14, 2022
Currency handling for Go.

currency Handles currency amounts, provides currency information and formatting. Powered by CLDR v38, in just ~30kb of data. Backstory: https://bojanz

Bojan Zivanovic 327 Aug 3, 2022
A sync.WaitGroup with error handling and concurrency control

go-waitgroup How to use An package that allows you to use the constructs of a sync.WaitGroup to create a pool of goroutines and control the concurrenc

Pieter Claerhout 31 Jun 17, 2022