buildpack

package
v0.20.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDockerLocator added in v0.15.0

func HasDockerLocator(locator string) bool

func ParseIDLocator

func ParseIDLocator(locator string) (id string, version string)

ParseIDLocator parses a buildpack locator in the following formats into its ID and version.

  • <id>[@<version>]
  • urn:cnb:builder:<id>[@<version>]
  • urn:cnb:registry:<id>[@<version>]
  • from=builder:<id>[@<version>] (deprecated)

If version is omitted, the version returned will be empty. Any "from=builder:" or "urn:cnb" prefix will be ignored.

func ParsePackageLocator added in v0.15.0

func ParsePackageLocator(locator string) (imageName string)

ParsePackageLocator parses a locator (in format `[docker://][<host>/]<path>[:<tag>⏐@<digest>]`) to image name (`[<host>/]<path>[:<tag>⏐@<digest>]`)

func ParseRegistryID added in v0.11.0

func ParseRegistryID(registryID string) (namespace string, name string, version string, err error)

ParseRegistryID parses a registry id (ie. `<namespace>/<name>@<version>`) into namespace, name and version components.

Supported formats:

  • <ns>/<name>[@<version>]
  • urn:cnb:registry:<ns>/<name>[@<version>]

Types

type LocatorType

type LocatorType int
const (
	InvalidLocator LocatorType = iota
	FromBuilderLocator
	URILocator
	IDLocator
	PackageLocator
	RegistryLocator
)

func GetLocatorType

func GetLocatorType(locator string, relativeBaseDir string, buildpacksFromBuilder []dist.BuildpackInfo) (LocatorType, error)

GetLocatorType determines which type of locator is designated by the given input. If a type cannot be determined, `INVALID_LOCATOR` will be returned. If an error is encountered, it will be returned.

func (LocatorType) String

func (l LocatorType) String() string

Jump to

Keyboard shortcuts

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