Documentation
¶
Index ¶
- Constants
- Variables
- func ClassifyBackendError(err error) (OpError, ErrorKind, bool)
- func CleanDockerRefs(refs []string) []string
- func CleanOCIRefs(refs []string) []string
- func CloneStringMap(values map[string]string) map[string]string
- func ConsumeDockerImagePullProgress(reader io.Reader) ([]*agentcomposev2.ImagePullProgress, error)
- func DockerEndpointFromEnv() string
- func DockerImageDangling(tags, digests []string) bool
- func DockerInspectToProtoImage(image typesimage.InspectResponse, inspectedAt time.Time, imageRef string) *agentcomposev2.Image
- func DockerPlatformString(platform *agentcomposev2.ImagePlatform) string
- func DockerSummaryToProtoImage(image typesimage.Summary, inspectedAt time.Time, imageRef string) *agentcomposev2.Image
- func EnsureDriverImage(ctx context.Context, config *appconfig.Config, backend Backend, ...) error
- func EnsureProjectAgentImages(ctx context.Context, config *appconfig.Config, backend Backend, ...) error
- func FirstNonEmpty(values ...string) string
- func FirstString(values []string) string
- func ImageCachePlatform(platform *agentcomposev2.ImagePlatform) imagecache.Platform
- func IsNotFound(err error) bool
- func NonNegativeUint64(value int64) uint64
- func OCIMetadataToProtoImage(image imagecache.ImageMetadata, inspectedAt time.Time) *agentcomposev2.Image
- func PaginateProtoImages(images []*agentcomposev2.Image, offset, limit uint32) ([]*agentcomposev2.Image, bool, uint32)
- func PingDockerDaemon(ctx context.Context) error
- type AutoBackend
- func (b *AutoBackend) BuildImage(ctx context.Context, req BuildRequest, sink BuildEventSink) (BuildResult, error)
- func (b *AutoBackend) HasDockerBackend() bool
- func (b *AutoBackend) HasOCIBackend() bool
- func (b *AutoBackend) InspectImage(ctx context.Context, req InspectRequest) (InspectResult, error)
- func (b *AutoBackend) LastSelection() string
- func (b *AutoBackend) ListImages(ctx context.Context, req ListRequest) (ListResult, error)
- func (b *AutoBackend) Mode() string
- func (b *AutoBackend) PullImage(ctx context.Context, req PullRequest) (PullResult, error)
- func (b *AutoBackend) RemoveImage(ctx context.Context, req RemoveRequest) (RemoveResult, error)
- type AutoBackendOption
- type Backend
- type BuildBackend
- type BuildEventSink
- type BuildRequest
- type BuildResult
- type DockerBackend
- func (b *DockerBackend) BuildImage(ctx context.Context, req BuildRequest, sink BuildEventSink) (BuildResult, error)
- func (b *DockerBackend) InspectImage(ctx context.Context, req InspectRequest) (InspectResult, error)
- func (b *DockerBackend) ListImages(ctx context.Context, req ListRequest) (ListResult, error)
- func (b *DockerBackend) PullImage(ctx context.Context, req PullRequest) (PullResult, error)
- func (b *DockerBackend) RemoveImage(ctx context.Context, req RemoveRequest) (RemoveResult, error)
- type DockerBackendOption
- type DockerClient
- type DockerClientFactory
- type DockerPingFunc
- type EnsureRequest
- type ErrorKind
- type InspectRequest
- type InspectResult
- type ListRequest
- type ListResult
- type OCIBackend
- func (b *OCIBackend) CacheRoot() string
- func (b *OCIBackend) HasCache() bool
- func (b *OCIBackend) InspectImage(ctx context.Context, req InspectRequest) (InspectResult, error)
- func (b *OCIBackend) ListImages(ctx context.Context, req ListRequest) (ListResult, error)
- func (b *OCIBackend) PullImage(ctx context.Context, req PullRequest) (PullResult, error)
- func (b *OCIBackend) RemoveImage(ctx context.Context, req RemoveRequest) (RemoveResult, error)
- type OCIBackendOption
- type OpError
- type ProjectAgentImagesRequest
- type PullRequest
- type PullResult
- type RemoveRequest
- type RemoveResult
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 CleanDockerRefs ¶
func CleanOCIRefs ¶
func ConsumeDockerImagePullProgress ¶
func ConsumeDockerImagePullProgress(reader io.Reader) ([]*agentcomposev2.ImagePullProgress, error)
func DockerEndpointFromEnv ¶
func DockerEndpointFromEnv() string
func DockerImageDangling ¶
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 FirstNonEmpty ¶
func FirstString ¶
func ImageCachePlatform ¶
func ImageCachePlatform(platform *agentcomposev2.ImagePlatform) imagecache.Platform
func IsNotFound ¶
func NonNegativeUint64 ¶
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 ¶
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 DockerClient ¶
type DockerClient interface {
ImageList(context.Context, typesimage.ListOptions) ([]typesimage.Summary, error)
ImagePull(context.Context, string, typesimage.PullOptions) (io.ReadCloser, error)
ImageBuild(context.Context, io.Reader, buildtypes.ImageBuildOptions) (buildtypes.ImageBuildResponse, error)
ImageInspect(context.Context, string, ...client.ImageInspectOption) (typesimage.InspectResponse, error)
ImageRemove(context.Context, string, typesimage.RemoveOptions) ([]typesimage.DeleteResponse, error)
DaemonHost() string
Close() error
}
type DockerClientFactory ¶
type DockerClientFactory func() (DockerClient, error)
type DockerPingFunc ¶
type EnsureRequest ¶
type InspectRequest ¶
type InspectRequest struct {
ImageRef string
}
type InspectResult ¶
type InspectResult struct {
Image *agentcomposev2.Image
StoreStatus *agentcomposev2.ImageStoreStatus
}
type ListRequest ¶
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 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 ¶
Click to show internal directories.
Click to hide internal directories.