registry

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegistry = "registry-1.docker.io"
	DefaultTag      = "latest"
	AuthService     = "registry.docker.io"
	AuthRealm       = "https://auth.docker.io/token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	ServerAddress string `json:"serveraddress,omitempty"`
	IdentityToken string `json:"identitytoken,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(insecure bool) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) DoRequest

func (c *Client) DoRequest(ctx context.Context, method, urlStr string, headers map[string]string, body io.Reader) (*http.Response, error)

func (*Client) DownloadBlob

func (c *Client) DownloadBlob(registry, name, digest string, writer io.Writer) error

func (*Client) GetBlob

func (c *Client) GetBlob(registry, name, digest string) ([]byte, error)

func (*Client) GetConfig

func (c *Client) GetConfig(registry, name string, manifest *ManifestV2) ([]byte, error)

func (*Client) GetManifest

func (c *Client) GetManifest(registry, name, reference string) (*ManifestV2, string, error)

func (*Client) GetTags

func (c *Client) GetTags(registry, repository string) (*TagList, error)

func (*Client) HeadBlob

func (c *Client) HeadBlob(registry, name, digest string) (int64, error)

func (*Client) Ping

func (c *Client) Ping(registry string) error

func (*Client) Push

func (c *Client) Push(registry, name, tag string, manifest *ManifestV2, config []byte, layers map[string]io.Reader) error

func (*Client) ResolveManifest

func (c *Client) ResolveManifest(registry, name, reference string) (*ManifestV2, string, error)

ResolveManifest resolves a manifest for the current platform (linux/arm64 preferred).

func (*Client) SetAuth

func (c *Client) SetAuth(username, password string)

type ImageRef

type ImageRef struct {
	Registry string
	Name     string
	Tag      string
	Digest   string
}

func ParseImageRef

func ParseImageRef(ref string) (*ImageRef, error)

func (*ImageRef) FullName

func (ir *ImageRef) FullName() string

func (*ImageRef) String

func (ir *ImageRef) String() string

type ManifestBlob

type ManifestBlob struct {
	MediaType   string            `json:"mediaType"`
	Size        int64             `json:"size"`
	Digest      string            `json:"digest"`
	URLs        []string          `json:"urls,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ManifestList

type ManifestList struct {
	SchemaVersion int                 `json:"schemaVersion"`
	MediaType     string              `json:"mediaType"`
	Manifests     []ManifestListEntry `json:"manifests"`
}

type ManifestListEntry

type ManifestListEntry struct {
	MediaType   string            `json:"mediaType"`
	Size        int64             `json:"size"`
	Digest      string            `json:"digest"`
	Platform    *Platform         `json:"platform"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ManifestV2

type ManifestV2 struct {
	SchemaVersion int               `json:"schemaVersion"`
	MediaType     string            `json:"mediaType"`
	Config        ManifestBlob      `json:"config"`
	Layers        []ManifestBlob    `json:"layers"`
	Annotations   map[string]string `json:"annotations,omitempty"`
}

type Platform

type Platform struct {
	Architecture string `json:"architecture"`
	OS           string `json:"os"`
	Variant      string `json:"variant,omitempty"`
}

type TagList

type TagList struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

Jump to

Keyboard shortcuts

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