wrapper

package module
v0.0.0-...-c862d94 Latest Latest
Warning

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

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

README

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpServer

func HttpServer(setters ...SetFn) (func() 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

Types

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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