sync

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputItem

type OutputItem struct {
	Source     string `json:"source"`
	Target     string `json:"target"`
	Repository string `json:"repository"`
	StartTime  time.Time
	EndTime    time.Time
	Duration   time.Duration
	Status     string `json:"status"` // Success, Failed, or Skipped
	ErrorMsg   string `json:"error,omitempty"`
}

OutputItem represents an item in the output

type SyncStatistics

type SyncStatistics struct {
	TotalImages     int           `json:"total_images"`
	Successful      int           `json:"successful"`
	Failed          int           `json:"failed"`
	Skipped         int           `json:"skipped"`
	TotalDuration   time.Duration `json:"total_duration"`
	AverageDuration time.Duration `json:"average_duration"`
}

SyncStatistics holds statistics about the sync operation

type SyncStatisticsV2 added in v0.2.0

type SyncStatisticsV2 struct {
	TotalImages     int           // Total number of images to sync
	Successful      int           // Number of successfully synced images
	Failed          int           // Number of failed sync operations
	Skipped         int           // Number of skipped images
	TotalDuration   time.Duration // Total duration of the sync process
	AverageDuration time.Duration // Average duration per successful operation
}

SyncStatisticsV2 holds statistics for the synchronization process

type Syncer

type Syncer struct {
	Config *config.Config
	Client docker.ClientInterface
	Output []OutputItem
	// contains filtered or unexported fields
}

Syncer handles the synchronization of images

func NewSyncer

func NewSyncer(config *config.Config, client docker.ClientInterface) *Syncer

NewSyncer creates a new Syncer instance

func (*Syncer) GetProcessedImageCount

func (s *Syncer) GetProcessedImageCount() int

GetProcessedImageCount returns the number of successfully processed images

func (*Syncer) ProcessImage

func (s *Syncer) ProcessImage(ctx context.Context, source string) (string, string, error)

processImage handles the core image processing logic

func (*Syncer) ProcessImageWithRetry

func (s *Syncer) ProcessImageWithRetry(ctx context.Context, source string) (string, string, error)

ProcessImageWithRetry processes a single image with retry logic

func (*Syncer) Run

func (s *Syncer) Run(ctx context.Context) error

Run processes all images with concurrency control

type SyncerV2 added in v0.2.0

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

SyncerV2 represents the enhanced syncer with dependency injection

func NewSyncerV2 added in v0.2.0

func NewSyncerV2(
	config *config.Config,
	dockerClient docker.ClientInterface,
	registryClient registry.RegistryInterface,
) *SyncerV2

NewSyncerV2 creates a new SyncerV2 instance with dependency injection

func (*SyncerV2) GetProcessedImageCount added in v0.2.0

func (s *SyncerV2) GetProcessedImageCount() int

GetProcessedImageCount returns the number of successfully processed images

func (*SyncerV2) Run added in v0.2.0

func (s *SyncerV2) Run(ctx context.Context) error

Run executes the synchronization process

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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