Documentation ¶
Index ¶
- func DockerHashFromManifest(imageManifest []byte) (string, error)
- func LayersFromManifest(imageManifest []byte) ([]v1.Descriptor, error)
- func Manifest(registry, repo, username, apiKey string, client *http.Client, ...) ([]byte, []byte, int64, error)
- func Pull(registry, repo, localFile, username, apiKey string, client *http.Client, ...) ([]byte, []byte, int64, error)
- func PullBlob(registry, repo, hash, localFile, username, apiKey string, maxsize int64, ...) (int64, string, error)
- func Tags(registry, repository, username, apiKey string, client *http.Client, ...) ([]string, error)
- type ProgressWriter
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerHashFromManifest ¶
DockerHashFromManifest get the sha256 hash as a string from a raw image manifest. The "docker hash" is what is used for the image, i.e. the topmost layer.
func LayersFromManifest ¶
func LayersFromManifest(imageManifest []byte) ([]v1.Descriptor, error)
LayersFromManifest get the descriptors for layers from a raw image manifest
func Manifest ¶
func Manifest(registry, repo, username, apiKey string, client *http.Client, prgchan types.StatsNotifChan) ([]byte, []byte, int64, error)
Manifest retrieves the manifest for a repo from a registry and returns it. Optionally, can use authentication of username and apiKey as provided, else defaults to the local user config. Also can use a given http client, else uses the default. Returns the manifest of the repo passed to it, the manifest of the resolved image, which either is the same as the repo manifest if an image, or the repo resolved from a manifest index, the size of the entire image, and error, if any.
func Pull ¶
func Pull(registry, repo, localFile, username, apiKey string, client *http.Client, prgchan types.StatsNotifChan) ([]byte, []byte, int64, error)
Pull downloads an entire image from a registry and saves it as a tar file at the provided location. Optionally, can use authentication of username and apiKey as provided, else defaults to the local user config. Also can use a given http client, else uses the default. Returns the manifest of the repo passed to it, the manifest of the resolved image, which either is the same as the repo manifest if an image, or the repo resolved from a manifest index, the size of the entire download, and error, if any.
func PullBlob ¶
func PullBlob(registry, repo, hash, localFile, username, apiKey string, maxsize int64, client *http.Client, prgchan types.StatsNotifChan) (int64, string, error)
PullBlob downloads a blob from a registry and save it as a file as-is.
func Tags ¶
func Tags(registry, repository, username, apiKey string, client *http.Client, prgchan types.StatsNotifChan) ([]string, error)
Tags return all known tags for a given repository on a given registry. Optionally, can use authentication of username and apiKey as provided, else defaults to the local user config. Also can use a given http client, else uses the default. Returns a slice of tags of the repo passed to it, and error, if any.
Types ¶
type ProgressWriter ¶
type ProgressWriter struct {
// contains filtered or unexported fields
}
ProgressWriter is a writer which will send the download progress