storeassets

package
v1.261128.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package storeassets shares the App Clip and preview folders used by metadata and migrate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExportTargets

func CheckExportTargets(root rootfs.Root, files []ExportFile, overwrite bool) error

CheckExportTargets validates every destination before an export writes files.

func ClosePreviews

func ClosePreviews(previews []PreviewLayout)

func PreviewsOutsideDeviceFolders

func PreviewsOutsideDeviceFolders(base string) ([]string, error)

PreviewsOutsideDeviceFolders lists, relative to base, the video files kept directly in a locale folder, which ReadPreviews does not read.

func Validate

func Validate(ctx context.Context, clip *AppClipLayout, previews []PreviewLayout) (cleanup func(), err error)

Validate snapshots each selected media file before inspecting it. Uploads use the snapshot, so a repository path swap after validation cannot change bytes.

func WriteExport

func WriteExport(ctx context.Context, d *shared.Deps, root rootfs.Root, files []ExportFile, overwrite bool) ([]string, error)

WriteExport honors the same no-overwrite preflight for text and media.

Types

type AppClipLayout

type AppClipLayout struct {
	Action       string            `json:"action,omitempty"`
	Subtitles    map[string]string `json:"subtitles,omitempty"`
	HeaderImages map[string]string `json:"headerImages,omitempty"`
	// contains filtered or unexported fields
}

func ReadAppClip

func ReadAppClip(metadataDir string) (layout AppClipLayout, present bool, err error)

ReadAppClip reads only files below the selected metadata root. A canonical asset file expresses intent; empty folders left by exports do not.

func (*AppClipLayout) Close

func (clip *AppClipLayout) Close()

type DifferingTargetsError

type DifferingTargetsError struct {
	Paths []string
}

DifferingTargetsError lists existing destinations, relative to the export root, that an export without Overwrite would have to replace.

func (*DifferingTargetsError) Error

func (e *DifferingTargetsError) Error() string

func (*DifferingTargetsError) Unwrap

func (e *DifferingTargetsError) Unwrap() error

type ExportFile

type ExportFile struct {
	Path string
	Text *string
	URL  string
}

ExportFile is a file fetched from the selected version. URLs stay private to execution.

func ExportPlan

func ExportPlan(ctx context.Context, d *shared.Deps, client *asc.Client, versionID, metadataPrefix string, clip, previews bool) ([]ExportFile, []string, error)

ExportPlan obtains all remote assets before touching the selected output root.

func ExportPlanWithVersionLocalizations

func ExportPlanWithVersionLocalizations(ctx context.Context, d *shared.Deps, client *asc.Client, versionID, metadataPrefix string, clip, previews bool, localizations []asc.Resource[asc.AppStoreVersionLocalizationAttributes]) ([]ExportFile, []string, error)

ExportPlanWithVersionLocalizations reuses a complete localization collection fetched for this version within the caller's current export. A nil collection is a resolved empty result. The supplied resources are only read.

type ExportOptions

type ExportOptions struct {
	AppID, VersionID, MetadataPrefix string
	Clip, Previews, Overwrite        bool
}

ExportOptions binds cleanup to the exact selected target and layout.

type ImportPlan

type ImportPlan struct {
	Clip          *AppClipLayout
	Previews      []PreviewLayout
	Experience    asc.Resource[asc.AppClipDefaultExperienceAttributes]
	ClipID        string
	VersionID     string
	Localizations map[string]asc.Resource[asc.AppClipDefaultExperienceLocalizationAttributes]
	Headers       map[string]asc.Resource[asc.AppClipHeaderImageAttributes]
	// contains filtered or unexported fields
}

ImportPlan is a preflight snapshot. It selects only the requested version's experience and resolves missing-target ambiguity before any mutation.

func PrepareImport

func PrepareImport(ctx context.Context, d *shared.Deps, client *asc.Client, appID, versionID string, clip *AppClipLayout, previews []PreviewLayout) (*ImportPlan, error)

func (*ImportPlan) Apply

func (p *ImportPlan) Apply(ctx context.Context, client *asc.Client, localeToID map[string]string) ([]asc.StoreAssetResult, error)

func (*ImportPlan) Changes

func (p *ImportPlan) Changes() []asc.StoreAssetChange

Changes describes the full target and content fingerprint used by metadata review/approval. No transfer is allowed to bypass these entries.

type ManagedExport

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

ManagedExport retains the inventory identity captured before any output writes.

func PrepareExport

func PrepareExport(d *shared.Deps, root rootfs.Root, files []ExportFile, options ExportOptions) (*ManagedExport, error)

PrepareExport rejects malformed ownership and target conflicts before callers write ordinary metadata. Unselected scopes retain their existing ownership.

func (*ManagedExport) Write

func (p *ManagedExport) Write(ctx context.Context) ([]string, []string, error)

Write records pending bytes before publication. Cleanup happens only after every desired asset has been handled; failures preserve the recovery journal.

type PreviewLayout

type PreviewLayout struct {
	Locale      string `json:"locale"`
	DeviceType  string `json:"deviceType"`
	FileName    string `json:"fileName"`
	Path        string `json:"path"`
	PosterFrame string `json:"posterFrame,omitempty"`
	// contains filtered or unexported fields
}

func ReadPreviews

func ReadPreviews(base string) (previews []PreviewLayout, err error)

Jump to

Keyboard shortcuts

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