package module
v0.0.0-...-f877e4d Latest Latest

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 10 Imported by: 4


CLI Wrapper

This package allows to set a set of Signal Handling functions and then execute them when the corresponding signal has been sent by the OS to the executable.

For a usage example see the examples folder.




This section is empty.


This section is empty.


func HttpServer

func HttpServer(setters ...SetFn) (func(context.Context) error, func(context.Context) error)

HttpServer initializes a http.Server object with values set using SetFn() functions

func RegisterSignalHandlers

func RegisterSignalHandlers(handlers SignalHandlers) *w

RegisterSignalHandlers sets up the signal handlers we want to use


type SetFn

type SetFn func(*c) error

func Handler

func Handler(h http.Handler) SetFn

func OnSocket

func OnSocket(s string) SetFn

func OnSystemd

func OnSystemd() SetFn

func OnTCP

func OnTCP(addr string) SetFn

func WithTLSCert

func WithTLSCert(cert, key string) SetFn

func WriteWait

func WriteWait(d time.Duration) SetFn

type SignalHandlers

type SignalHandlers map[os.Signal]handlerFn

SignalHandlers is a map that stores the association between signals and functions to be executed


Path Synopsis

Jump to

Keyboard shortcuts

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