shub

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// URINotSupported if we are using a non default registry error out for now
	URINotSupported string = "Only the default Singularity Hub registry is supported for now"
)

Variables

This section is empty.

Functions

func DownloadImage

func DownloadImage(ctx context.Context, manifest APIResponse, filePath, shubRef string, force, noHTTPS bool) error

DownloadImage image will download a shub image to a path. This will not try to cache it, or use cache.

func Pull

func Pull(ctx context.Context, imgCache *cache.Handle, pullFrom, tmpDir string, noHTTPS bool) (imagePath string, err error)

Pull will pull a shub image to the cache or direct to a temporary file if cache is disabled

func PullToFile

func PullToFile(ctx context.Context, imgCache *cache.Handle, pullTo, pullFrom, tmpDir string, noHTTPS bool) (imagePath string, err error)

PullToFile will pull a shub image to the specified location, through the cache, or directly if cache is disabled

Types

type APIResponse

type APIResponse struct {
	Image   string `json:"image"`
	Name    string `json:"name"`
	Tag     string `json:"tag"`
	Version string `json:"version"`
	Commit  string `json:"commit"`
}

APIResponse holds the information returned from the Shub API

func GetManifest

func GetManifest(uri URI, noHTTPS bool) (APIResponse, error)

GetManifest will return the image manifest for a container uri from Singularity Hub.

type URI

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

URI stores the various components of a singularityhub URI

func ParseReference

func ParseReference(src string) (URI, error)

ParseReference accepts a valid Shub reference string and parses its content It will return an error if the given URI is not valid, otherwise it will parse the contents into a URI struct

func (*URI) String

func (s *URI) String() string

Jump to

Keyboard shortcuts

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