imagesync

package
v0.0.0-...-b2d0fcc Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LocalStore  string
	RemoteStore string
	MaxParallel int
}

Config holds the configuration for the Docker image sync operation.

type ImageData

type ImageData struct {
	Config struct {
		Hostname     string   `json:"Hostname"`
		Domainname   string   `json:"Domainname"`
		User         string   `json:"User"`
		AttachStdin  bool     `json:"AttachStdin"`
		AttachStdout bool     `json:"AttachStdout"`
		AttachStderr bool     `json:"AttachStderr"`
		ExposedPorts struct{} `json:"ExposedPorts"`
		Tty          bool     `json:"Tty"`
		OpenStdin    bool     `json:"OpenStdin"`
		StdinOnce    bool     `json:"StdinOnce"`
		Env          []string `json:"Env"`
		Cmd          []string `json:"Cmd"`
		Image        string   `json:"Image"`
		Volumes      struct{} `json:"Volumes"`
		WorkingDir   string   `json:"WorkingDir"`
		Entrypoint   []string `json:"Entrypoint"`
		OnBuild      []string `json:"OnBuild"`
	} `json:"Config"`
	RootFS struct {
		Type    string   `json:"Type"`
		Layers  []string `json:"Layers"`
		DiffIDs []string `json:"DiffIDs"`
	} `json:"RootFS"`
	Architecture string `json:"Architecture"`
	Os           string `json:"Os"`
}

ImageData represents Docker image metadata.

type ImageSync

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

ImageSync handles Docker image synchronization operations.

func NewImageSync

func NewImageSync(cfg Config, runner *remote.Runner) *ImageSync

NewImageSync creates a new ImageSync instance with the provided configuration and SSH runner.

func (*ImageSync) CompareImages

func (s *ImageSync) CompareImages(ctx context.Context, image string) (bool, error)

CompareImages checks if the image needs to be synced by comparing local and remote versions.

func (*ImageSync) Sync

func (s *ImageSync) Sync(ctx context.Context, image string) (bool, error)

Sync performs the Docker image synchronization process.

Jump to

Keyboard shortcuts

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