Documentation ¶
Index ¶
Constants ¶
const ( DependenciesMetadata = "dependencies" DefaultVersions = "default_versions" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildImage ¶ added in v1.28.0
type BuildImage = buildpack.BuildImage
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 // contains filtered or unexported fields }
Buildpack is an extension to libbuildpack.Buildpack that adds additional opinionated behaviors.
func NewBuildpack ¶
NewBuildpack creates a new instance of Buildpack from a specified buildpack.Buildpack.
func (Buildpack) DefaultVersion ¶ added in v1.48.0
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
Identity make Buildpack satisfy the Identifiable interface.
func (Buildpack) IncludeFiles ¶
IncludeFiles returns the include_files buildpack metadata.
func (Buildpack) PrePackage ¶
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 stack.Stack) (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) Has ¶ added in v1.38.0
func (d Dependencies) Has(id string) bool
Has indicates whether the collection of dependencies has any dependency of a specific id. This is used primarily to determine whether an optional dependency exists, before calling Best() which would throw an error if one did not.
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 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.
type Version ¶
Version is an extension to semver.Version to make it marshalable.
func (Version) MarshalText ¶
MarshalText makes Version satisfy the encoding.TextMarshaler interface.
func (*Version) UnmarshalText ¶
UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.