dockerhub

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 19 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).

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 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(specSheet repointerface.SpecSheet) (prefabPath string, blueprintPath string, err error)

func (*Repo) FabricateDepend

func (r *Repo) FabricateDepend(item *prefab.Prefab, existVersions []string) (prefabPaths []string, blueprintPaths []string, err error)

func (*Repo) GenerateSpecSheet

func (r *Repo) GenerateSpecSheet(name string, specifier string) (specSheet repointerface.SpecSheet, err error)

func (*Repo) GetEnvs

func (r *Repo) GetEnvs(specSheet repointerface.SpecSheet) (envs []string, err error)

func (*Repo) GetVersions

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

func (*Repo) Init

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

func (*Repo) New

func (r *Repo) New(workDir string, tmpDir string) (err error)

type SpecSheet

type SpecSheet struct {
	SpecType      string `json:"specType"`
	Name_s        string `json:"name"`
	Version_s     string `json:"version"`
	Environment_s string `json:"environment"`
	Tag           string `json:"tag"`
	Arch          string `json:"arch"`
}

func (*SpecSheet) Environment

func (s *SpecSheet) Environment() string

func (*SpecSheet) Name

func (s *SpecSheet) Name() string

func (*SpecSheet) SelectEnv

func (s *SpecSheet) SelectEnv(envs []string) (err error)

select one environment and fill it into [environmet] Warning! no matched environment is not an error, should leave [environment] empty and return nil

func (*SpecSheet) SelectVersion

func (s *SpecSheet) SelectVersion(versions []string) (err error)

func (*SpecSheet) Type

func (s *SpecSheet) Type() string

func (*SpecSheet) Version

func (s *SpecSheet) Version() string

func (*SpecSheet) VersionSpecifier

func (s *SpecSheet) VersionSpecifier() string

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", "pytorch/pytorch" and "busybox" (which will be changed to "library/busybox")

Jump to

Keyboard shortcuts

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