imagehosting

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: GPL-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package imagehosting selects, uploads, and persists release images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupImageResult added in v0.3.2

type CleanupImageResult struct {
	ID     string `json:"id"`
	State  string `json:"state"`
	Reason string `json:"reason,omitempty"`
}

CleanupImageResult is a shareable outcome containing only a run-local opaque ID.

type CleanupReport added in v0.3.2

type CleanupReport struct {
	RunID    string               `json:"runId"`
	Deleted  int                  `json:"deleted"`
	Retained int                  `json:"retained"`
	Pending  int                  `json:"pending"`
	Unknown  int                  `json:"unknown"`
	Failed   int                  `json:"failed"`
	Images   []CleanupImageResult `json:"images"`
}

CleanupReport accounts for uploaded images and unresolved upload attempts without URLs. Unconfirmed deletions are retained with a reason and are never retried automatically; Unknown counts are reserved for upload outcomes that require reconciliation.

func CleanupLiveTestImages added in v0.3.2

func CleanupLiveTestImages(ctx context.Context, cfg config.Config, runID, journalPath string) (CleanupReport, error)

CleanupLiveTestImages deletes only exact returned URLs backed by this run's validated journal. The caller owns the cross-process run lock and private path validation, and supplies a fresh bounded context after stopping the workflow.

type Service

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

Service coordinates configured image-host uploaders and image persistence.

func NewLiveTestServiceWithRegistry added in v0.3.2

func NewLiveTestServiceWithRegistry(
	cfg config.Config, logger api.Logger, repo repository, registry *trackers.Registry, runID, journalPath string,
	maxImages int,
) (*Service, error)

NewLiveTestServiceWithRegistry wraps every configured production uploader in a durable live-test journal guard. The caller must own the run lock and validate the private run directory. Lostimg cleanup remains supported; successful uploads to other providers are retained and reported. maxImages bounds all journaled upload attempts; zero disables remote uploads.

func NewServiceWithRegistry

func NewServiceWithRegistry(cfg config.Config, logger api.Logger, repo repository, registry *trackers.Registry) *Service

NewServiceWithRegistry returns an image-hosting service with tracker-owned host scope metadata.

func (*Service) ListCandidates

func (s *Service) ListCandidates(ctx context.Context, meta api.ImageHostingSubject) ([]api.ScreenshotImage, error)

ListCandidates returns existing local and uploaded screenshot selections for image hosting, deduplicated by local image path. Disc-menu selections retain api.ScreenshotPurposeMenu; all other candidates use final purpose.

func (*Service) Upload

func (s *Service) Upload(
	ctx context.Context,
	meta api.ImageHostingSubject,
	host string,
	usageScope string,
	images []api.ScreenshotImage,
) ([]api.UploadedImageLink, error)

Upload validates and deduplicates local image paths, uploads them to one host, and persists successful links when a repository is configured. Tracker-owned hosts require their matching usage scope; HDB batches keep normal and disc-menu images in separate, non-overlapping galleries.

Directories

Path Synopsis
Package policy describes generic image uploader capabilities.
Package policy describes generic image uploader capabilities.

Jump to

Keyboard shortcuts

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