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 Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates configured image-host uploaders and image persistence.
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.