images

package
v0.0.0-...-460160b Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDockerPingTimeout = 750 * time.Millisecond

Variables

View Source
var ErrBuildUnsupported = errors.New("image build is not supported by selected image backend")

Functions

func ClassifyBackendError

func ClassifyBackendError(err error) (OpError, ErrorKind, bool)

func CleanDockerRefs

func CleanDockerRefs(refs []string) []string

func CleanOCIRefs

func CleanOCIRefs(refs []string) []string

func CloneStringMap

func CloneStringMap(values map[string]string) map[string]string

func ConsumeDockerImagePullProgress

func ConsumeDockerImagePullProgress(reader io.Reader) ([]*agentcomposev2.ImagePullProgress, error)

func DockerEndpointFromEnv

func DockerEndpointFromEnv() string

func DockerImageDangling

func DockerImageDangling(tags, digests []string) bool

func DockerInspectToProtoImage

func DockerInspectToProtoImage(image typesimage.InspectResponse, inspectedAt time.Time, imageRef string) *agentcomposev2.Image

func DockerPlatformString

func DockerPlatformString(platform *agentcomposev2.ImagePlatform) string

func DockerSummaryToProtoImage

func DockerSummaryToProtoImage(image typesimage.Summary, inspectedAt time.Time, imageRef string) *agentcomposev2.Image

func EnsureDriverImage

func EnsureDriverImage(ctx context.Context, config *appconfig.Config, backend Backend, req EnsureRequest) error

func EnsureProjectAgentImages

func EnsureProjectAgentImages(ctx context.Context, config *appconfig.Config, backend Backend, req ProjectAgentImagesRequest) error

func FirstNonEmpty

func FirstNonEmpty(values ...string) string

func FirstString

func FirstString(values []string) string

func ImageCachePlatform

func ImageCachePlatform(platform *agentcomposev2.ImagePlatform) imagecache.Platform

func IsNotFound

func IsNotFound(err error) bool

func NonNegativeUint64

func NonNegativeUint64(value int64) uint64

func OCIMetadataToProtoImage

func OCIMetadataToProtoImage(image imagecache.ImageMetadata, inspectedAt time.Time) *agentcomposev2.Image

func PaginateProtoImages

func PaginateProtoImages(images []*agentcomposev2.Image, offset, limit uint32) ([]*agentcomposev2.Image, bool, uint32)

func PingDockerDaemon

func PingDockerDaemon(ctx context.Context) error

Types

type AutoBackend

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

func NewAutoBackend

func NewAutoBackend(mode string, dockerBackend, ociBackend Backend, options ...AutoBackendOption) *AutoBackend

func (*AutoBackend) BuildImage

func (b *AutoBackend) BuildImage(ctx context.Context, req BuildRequest, sink BuildEventSink) (BuildResult, error)

func (*AutoBackend) HasDockerBackend

func (b *AutoBackend) HasDockerBackend() bool

func (*AutoBackend) HasOCIBackend

func (b *AutoBackend) HasOCIBackend() bool

func (*AutoBackend) InspectImage

func (b *AutoBackend) InspectImage(ctx context.Context, req InspectRequest) (InspectResult, error)

func (*AutoBackend) LastSelection

func (b *AutoBackend) LastSelection() string

func (*AutoBackend) ListImages

func (b *AutoBackend) ListImages(ctx context.Context, req ListRequest) (ListResult, error)

func (*AutoBackend) Mode

func (b *AutoBackend) Mode() string

func (*AutoBackend) PullImage

func (b *AutoBackend) PullImage(ctx context.Context, req PullRequest) (PullResult, error)

func (*AutoBackend) RemoveImage

func (b *AutoBackend) RemoveImage(ctx context.Context, req RemoveRequest) (RemoveResult, error)

type AutoBackendOption

type AutoBackendOption func(*AutoBackend)

func WithDockerPing

func WithDockerPing(ping DockerPingFunc) AutoBackendOption

func WithDockerPingTimeout

func WithDockerPingTimeout(timeout time.Duration) AutoBackendOption

type Backend

type Backend interface {
	ListImages(context.Context, ListRequest) (ListResult, error)
	PullImage(context.Context, PullRequest) (PullResult, error)
	InspectImage(context.Context, InspectRequest) (InspectResult, error)
	RemoveImage(context.Context, RemoveRequest) (RemoveResult, error)
}

type BuildBackend

type BuildBackend interface {
	BuildImage(context.Context, BuildRequest, BuildEventSink) (BuildResult, error)
}

type BuildEventSink

type BuildEventSink interface {
	Send(*agentcomposev2.BuildImageEvent) error
}

type BuildRequest

type BuildRequest struct {
	ContextDir string
	Dockerfile string
	Tags       []string
	BuildArgs  map[string]string
	Target     string
	Platform   *agentcomposev2.ImagePlatform
	NoCache    bool
	Pull       bool
}

type BuildResult

type BuildResult struct {
	Image       *agentcomposev2.Image
	ImageRef    string
	ResolvedRef string
	Warnings    []string
}

type DockerBackend

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

func NewDockerBackend

func NewDockerBackend(options ...DockerBackendOption) *DockerBackend

func (*DockerBackend) BuildImage

func (b *DockerBackend) BuildImage(ctx context.Context, req BuildRequest, sink BuildEventSink) (BuildResult, error)

func (*DockerBackend) InspectImage

func (b *DockerBackend) InspectImage(ctx context.Context, req InspectRequest) (InspectResult, error)

func (*DockerBackend) ListImages

func (b *DockerBackend) ListImages(ctx context.Context, req ListRequest) (ListResult, error)

func (*DockerBackend) PullImage

func (b *DockerBackend) PullImage(ctx context.Context, req PullRequest) (PullResult, error)

func (*DockerBackend) RemoveImage

func (b *DockerBackend) RemoveImage(ctx context.Context, req RemoveRequest) (RemoveResult, error)

type DockerBackendOption

type DockerBackendOption func(*DockerBackend)

func WithDockerClientFactory

func WithDockerClientFactory(factory DockerClientFactory) DockerBackendOption

func WithDockerClock

func WithDockerClock(now func() time.Time) DockerBackendOption

type DockerClientFactory

type DockerClientFactory func() (DockerClient, error)

type DockerPingFunc

type DockerPingFunc func(context.Context) error

type EnsureRequest

type EnsureRequest struct {
	Driver      string
	ImageRef    string
	ProjectName string
	AgentName   string
}

type ErrorKind

type ErrorKind int
const (
	ErrorKindUnknown ErrorKind = iota
	ErrorKindNotFound
	ErrorKindInvalidReference
	ErrorKindConflict
	ErrorKindInternal
	ErrorKindUnavailable
)

type InspectRequest

type InspectRequest struct {
	ImageRef string
}

type InspectResult

type InspectResult struct {
	Image       *agentcomposev2.Image
	StoreStatus *agentcomposev2.ImageStoreStatus
}

type ListRequest

type ListRequest struct {
	Query string
	All   bool
}

type ListResult

type ListResult struct {
	Images      []*agentcomposev2.Image
	StoreStatus *agentcomposev2.ImageStoreStatus
}

type OCIBackend

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

func NewOCIBackend

func NewOCIBackend(cache *imagecache.Cache, options ...OCIBackendOption) *OCIBackend

func (*OCIBackend) CacheRoot

func (b *OCIBackend) CacheRoot() string

func (*OCIBackend) HasCache

func (b *OCIBackend) HasCache() bool

func (*OCIBackend) InspectImage

func (b *OCIBackend) InspectImage(ctx context.Context, req InspectRequest) (InspectResult, error)

func (*OCIBackend) ListImages

func (b *OCIBackend) ListImages(ctx context.Context, req ListRequest) (ListResult, error)

func (*OCIBackend) PullImage

func (b *OCIBackend) PullImage(ctx context.Context, req PullRequest) (PullResult, error)

func (*OCIBackend) RemoveImage

func (b *OCIBackend) RemoveImage(ctx context.Context, req RemoveRequest) (RemoveResult, error)

type OCIBackendOption

type OCIBackendOption func(*OCIBackend)

func WithOCIClock

func WithOCIClock(now func() time.Time) OCIBackendOption

type OpError

type OpError struct {
	Op       string
	Endpoint string
	ImageRef string
	Err      error
}

func (OpError) Error

func (e OpError) Error() string

func (OpError) Unwrap

func (e OpError) Unwrap() error

type ProjectAgentImagesRequest

type ProjectAgentImagesRequest struct {
	ProjectName string
	Agents      []domain.ProjectAgentRecord
}

ProjectAgentImagesRequest identifies the project and agents to ensure driver images for.

type PullRequest

type PullRequest struct {
	ImageRef string
	Platform *agentcomposev2.ImagePlatform
}

type PullResult

type PullResult struct {
	Image       *agentcomposev2.Image
	ResolvedRef string
	Progress    []*agentcomposev2.ImagePullProgress
	Warnings    []string
}

type RemoveRequest

type RemoveRequest struct {
	ImageRef      string
	Force         bool
	PruneChildren bool
}

type RemoveResult

type RemoveResult struct {
	ImageRef     string
	UntaggedRefs []string
	DeletedIDs   []string
	Warnings     []string
}

Jump to

Keyboard shortcuts

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