uri

package
v3.0.3-rc1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

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"
)

Variables

This section is empty.

Functions

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.

Examples:

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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