Documentation
¶
Index ¶
- func ClassifyMediaInputError(err error, parameter string) error
- func CollectAssetFiles(path string) ([]string, error)
- func ContextWithAssetUploadTimeout(ctx context.Context) (context.Context, context.CancelFunc)
- func ContextWithAssetUploadTimeoutWith(ctx context.Context, d *shared.Deps) (context.Context, context.CancelFunc)
- func DownloadMediaURL(ctx context.Context, d *shared.Deps, url, outputPath string, overwrite bool) (int64, string, error)
- func ExecuteScreenshotSetUpload[T any](ctx context.Context, d *shared.Deps, opts ScreenshotSetUploadOptions[T]) (T, error)
- func GetOrderedAppScreenshotIDs(ctx context.Context, client *asc.Client, setID string) ([]string, error)
- func InvalidDeviceTypeError(err error) error
- func IsHLSPlaylist(contentType, rawURL string) bool
- func NewAssetsPreviewsDeleteCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsPreviewsDownloadCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsPreviewsListCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsPreviewsSetPosterFrameCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsPreviewsUploadCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsApplyCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsDeleteCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsDownloadCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsListCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsPlanCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsReorderCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsSizesCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsUploadCommand(d *shared.Deps) *ffcli.Command
- func NewAssetsScreenshotsValidateCommand(d *shared.Deps) *ffcli.Command
- func NormalizePreviewType(input string) (string, error)
- func NormalizeScreenshotPlanDeviceTypes(deviceTypes []string) ([]string, error)
- func ResolveImageAssetDownloadURL(asset *asc.ImageAsset, fileName string) (string, error)
- func SetOrderedAppScreenshots(ctx context.Context, client *asc.Client, setID string, orderedIDs []string) error
- func UploadPreviewAsset(ctx context.Context, client *asc.Client, setID, filePath string) (asc.AssetUploadResultItem, error)
- func UploadPreviewFiles(uploadCtx, rollbackBase context.Context, client *asc.Client, setID string, ...) ([]asc.AssetUploadResultItem, []asc.AssetUploadFailureItem, error)
- func UploadScreenshotAssetsConcurrently(ctx context.Context, d *shared.Deps, client *asc.Client, setID string, ...) ([]asc.AssetUploadResultItem, string, error)
- func ValidPreviewFrameTimeCode(tc string) bool
- func ValidatePreviewFiles(files []string, enforceCapacity bool) error
- type ScreenshotPlanGroup
- type ScreenshotSetAccess
- type ScreenshotSetCreateFunc
- type ScreenshotSetListFunc
- type ScreenshotSetUploadFlags
- type ScreenshotSetUploadOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyMediaInputError ¶
ClassifyMediaInputError turns a marked local media failure into an expected-negative validation failure for parameter, keeping its message and exit code. Unmarked errors are returned unchanged.
func CollectAssetFiles ¶
CollectAssetFiles validates and collects files from a path.
func ContextWithAssetUploadTimeout ¶
ContextWithAssetUploadTimeout returns a context with the asset upload timeout.
func ContextWithAssetUploadTimeoutWith ¶
func ContextWithAssetUploadTimeoutWith(ctx context.Context, d *shared.Deps) (context.Context, context.CancelFunc)
ContextWithAssetUploadTimeoutWith is ContextWithAssetUploadTimeout with the upload timeout setting resolved through d.
func DownloadMediaURL ¶
func DownloadMediaURL(ctx context.Context, d *shared.Deps, url, outputPath string, overwrite bool) (int64, string, error)
DownloadMediaURL downloads an unauthenticated media URL using the asset transfer path, on d.
func ExecuteScreenshotSetUpload ¶ added in v1.260404.0
func ExecuteScreenshotSetUpload[T any](ctx context.Context, d *shared.Deps, opts ScreenshotSetUploadOptions[T]) (T, error)
ExecuteScreenshotSetUpload validates flags/files and runs the shared screenshot upload/sync flow for a localization-backed screenshot set, on d.
func GetOrderedAppScreenshotIDs ¶
func GetOrderedAppScreenshotIDs(ctx context.Context, client *asc.Client, setID string) ([]string, error)
GetOrderedAppScreenshotIDs returns screenshot IDs in the current remote order.
func InvalidDeviceTypeError ¶
InvalidDeviceTypeError is invalidDeviceTypeError for other command groups.
func IsHLSPlaylist ¶
IsHLSPlaylist reports whether a preview download is an HLS playlist; pass an empty contentType to decide from the URL alone before downloading.
func NewAssetsPreviewsDeleteCommand ¶
NewAssetsPreviewsDeleteCommand returns the preview delete subcommand.
func NewAssetsPreviewsDownloadCommand ¶
NewAssetsPreviewsDownloadCommand returns the previews download subcommand.
func NewAssetsPreviewsListCommand ¶
NewAssetsPreviewsListCommand returns the previews list subcommand.
func NewAssetsPreviewsSetPosterFrameCommand ¶
NewAssetsPreviewsSetPosterFrameCommand returns the set-poster-frame subcommand.
func NewAssetsPreviewsUploadCommand ¶
NewAssetsPreviewsUploadCommand returns the previews upload subcommand.
func NewAssetsScreenshotsApplyCommand ¶
NewAssetsScreenshotsApplyCommand returns the screenshots apply subcommand.
func NewAssetsScreenshotsDeleteCommand ¶
NewAssetsScreenshotsDeleteCommand returns the screenshot delete subcommand.
func NewAssetsScreenshotsDownloadCommand ¶
NewAssetsScreenshotsDownloadCommand returns the screenshots download subcommand.
func NewAssetsScreenshotsListCommand ¶
NewAssetsScreenshotsListCommand returns the screenshots list subcommand.
func NewAssetsScreenshotsPlanCommand ¶
NewAssetsScreenshotsPlanCommand returns the screenshots plan subcommand.
func NewAssetsScreenshotsReorderCommand ¶
NewAssetsScreenshotsReorderCommand returns the screenshots reorder subcommand.
func NewAssetsScreenshotsSizesCommand ¶
NewAssetsScreenshotsSizesCommand returns the screenshots sizes subcommand.
func NewAssetsScreenshotsUploadCommand ¶
NewAssetsScreenshotsUploadCommand returns the screenshots upload subcommand.
func NewAssetsScreenshotsValidateCommand ¶
NewAssetsScreenshotsValidateCommand returns the screenshots validate subcommand.
func NormalizePreviewType ¶
NormalizePreviewType normalizes and validates a preview type.
func NormalizeScreenshotPlanDeviceTypes ¶
NormalizeScreenshotPlanDeviceTypes validates and canonicalizes device tokens.
func ResolveImageAssetDownloadURL ¶
func ResolveImageAssetDownloadURL(asset *asc.ImageAsset, fileName string) (string, error)
ResolveImageAssetDownloadURL expands an ASC delivery template for an exported image.
func SetOrderedAppScreenshots ¶
func SetOrderedAppScreenshots(ctx context.Context, client *asc.Client, setID string, orderedIDs []string) error
SetOrderedAppScreenshots replaces the screenshot relationships for a set in the provided order.
func UploadPreviewAsset ¶
func UploadPreviewAsset(ctx context.Context, client *asc.Client, setID, filePath string) (asc.AssetUploadResultItem, error)
UploadPreviewAsset uploads a preview file to a set.
func UploadPreviewFiles ¶
func UploadPreviewFiles(uploadCtx, rollbackBase context.Context, client *asc.Client, setID string, setCreated bool, files []string) ([]asc.AssetUploadResultItem, []asc.AssetUploadFailureItem, error)
UploadPreviewFiles uploads previews and rolls back resources created by this run on failure. setCreated must be true only when this run created the preview set.
func UploadScreenshotAssetsConcurrently ¶
func UploadScreenshotAssetsConcurrently(ctx context.Context, d *shared.Deps, client *asc.Client, setID string, files []string, uploadContext func(context.Context) (context.Context, context.CancelFunc), open func(filePath string) (*os.File, error)) ([]asc.AssetUploadResultItem, string, error)
UploadScreenshotAssetsConcurrently uploads files into setID with the screenshot upload worker pool. Each upload runs under its own context from uploadContext and reads the handle from open, which it closes; a nil handle uploads from the path. Results keep file order. On failure it returns the results before the first failed file, that file, and the error, and deletes the screenshots uploaded after it. Cleanup requests take their deadline from d.Timeout.
func ValidPreviewFrameTimeCode ¶
ValidPreviewFrameTimeCode reports whether a timecode matches the upload contract.
func ValidatePreviewFiles ¶
ValidatePreviewFiles checks preview capacity, image contents, and extension before any destructive sync. enforceCapacity rejects more than three files.
Types ¶
type ScreenshotPlanGroup ¶
ScreenshotPlanGroup contains ordered relative paths for one locale and device.
func DiscoverScreenshotPlanGroups ¶
func DiscoverScreenshotPlanGroups(path string, deviceTypes []string) ([]ScreenshotPlanGroup, []string, error)
DiscoverScreenshotPlanGroups reads locale-first or device-first screenshot trees.
type ScreenshotSetAccess ¶ added in v1.260404.0
type ScreenshotSetAccess struct {
List ScreenshotSetListFunc
Create ScreenshotSetCreateFunc
}
ScreenshotSetAccess contains the list/create hooks for a screenshot-set owner.
type ScreenshotSetCreateFunc ¶ added in v1.260404.0
type ScreenshotSetCreateFunc func(context.Context, *asc.Client, string, string) (*asc.AppScreenshotSetResponse, error)
ScreenshotSetCreateFunc creates a screenshot set for a localization kind.
type ScreenshotSetListFunc ¶ added in v1.260404.0
type ScreenshotSetListFunc func(context.Context, *asc.Client, string, asc.RequestContextFunc) (*asc.AppScreenshotSetsResponse, error)
ScreenshotSetListFunc fetches screenshot sets for a localization kind.
type ScreenshotSetUploadFlags ¶
type ScreenshotSetUploadFlags struct {
// contains filtered or unexported fields
}
ScreenshotSetUploadFlags holds the --concurrency and --no-wait flags of a screenshot-set upload command.
func BindScreenshotSetUploadFlags ¶
func BindScreenshotSetUploadFlags(fs *flag.FlagSet, listCommand string) ScreenshotSetUploadFlags
BindScreenshotSetUploadFlags registers the upload controls of asc screenshots upload. listCommand names the command that shows processing state after a --no-wait upload.
type ScreenshotSetUploadOptions ¶ added in v1.260404.0
type ScreenshotSetUploadOptions[T any] struct { LocalizationID string Path string DeviceType string Replace bool Incremental bool DryRun bool // RequireConfirm checks --confirm, which Replace requires. It runs after // the required flags and before any file is read. RequireConfirm func() error // InspectCommand is the owner-specific read-only command shown when the // target screenshot set is full or has ambiguous checksum matches. InspectCommand string // ReplaceCommand is the owner-specific replacement command shown when the // target screenshot set is full. ReplaceCommand string InvalidDeviceTypeIsUsage bool ClientFactory func() (*asc.Client, error) RequestContext func(context.Context) (context.Context, context.CancelFunc) UploadContext func(context.Context) (context.Context, context.CancelFunc) Access ScreenshotSetAccess BuildResult func(string, asc.Resource[asc.AppScreenshotSetAttributes], []asc.AssetUploadResultItem) T }
ScreenshotSetUploadOptions configures the shared screenshot upload path for custom product pages and PPO treatment localizations.
Source Files
¶
- assets_download_helpers.go
- assets_helpers.go
- assets_input_errors.go
- assets_order.go
- assets_previews.go
- assets_screenshot_collection_scope.go
- assets_screenshot_concurrency.go
- assets_screenshot_order.go
- assets_screenshot_plan_folders.go
- assets_screenshot_resume_scope.go
- assets_screenshot_set_sync.go
- assets_screenshots.go
- assets_screenshots_delete.go
- assets_screenshots_discovery.go
- assets_screenshots_download.go
- assets_screenshots_duplicates.go
- assets_screenshots_reorder.go
- assets_screenshots_replace.go
- assets_screenshots_resume.go
- assets_screenshots_review_plan.go
- assets_screenshots_set_list.go
- assets_screenshots_upload.go
- assets_screenshots_validate.go