cleanups

package
v26.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composite

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

func (*Composite) Add

func (c *Composite) Add(f func(context.Context) error)

Add adds a cleanup to be called.

func (*Composite) Call

func (c *Composite) Call(ctx context.Context) error

Call calls all cleanups in reverse order and returns an error combining all non-nil errors.

func (*Composite) Release

func (c *Composite) Release() func(context.Context) error

Release removes all cleanups, turning Call into a no-op. Caller still can call the cleanups by calling the returned function which is equivalent to calling the Call before Release was called.

Jump to

Keyboard shortcuts

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