cleanup

package
v0.8.18 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cleanup manages a collection of deferred functions to ensure proper resource cleanup upon application exit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseFun

type CloseFun = func() error

CloseFun is a cleanup function to be executed.

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection is a collection of cleanup operations.

func NewCollection

func NewCollection() *Collection

NewCollection returns a new Collection.

func (*Collection) Add

func (c *Collection) Add(cf CloseFun)

Add adds a CloseFun to the collection.

func (*Collection) Close

func (c *Collection) Close() []error

Close executes all cleanup operations and empties the collection.

Jump to

Keyboard shortcuts

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