types

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Cleanup

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

Cleanup allows defers to be aborted when cleanup needs to happen conditionally. Usage:

	 cu := cleanup.Make(func() { f.Close() })
	 defer cu.Clean() // failure before release is called will close the file.
	 ...
   cu.Add(func() { f2.Close() })  // Adds another cleanup function
   ...
	 cu.Release() // on success, aborts closing the file.
	 return f

func Make

func Make(f func()) Cleanup

Make creates a new Cleanup object.

func (*Cleanup) Add

func (c *Cleanup) Add(f func())

Add adds a new function to be called on Clean().

func (*Cleanup) Clean

func (c *Cleanup) Clean()

Clean calls all cleanup functions in reverse order.

func (*Cleanup) Release

func (c *Cleanup) Release() func()

Release releases the cleanup from its duties, i.e. cleanup functions are not called after this point. Returns a function that calls all registered functions in case the caller has use for them.

type Discoverer

type Discoverer interface {
	Images(ctx context.Context) ([]apitypes.ContainerImageInfo, error)
	Image(ctx context.Context, imageID string) (apitypes.ContainerImageInfo, error)
	ExportImage(ctx context.Context, imageID string) (io.ReadCloser, error)

	Containers(ctx context.Context) ([]apitypes.ContainerInfo, error)
	Container(ctx context.Context, containerID string) (apitypes.ContainerInfo, error)
	ExportContainer(ctx context.Context, containerID string) (io.ReadCloser, func(), error)

	Ready(ctx context.Context) (bool, error)
}

type DiscovererFactory

type DiscovererFactory func() (Discoverer, error)

type ListContainersResponse

type ListContainersResponse struct {
	Containers []apitypes.ContainerInfo
}

type ListImagesResponse

type ListImagesResponse struct {
	Images []apitypes.ContainerImageInfo
}

Jump to

Keyboard shortcuts

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