package cleanups

import "github.com/dotcloud/docker/internal/cleanups"

Index

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.

Source Files

composite.go

Version
v28.1.1+incompatible (latest)
Published
Apr 18, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
3 hours ago

Tools for package owners.