imagespull

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package imagespull implements `gplay metadata images pull`: it rapatriates the Store images live on Google Play for a package into the local Metadata tree on disk, under each locale's images/ sub-directory, alongside the text Listing `.txt` files. It reads ONLY from Play, then writes additively: resolve --package/--dir, open a read-only Edit, enumerate the app's locales, list each of the 9 image slots, download each image's bytes from its API url, and hand the resulting imagetree.Tree to imagetree.Write. The Edit is opened and discarded via edits.WithReadOnlyEdit, never committed.

Filename synthesis (ADR-0013): images.list returns no original filename, so pull names singular slots `<type>.<ext>` and gallery slots `<type>/1.<ext>`… `N.<ext>` in display order, with the extension sniffed from the image bytes (PNG/JPEG magic), not the response Content-Type. A slot with no images online writes no directory/file, so pull never emits the "empty" form and a later `apply` sees no delta: the pull → apply no-op invariant.

Index

Constants

View Source
const DefaultDir = "./metadata"

DefaultDir matches the rest of the metadata family and `fastlane supply`.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(boot kernel.Boot) *cobra.Command

NewCommand returns the cobra command for `gplay metadata images pull`.

func Run

func Run(rc *kernel.RunContext, in Input) (output.Renderable, error)

Run resolves inputs, opens a read-only Edit, lists every (locale, imageType) slot, downloads the bytes, and writes the resulting tree additively.

Types

type Input

type Input struct {
	Package string
	Dir     string
}

Input is the request-shaped struct cobra builds from flags.

type Payload

type Payload struct {
	Package string       `json:"package"`
	Dir     string       `json:"dir"`
	Pulled  []slotReport `json:"pulled"`
	Summary summary      `json:"summary"`
}

Payload is a gplay-defined summary of what pull WROTE (not an API pass-through): the on-disk result, not the wire payload, is what the operator cares about. Pulled is in (locale, canonical type) order.

func (Payload) Renderers

func (p Payload) Renderers() output.Renderers

Jump to

Keyboard shortcuts

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