docker

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDigest

func CalculateDigest(data []byte) string

CalculateDigest calculates SHA256 digest of data

func CalculateDirectoryDigest

func CalculateDirectoryDigest(dir string) (string, error)

CalculateDirectoryDigest calculates SHA256 digest of all files in a directory Files are processed in sorted order for deterministic results

func GetCachePath

func GetCachePath(ref string) string

GetCachePath returns the local cache path for an image reference, or "" if the image is not in the cache. Checks local build cache first, then the registry pull cache.

func ImageExistsInCache

func ImageExistsInCache(ref string) bool

ImageExistsInCache checks if an image exists in the local cache Checks both local build cache and registry pull cache

func IsLocalReference

func IsLocalReference(ref string) bool

IsLocalReference checks if an image reference is local (no registry prefix)

func SanitizeImageRef

func SanitizeImageRef(ref string) string

SanitizeImageRef converts an image reference to a safe filename

Types

type Builder

type Builder struct{}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) BuildImage

func (b *Builder) BuildImage(imageRef string, files []string, manifest interface{}) error

BuildImage creates a Docker image from scratch with the specified files

func (*Builder) BuildImageFromPath

func (b *Builder) BuildImageFromPath(imageRef string, basePath string, files []string, manifest interface{}) error

BuildImageFromPath creates a Docker image from files in a specified directory

type CachedImage

type CachedImage struct {
	Name      string
	Type      string // "local-build" or "registry-pull"
	Source    string
	BuildTime time.Time
	Size      int64
	Manifest  *manifest.Manifest // The aigogo.json manifest if available
}

CachedImage represents a cached image with its metadata

type Deleter

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

Deleter handles deleting images from registries

func NewDeleter

func NewDeleter() *Deleter

NewDeleter creates a new deleter

func (*Deleter) Delete

func (d *Deleter) Delete(imageRef string) error

Delete removes an image from a registry

func (*Deleter) DeleteAll

func (d *Deleter) DeleteAll(registry, repository string) error

DeleteAll deletes all tags in a repository

type Extractor

type Extractor struct{}

func NewExtractor

func NewExtractor() *Extractor

func (*Extractor) Extract

func (e *Extractor) Extract(imageRef, outputDir string, force bool) ([]string, error)

Extract extracts files from a cached image to a directory

type ImageMetadata

type ImageMetadata struct {
	Ref       string    `json:"ref"`
	CreatedAt time.Time `json:"created_at"`
	Size      int64     `json:"size"`
}

type Lister

type Lister struct{}

func NewLister

func NewLister() *Lister

func (*Lister) List

func (l *Lister) List() ([]string, error)

List returns simple list of cached image names (for backward compatibility)

func (*Lister) ListDetailed

func (l *Lister) ListDetailed() ([]CachedImage, error)

List returns all cached images with their metadata

type LocalBuildMetadata

type LocalBuildMetadata struct {
	Name     string             `json:"name"`
	Type     string             `json:"type"` // "local-build" or "registry-pull"
	BuiltAt  string             `json:"built_at"`
	Source   string             `json:"source"` // "local", registry URL, etc.
	Registry string             `json:"registry,omitempty"`
	Manifest *manifest.Manifest `json:"manifest,omitempty"`
}

LocalBuildMetadata stores information about local builds

type LocalBuilder

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

LocalBuilder builds packages to local cache without pushing

func NewLocalBuilder

func NewLocalBuilder() *LocalBuilder

NewLocalBuilder creates a new local builder

func (*LocalBuilder) Build

func (b *LocalBuilder) Build(imageRef string, m *manifest.Manifest, force bool) error

Build builds a package to the local cache

func (*LocalBuilder) BuildFromDir

func (b *LocalBuilder) BuildFromDir(srcDir string, imageRef string, m *manifest.Manifest, force bool) error

BuildFromDir builds a package from a specific directory

type Puller

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

func NewPuller

func NewPuller() *Puller

func (*Puller) Pull

func (p *Puller) Pull(imageRef string) error

Pull downloads an image from a registry

type Pusher

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

func NewPusher

func NewPusher() *Pusher

func (*Pusher) Push

func (p *Pusher) Push(imageRef string) error

Push uploads an image to a registry using Docker Registry HTTP API V2

type Remover

type Remover struct{}

func NewRemover

func NewRemover() *Remover

func (*Remover) Remove

func (r *Remover) Remove(imageRef string) error

Remove deletes a cached image (both local builds and registry pulls)

func (*Remover) RemoveAll

func (r *Remover) RemoveAll() error

RemoveAll deletes all cached packages (both local builds and registry pulls)

Jump to

Keyboard shortcuts

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