dockerhub

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPath

func CleanPath(path string) string

CleanPath makes a path safe for use with filepath.Join. This is done by not only cleaning the path, but also (if the path is relative) adding a leading '/' and cleaning it (then removing the leading '/'). This ensures that a path resulting from prepending another path will always resolve to lexically be a subdirectory of the prefixed path. This is all done lexically, so paths that include symlinks won't be safe as a result of using CleanPath.

This function comes from runC (libcontainer/utils/utils.go).

func DecodeSpecifier added in v0.2.2

func DecodeSpecifier(specifier string) (c repointerface.Constraint, err error)

func NameNormalizer added in v0.2.2

func NameNormalizer(name string) (normalized string)

Types

type Blob

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

type DockerHubResponse

type DockerHubResponse struct {
	Next    string `json:"next"`
	Results []Tag  `json:"results"`
}

type Env

type Env struct {
	Os           string `json:"os"`           // e.g. "linux"
	Architecture string `json:"architecture"` // e.g. "386", "amd64", "arm64", "arm", "mips64le", "ppc64le", "riscv64", "s390x"
	Variant      string `json:"variant"`      // e.g. ("arm"-)"v5", "v6", "v7" ("arm64"-) "v8"
}

func (Env) String

func (p Env) String() string

type EnvSpec added in v0.2.2

type EnvSpec struct {
	Arch string `json:"arch"`
}

func DecodeEnvSpec added in v0.2.2

func DecodeEnvSpec(s string) (es EnvSpec, err error)

func (EnvSpec) Encode added in v0.2.2

func (es EnvSpec) Encode() string

type Image

type Image struct {
	Architecture string `json:"architecture"`
	OS           string `json:"os"`
	Digest       string `json:"digest"`
}

type Manifest

type Manifest struct {
	SchemaVersion int    `json:"schemaVersion"`
	MediaType     string `json:"mediaType"`
	Config        Blob   `json:"config"`
	Layers        []Blob `json:"layers"`
}

type Repo

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

func (*Repo) Fabricate

func (r *Repo) Fabricate(name string, version repointerface.Version, envs []string, dstDir string) (prefabPaths []string, blueprintPaths []string, err error)

func (*Repo) FilterEnv added in v0.2.2

func (r *Repo) FilterEnv(envs []string) (selected []string)

func (*Repo) GetEnvSpec added in v0.2.2

func (r *Repo) GetEnvSpec() repointerface.EnvSpec

func (*Repo) GetEnvs

func (r *Repo) GetEnvs(name string, version repointerface.Version) (envs []string, err error)

func (*Repo) GetVersions

func (r *Repo) GetVersions(name string) (versions []repointerface.Version, err error)

func (*Repo) Init

func (r *Repo) Init(ctx *dcontext.DeployContext) (err error)

func (*Repo) SelectEnv added in v0.2.2

func (r *Repo) SelectEnv(envs []string, envSpec repointerface.EnvSpec) (selected string, err error)

func (*Repo) SelectVersion added in v0.2.2

func (r *Repo) SelectVersion(versions []repointerface.Version) (selected repointerface.Version, err error)

type Tag

type Tag struct {
	Name   string  `json:"name"`
	Images []Image `json:"images"`
}

func GetInfo

func GetInfo(name string) (tags []Tag, err error)

name accept "pytorch/pytorch" and "busybox" (which will be changed to "library/busybox")

type Version added in v0.2.2

type Version string

func ParseVersion added in v0.2.2

func ParseVersion(version string) (ver Version, err error)

func (Version) Compare added in v0.2.2

func (a Version) Compare(other repointerface.Version) (result int)

func (Version) String added in v0.2.2

func (v Version) String() string

Jump to

Keyboard shortcuts

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