cleanups

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupF added in v0.18.17

type CleanupF = func() error

func IgnoreErrs

func IgnoreErrs(fn CleanupF, ignored ...error) CleanupF

func Infallible

func Infallible(fn func()) CleanupF

type CleanupFunc

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

type Cleanups

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

func (*Cleanups) Add

func (c *Cleanups) Add(msg string, f CleanupF) CleanupFunc

func (*Cleanups) ReAdd

func (c *Cleanups) ReAdd(f CleanupFunc) CleanupFunc

ReAdd allows you to decide to run an already added cleanup function at a later time. Once readded, it will only be run at this time rather than both times. This is occasionally needed when you want to ensure some state is cleaned up right after it's created, but if more state is created later you ned to run this cleanup at that later time (e.g. closing a network connection in all cases).

func (*Cleanups) Run

func (c *Cleanups) Run() error

Jump to

Keyboard shortcuts

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