pull

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadImage

func DownloadImage(token *TokenResponse, manifests *ManifestsResp, arch string, operateSystem string, imageName string, tag string) (path *string, err error)

DownloadImage 根据提供的manifests下载镜像层和配置

func Execute added in v1.0.2

func Execute(flag *Flag) (*string, error)

Execute 执行pull命令

func Package

func Package(path string, imageName string, tag string, arch string, operateSystem string, outputPath string, outputFile *string) (*string, error)

Package 打包为可load镜像

func RemoveImageSaveDir

func RemoveImageSaveDir(imageName, tag, arch, operateSystem string)

Types

type Annotations

type Annotations struct {
	ComDockerOfficialImagesBashbrewArch string `json:"com.docker.official-images.bashbrew.arch"`
	OrgOpencontainersImageBaseName      string `json:"org.opencontainers.image.base.name"`
	OrgOpencontainersImageCreated       string `json:"org.opencontainers.image.created"`
	OrgOpencontainersImageRevision      string `json:"org.opencontainers.image.revision"`
	OrgOpencontainersImageSource        string `json:"org.opencontainers.image.source"`
	OrgOpencontainersImageUrl           string `json:"org.opencontainers.image.url"`
	OrgOpencontainersImageVersion       string `json:"org.opencontainers.image.version"`
	VndDockerReferenceDigest            string `json:"vnd.docker.reference.digest"`
	VndDockerReferenceType              string `json:"vnd.docker.reference.type"`
}

type Config

type Config struct {
	MediaType string `json:"mediaType"`
	Digest    string `json:"digest"`
	Size      int    `json:"size"`
}

type Flag added in v1.0.2

type Flag struct {
	Image  string
	Tag    string
	Arch   string
	OsFlag string
	Path   string
}

Flag pull命令参数

type Layer

type Layer struct {
	MediaType string `json:"mediaType"`
	Digest    string `json:"digest"`
	Size      int    `json:"size"`
}

type Manifest

type Manifest struct {
	Annotations Annotations `json:"annotations"`
	Digest      string      `json:"digest"`
	MediaType   string      `json:"mediaType"`
	Platform    Platform    `json:"platform"`
	Size        int         `json:"size"`
}

type ManifestsResp

type ManifestsResp struct {
	Manifests     []Manifest  `json:"manifests"`
	MediaType     string      `json:"mediaType"`
	SchemaVersion int         `json:"schemaVersion"`
	Config        Config      `json:"config"`
	Layers        []Layer     `json:"layers"`
	Annotations   Annotations `json:"annotations"`
}

func GetManifest

func GetManifest(token *TokenResponse, imageName, tag string, arch string, os string) (*ManifestsResp, error)

func GetManifestByDigest

func GetManifestByDigest(token *TokenResponse, imageName, digest string) (*ManifestsResp, error)

type Platform

type Platform struct {
	Architecture string `json:"architecture"`
	Os           string `json:"os"`
	Variant      string `json:"variant"`
}

type TokenResponse

type TokenResponse struct {
	Token       string    `json:"token"`
	AccessToken string    `json:"access_token"`
	ExpiresIn   int       `json:"expires_in"`
	IssuedAt    time.Time `json:"issued_at"`
}

func GetToken

func GetToken(imageName string) (*TokenResponse, error)

Jump to

Keyboard shortcuts

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