Version: v3.1.1+incompatible Latest Latest

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

Go to latest
Published: Apr 2, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0




View Source
const (
	// Library is the keyword for a library ref
	Library = "library"
	// Shub is the keyword for a shub ref
	Shub = "shub"
	// HTTP is the keyword for http ref
	HTTP = "http"
	// HTTPS is the keyword for https ref
	HTTPS = "https"


This section is empty.


func GetName

func GetName(uri string) string

GetName turns a transport:ref URI into a name containing the top-level identifier of the image. For example, docker://godlovedc/lolcow returns lolcow

Returns "" when not in transport:ref format

func IsValid

func IsValid(source string) (valid bool, err error)

IsValid returns whether or not the given source is valid

func Split

func Split(uri string) (transport string, ref string)

Split splits a URI into it's components which can be used directly through containers/image

This can be tricky if there is no type but a file name contains a colon.


docker://ubuntu -> docker, //ubuntu
docker://ubuntu:18.04 -> docker, //ubuntu:18.04
oci-archive:path/to/archive -> oci-archive, path/to/archive
ubuntu -> "", ubuntu
ubuntu:18.04.img -> "", ubuntu:18.04.img


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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