image

package
v0.0.0-...-41d593c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 68

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	ImageID string
	Names   []string
	Size    int64
}

func (*Image) String

func (image *Image) String() string

type ImageState

type ImageState struct {
	// Image is the image corresponding to this ImageState.
	Image *Image
	// Containers are the containers that use this image.
	Containers []*apicontainer.Container `json:"-"`
	// PulledAt is the time when this image was pulled.
	PulledAt time.Time
	// LastUsedAt is the time when this image was used last time.
	LastUsedAt time.Time
	// PullSucceeded defines whether this image has been pulled successfully before,
	// this should be set to true when one of the pull image call succeeds.
	PullSucceeded bool
	// contains filtered or unexported fields
}

ImageState represents a docker image and its state information such as containers associated with it

func (*ImageState) AddImageName

func (imageState *ImageState) AddImageName(imageName string)

AddImageName adds image name to image state

func (*ImageState) Fields

func (imageState *ImageState) Fields() logger.Fields

func (*ImageState) GetImageID

func (imageState *ImageState) GetImageID() string

GetImageID returns id of image

func (*ImageState) GetImageNamesCount

func (imageState *ImageState) GetImageNamesCount() int

GetImageNamesCount returns number of image names

func (*ImageState) GetPullSucceeded

func (imageState *ImageState) GetPullSucceeded() bool

GetPullSucceeded safely returns the PullSucceeded of the imageState

func (*ImageState) HasImageName

func (imageState *ImageState) HasImageName(containerImageName string) bool

HasImageName returns true if image state contains the containerImageName

func (*ImageState) HasNoAssociatedContainers

func (imageState *ImageState) HasNoAssociatedContainers() bool

HasNoAssociatedContainers returns true if image has no associated containers, false otherwise

func (*ImageState) MarshalJSON

func (imageState *ImageState) MarshalJSON() ([]byte, error)

MarshalJSON marshals image state

func (*ImageState) RemoveContainerReference

func (imageState *ImageState) RemoveContainerReference(container *apicontainer.Container) error

RemoveContainerReference removes container reference from image state

func (*ImageState) RemoveImageName

func (imageState *ImageState) RemoveImageName(containerImageName string) bool

RemoveImageName removes image name from image state

func (*ImageState) SetPullSucceeded

func (imageState *ImageState) SetPullSucceeded(pullSucceeded bool)

SetPullSucceeded sets the PullSucceeded of the imageState

func (*ImageState) String

func (imageState *ImageState) String() string

func (*ImageState) UpdateContainerReference

func (imageState *ImageState) UpdateContainerReference(container *apicontainer.Container)

UpdateContainerReference updates container reference in image state

func (*ImageState) UpdateImageState

func (imageState *ImageState) UpdateImageState(container *apicontainer.Container)

UpdateImageState updates image name and container reference in image state

Jump to

Keyboard shortcuts

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