Documentation ¶
Index ¶
- Constants
- type BuildImage
- type BuildImages
- type Buildpack
- func (b Buildpack) DefaultVersion(id string) (string, error)
- func (b Buildpack) Dependencies() (Dependencies, error)
- func (b Buildpack) Identity() (string, string)
- func (b Buildpack) IncludeFiles() ([]string, error)
- func (b Buildpack) PrePackage() (string, bool)
- func (b Buildpack) RuntimeDependency(id, version string, stack stack.Stack) (Dependency, error)
- type Dependencies
- type Dependency
- type Info
- type License
- type Licenses
- type Metadata
- type RunImage
- type RunImages
- type Stack
- type Stacks
- type Version
Constants ¶
const ( CacheRoot = "dependency-cache" DependenciesMetadata = "dependencies" DefaultVersions = "default-versions" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildImage ¶
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) Dependencies ¶
func (b Buildpack) Dependencies() (Dependencies, error)
Dependencies returns the collection of dependencies extracted from the generic buildpack metadata.
func (Buildpack) IncludeFiles ¶
IncludeFiles returns the include_files buildpack metadata.
func (Buildpack) PrePackage ¶
PrePackage returns the pre_package buildpack metadata.
func (Buildpack) RuntimeDependency ¶
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 ¶
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 NewDependency ¶
func NewDependency(dep map[string]interface{}) (Dependency, error)
NewDependency makes a Dependency from a generic map describing a Dependency
func (Dependency) Identity ¶
func (d Dependency) Identity() (string, string)
Identity make Buildpack satisfy the Identifiable 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.