closer

package
v0.2.49 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package closer stores process-wide shutdown callbacks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(c interface{ Close() error })

Bind registers the Close method of c as a shutdown callback.

func BindPriority added in v0.2.30

func BindPriority(priority Priority, c interface{ Close() error })

BindPriority registers the Close method of c with an explicit close phase.

func CloseAll

func CloseAll()

CloseAll runs all registered shutdown callbacks in reverse registration order.

func Register

func Register(f func() error)

Register adds f to the process shutdown callback list.

func RegisterPriority added in v0.2.30

func RegisterPriority(priority Priority, f func() error)

RegisterPriority adds f to the shutdown callback list with an explicit close phase.

Types

type Priority added in v0.2.30

type Priority int
const (
	PriorityProducer Priority = 100
	PriorityFlush    Priority = 200
	PriorityCache    Priority = 300
	PriorityDefault  Priority = 500
	PriorityDatabase Priority = 900
	PriorityLogger   Priority = 1000
)

Jump to

Keyboard shortcuts

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