Documentation
¶
Overview ¶
Package storeassets shares the App Clip and preview folders used by metadata and migrate.
Index ¶
- func CheckExportTargets(root rootfs.Root, files []ExportFile, overwrite bool) error
- func ClosePreviews(previews []PreviewLayout)
- func Validate(ctx context.Context, clip *AppClipLayout, previews []PreviewLayout) (cleanup func(), err error)
- func WriteExport(ctx context.Context, root rootfs.Root, files []ExportFile, overwrite bool) ([]string, error)
- type AppClipLayout
- type ExportFile
- type ExportOptions
- type ImportPlan
- type ManagedExport
- type PreviewLayout
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 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, 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 ExportFile ¶
ExportFile is a file fetched from the selected version. URLs stay private to execution.
func ExportPlan ¶
func ExportPlan(ctx context.Context, 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, 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, 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(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.
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)