Documentation ¶
Index ¶
- Constants
- type MergeFunc
- type Metadata
- type Plan
- type Plans
- func (p Plans) Get(name string) []Plan
- func (p Plans) GetMerged(name string, merge MergeFunc) (Plan, bool, error)
- func (p Plans) GetPriorityMerged(name string, priorities map[interface{}]int) (Plan, bool, error)
- func (p Plans) GetShallowMerged(name string) (Plan, bool, error)
- func (p Plans) Has(name string) bool
- type Writer
Constants ¶
const VersionSource = "version-source"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MergeFunc ¶
func PriorityMerge ¶
PriorityMerge returns a function that merges two Plans together, giving precedence first to the one which declares a version; and then, to the plan which has a higher priority level. PriorityMerge defines a Plan's priority level by looking for a "version-source" key defined in the Plan.Metadata, and uses the provided map to define the priority level for that source. Currently, an unknown source (one specified in a Plan, but not provided in the priority list) has a priority level of 0. An example priority list, used for the Node Engine CNB, is:
"buildpack.yml": 3, "package.json": 2, ".nvmrc": 1, "": -1
Metadata for most cases is combined (excluding version-source, build and launch), with a comma delimiter if present in both plans. version-source is set to the highest priority between the plans, and build/launch will be set to true if either of the plans request them.
type Plan ¶
type Plan = buildpackplan.Plan
Plan represents a contractual buildpack plan.
func ShallowMerge ¶
ShallowMerge merges two Plans together. Declared versions are combined with a comma delimiter and metadata is combined with the values for b taking priority over the values of a when keys are duplicated.
type Plans ¶
type Plans struct {
buildpackplan.Plans
}
Plan represents a contractual buildpack plan.
func (Plans) GetMerged ¶
GetMerged returns a single Plan that is a merged version of all of the Plan's that have a given name. A merge function is used to describe how two entries are merged together. Returns true if any matching Plan's were found, false otherwise.
func (Plans) GetPriorityMerged ¶
GetPriorityMerged returns a single Plan that is a merged version of all of the Plan's that have a given name. Merging is accomplished with the PriorityMerge function. Returns true if any matching Plan's were found, false otherwise.
func (Plans) GetShallowMerged ¶
GetShallowMerged returns a single Plan that is a merged version of all of the Plan's that have a given name. Merging is accomplished with the ShallowMerge function. Returns true if any matching Plan's were found, false otherwise.
type Writer ¶
type Writer = buildpackplan.Writer
Writer is a function write writes the contents of a Plans