buildpack

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildImages

type BuildImages = buildpack.BuildImages

type Buildpack

type Buildpack struct {
	buildpack.Buildpack

	// CacheRoot is the path to the root directory for the buildpack's dependency cache.
	CacheRoot string
}

Buildpack is an extension to libbuildpack.Buildpack that adds additional opinionated behaviors.

func NewBuildpack

func NewBuildpack(buildpack buildpack.Buildpack) Buildpack

NewBuildpack creates a new instance of Buildpack from a specified buildpack.Buildpack.

func (Buildpack) Dependencies

func (b Buildpack) Dependencies() (Dependencies, error)

Dependencies returns the collection of dependencies extracted from the generic buildpack metadata.

func (Buildpack) Identity added in v1.17.0

func (b Buildpack) Identity() (string, string)

Identity make Buildpack satisfy the Identifiable interface.

func (Buildpack) IncludeFiles

func (b Buildpack) IncludeFiles() ([]string, error)

IncludeFiles returns the include_files buildpack metadata.

func (Buildpack) PrePackage

func (b Buildpack) PrePackage() (string, bool)

PrePackage returns the pre_package buildpack metadata.

type Dependencies

type Dependencies []Dependency

Dependencies is a collection of Dependency instances.

func (Dependencies) Best

func (d Dependencies) Best(id string, versionConstraint string, stack string) (Dependency, error)

Best returns the best (latest version) dependency within a collection of Dependencies. The candidate set is first filtered by id, version, and stack, then the remaining candidates are sorted for the best result. If the versionConstraint is not specified (""), then the latest wildcard ("*") is used.

func (Dependencies) Len

func (d Dependencies) Len() int

Len makes Dependencies satisfy the sort.Interface interface.

func (Dependencies) Less

func (d Dependencies) Less(i int, j int) bool

Less makes Dependencies satisfy the sort.Interface interface.

func (Dependencies) Swap

func (d Dependencies) Swap(i int, j int)

Swap makes Dependencies satisfy the sort.Interface interface.

type Dependency

type Dependency struct {
	// ID is the dependency ID.
	ID string `mapstruct:"id" toml:"id"`

	// Name is the dependency ID.
	Name string `mapstruct:"name" toml:"name"`

	// Version is the dependency version.
	Version Version `mapstruct:"version" toml:"version"`

	// URI is the dependency URI.
	URI string `mapstruct:"uri" toml:"uri"`

	// SHA256 is the hash of the dependency.
	SHA256 string `mapstruct:"sha256" toml:"sha256"`

	// Stacks are the stacks the dependency is compatible with.
	Stacks Stacks `mapstruct:"stacks" toml:"stacks"`

	// Licenses are the stacks the dependency is distributed under.
	Licenses Licenses `mapstruct:"licenses" toml:"licenses"`
}

Dependency represents a buildpack dependency.

func (Dependency) Identity added in v1.17.0

func (d Dependency) Identity() (string, string)

Identity make Buildpack satisfy the Identifiable interface.

func (Dependency) String

func (d Dependency) String() string

String makes Dependency satisfy the Stringer interface.

func (Dependency) Validate

func (d Dependency) Validate() error

Validate ensures that the dependency is valid.

type Info

type Info = buildpack.Info

type License

type License struct {
	// Type is the type of the license.  This is typically the SPDX short identifier.
	Type string `mapstruct:"type" toml:"type"`

	// URI is the location where the license can be found.
	URI string `mapstruct:"uri" toml:"uri"`
}

License represents a license that a Dependency is distributed under. At least one of Name or URI MUST be specified.

func (License) String

func (l License) String() string

String makes License satisfy the Stringer interface.

func (License) Validate

func (l License) Validate() error

Validate ensures that license has at least one of type or uri

type Licenses

type Licenses []License

Licenses is a collection of licenses

func (Licenses) Validate

func (l Licenses) Validate() error

Validate ensures that there is at least one license and all licenses are valid

type Metadata

type Metadata = buildpack.Metadata

type RunImages

type RunImages = buildpack.RunImages

type Stack

type Stack = buildpack.Stack

type Stacks

type Stacks []string

Stacks is a collection of stack ids.

func (Stacks) Validate

func (s Stacks) Validate() error

Validate ensures that there is at least one stack.

type Version

type Version struct {
	*semver.Version
}

func (Version) MarshalText

func (v Version) MarshalText() ([]byte, error)

MarshalText makes Version satisfy the encoding.TextMarshaler interface.

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) error

UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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