closers

package
v1.6.25 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close will cleanup all registered closers. You must make a call to Close before your app shutting down. For example:

func main() {
    defer closers.Close()
    // ...
}

func Closers

func Closers() basics.Peripheral

Closers returns the closers set as a basics.Peripheral

func ClosersClosers

func ClosersClosers() []basics.Peripheral

ClosersClosers returns the closers set as a basics.Peripheral array

func RegisterCloseFns

func RegisterCloseFns(fns ...func())

RegisterCloseFns adds a simple closure into our global closers set

func RegisterPeripheral

func RegisterPeripheral(servers ...basics.Peripheral)

RegisterPeripheral adds a peripheral into our global closers set. a basics.Peripheral object is a closable instance.

func SetupCloseHandlerAndEnterLoop

func SetupCloseHandlerAndEnterLoop(closers ...basics.Peripheral)

func SetupCloseHandlerAndWait

func SetupCloseHandlerAndWait(wg *sync.WaitGroup, closers ...basics.Peripheral)

Types

This section is empty.

Jump to

Keyboard shortcuts

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