podman

Форк
0
27 строк · 813.0 Байт
1
// Copyright 2017 go-dockerclient authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4

5
package docker
6

7
import (
8
	"encoding/json"
9
	"net/http"
10

11
	"github.com/docker/docker/api/types/registry"
12
)
13

14
// InspectDistribution returns image digest and platform information by contacting the registry
15
func (c *Client) InspectDistribution(name string) (*registry.DistributionInspect, error) {
16
	path := "/distribution/" + name + "/json"
17
	resp, err := c.do(http.MethodGet, path, doOptions{})
18
	if err != nil {
19
		return nil, err
20
	}
21
	defer resp.Body.Close()
22
	var distributionInspect registry.DistributionInspect
23
	if err := json.NewDecoder(resp.Body).Decode(&distributionInspect); err != nil {
24
		return nil, err
25
	}
26
	return &distributionInspect, nil
27
}
28

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.