Documentation
¶
Index ¶
- Constants
- func DecodeLaunchTOML(launchPath string, bpAPI string, launchTOML *LaunchTOML) error
- func EncodeLayerMetadataFile(lmf LayerMetadataFile, path, buildpackAPI string) error
- func MadeCached(l Layer) bool
- func MadeLaunch(l Layer) bool
- func Malformed(l Layer) bool
- func RetrieveFirstFromImageNameFromDockerfile(dockerfile string) (string, error)
- func VerifyBuildDockerfile(dockerfile string, logger log.Logger) error
- func VerifyRunDockerfile(dockerfile string) error
- type BOMEntry
- type BOMFile
- type BOMValidator
- type BaseInfo
- type BpDescriptor
- type BpInfo
- type BuildEnv
- type BuildExecutor
- type BuildInputs
- type BuildOutputs
- type BuildPlan
- type BuildTOML
- type DefaultBuildExecutor
- type DefaultDetectExecutor
- type DefaultGenerateExecutor
- type Descriptor
- type DetectExecutor
- type DetectInputs
- type DetectOutputs
- type DockerfileInfo
- type Error
- type ErrorType
- type ExtDescriptor
- type ExtInfo
- type ExtendArg
- type ExtendBuildConfig
- type ExtendConfig
- type GenerateExecutor
- type GenerateInputs
- type GenerateOutputs
- type Group
- type GroupElement
- func (e GroupElement) Equals(o GroupElement) bool
- func (e GroupElement) IsExtensionsOrder() bool
- func (e GroupElement) Kind() string
- func (e GroupElement) NoAPI() GroupElement
- func (e GroupElement) NoExtension() GroupElement
- func (e GroupElement) NoHomepage() GroupElement
- func (e GroupElement) NoOpt() GroupElement
- func (e GroupElement) String() string
- func (e GroupElement) WithAPI(version string) GroupElement
- func (e GroupElement) WithHomepage(address string) GroupElement
- type Label
- type LaunchTOML
- type Layer
- func (l *Layer) HasLocalContents() bool
- func (l *Layer) Identifier() string
- func (l *Layer) Name() string
- func (l *Layer) Path() string
- func (l *Layer) Read() (LayerMetadata, error)
- func (l *Layer) Remove() error
- func (l *Layer) WriteMetadata(metadata LayerMetadataFile) error
- func (l *Layer) WriteSha(sha string) error
- type LayerMetadata
- type LayerMetadataFile
- type LayerType
- type LayersDir
- type LayersMetadata
- type Order
- type Plan
- type PlanSections
- type ProcessEntry
- type Provide
- type Require
- type StoreTOML
- type Unmet
Constants ¶
View Source
const ( MediaTypeCycloneDX = "application/vnd.cyclonedx+json" MediaTypeSPDX = "application/spdx+json" MediaTypeSyft = "application/vnd.syft+json" ExtensionCycloneDX = "sbom.cdx.json" ExtensionSPDX = "sbom.spdx.json" ExtensionSyft = "sbom.syft.json" )
View Source
const ( // EnvBpPlanPath is the absolute path of the filtered build plan, containing relevant Buildpack Plan entries from detection EnvBpPlanPath = "CNB_BP_PLAN_PATH" // EnvLayersDir is the absolute path of the buildpack layers directory (read-write); a different copy is provided for each buildpack; // contents may be saved to either or both of: the final output image or the cache EnvLayersDir = "CNB_LAYERS_DIR" )
View Source
const ( KindBuildpack = "Buildpack" KindExtension = "Extension" )
View Source
const ( // EnvBuildPlanPath is the absolute path of the build plan; a different copy is provided for each buildpack EnvBuildPlanPath = "CNB_BUILD_PLAN_PATH" // EnvBuildpackDir is the absolute path of the buildpack root directory (read-only) EnvBuildpackDir = "CNB_BUILDPACK_DIR" // EnvExtensionDir is the absolute path of the extension root directory (read-only) EnvExtensionDir = "CNB_EXTENSION_DIR" // EnvPlatformDir is the absolute path of the platform directory (read-only); a single copy is provided for all buildpacks EnvPlatformDir = "CNB_PLATFORM_DIR" )
View Source
const ( DockerfileKindBuild = "build" DockerfileKindRun = "run" )
View Source
const ( // EnvOutputDir is the absolute path of the extension output directory (read-write); a different copy is provided for each extension; // contents are copied to the generator's <generated> directory EnvOutputDir = "CNB_OUTPUT_DIR" )
Variables ¶
This section is empty.
Functions ¶
func DecodeLaunchTOML ¶ added in v0.15.0
func DecodeLaunchTOML(launchPath string, bpAPI string, launchTOML *LaunchTOML) error
DecodeLaunchTOML reads a launch.toml file
func EncodeLayerMetadataFile ¶
func EncodeLayerMetadataFile(lmf LayerMetadataFile, path, buildpackAPI string) error
func MadeCached ¶ added in v0.13.1
func MadeLaunch ¶ added in v0.13.1
func RetrieveFirstFromImageNameFromDockerfile ¶ added in v0.15.0
func VerifyBuildDockerfile ¶ added in v0.15.0
func VerifyRunDockerfile ¶ added in v0.15.0
Types ¶
type BOMEntry ¶
type BOMEntry struct { Require Buildpack GroupElement `toml:"buildpack" json:"buildpack"` }
func WithBuildpack ¶
func WithBuildpack(bp GroupElement, bom []BOMEntry) []BOMEntry
func (*BOMEntry) ConvertMetadataToVersion ¶
func (bom *BOMEntry) ConvertMetadataToVersion()
type BOMFile ¶ added in v0.13.0
func (*BOMFile) Name ¶ added in v0.13.0
Name() returns the destination filename for a given BOM file cdx files should be renamed to "sbom.cdx.json" spdx files should be renamed to "sbom.spdx.json" syft files should be renamed to "sbom.syft.json" If the BOM is neither cdx, spdx, nor syft, the 2nd return argument will return an error to indicate an unsupported format
type BOMValidator ¶ added in v0.13.0
type BOMValidator interface {
ValidateBOM(GroupElement, []BOMEntry) ([]BOMEntry, error)
}
func NewBOMValidator ¶ added in v0.13.0
func NewBOMValidator(bpAPI string, layersDir string, logger log.Logger) BOMValidator
type BpDescriptor ¶ added in v0.15.0
type BpDescriptor struct { WithAPI string `toml:"api"` Buildpack BpInfo `toml:"buildpack"` Order Order `toml:"order"` WithRootDir string `toml:"-"` }
func ReadBpDescriptor ¶ added in v0.15.0
func ReadBpDescriptor(path string) (*BpDescriptor, error)
func (*BpDescriptor) API ¶ added in v0.15.0
func (d *BpDescriptor) API() string
func (*BpDescriptor) ClearEnv ¶ added in v0.15.0
func (d *BpDescriptor) ClearEnv() bool
func (*BpDescriptor) Homepage ¶ added in v0.15.0
func (d *BpDescriptor) Homepage() string
func (*BpDescriptor) RootDir ¶ added in v0.15.0
func (d *BpDescriptor) RootDir() string
func (*BpDescriptor) String ¶ added in v0.15.0
func (d *BpDescriptor) String() string
type BuildExecutor ¶ added in v0.15.0
type BuildExecutor interface {
Build(d BpDescriptor, inputs BuildInputs, logger log.Logger) (BuildOutputs, error)
}
type BuildInputs ¶ added in v0.15.0
type BuildOutputs ¶ added in v0.15.0
type BuildPlan ¶
type BuildPlan struct { PlanSections Or planSectionsList `toml:"or"` }
type DefaultBuildExecutor ¶ added in v0.15.0
type DefaultBuildExecutor struct{}
func (*DefaultBuildExecutor) Build ¶ added in v0.15.0
func (e *DefaultBuildExecutor) Build(d BpDescriptor, inputs BuildInputs, logger log.Logger) (BuildOutputs, error)
type DefaultDetectExecutor ¶ added in v0.15.0
type DefaultDetectExecutor struct{}
func (*DefaultDetectExecutor) Detect ¶ added in v0.15.0
func (e *DefaultDetectExecutor) Detect(d Descriptor, inputs DetectInputs, logger log.Logger) DetectOutputs
type DefaultGenerateExecutor ¶ added in v0.15.0
type DefaultGenerateExecutor struct{}
func (*DefaultGenerateExecutor) Generate ¶ added in v0.15.0
func (e *DefaultGenerateExecutor) Generate(d ExtDescriptor, inputs GenerateInputs, logger log.Logger) (GenerateOutputs, error)
type Descriptor ¶
type DetectExecutor ¶ added in v0.15.0
type DetectExecutor interface {
Detect(d Descriptor, inputs DetectInputs, logger log.Logger) DetectOutputs
}
type DetectInputs ¶ added in v0.15.0
type DetectOutputs ¶ added in v0.15.0
type DockerfileInfo ¶ added in v0.15.0
type ErrorType ¶
type ErrorType string
const ErrTypeBuildpack ErrorType = "ERR_BUILDPACK"
const ErrTypeFailedDetection ErrorType = "ERR_FAILED_DETECTION"
type ExtDescriptor ¶ added in v0.15.0
type ExtDescriptor struct { WithAPI string `toml:"api"` Extension ExtInfo `toml:"extension"` WithRootDir string `toml:"-"` }
func ReadExtDescriptor ¶ added in v0.15.0
func ReadExtDescriptor(path string) (*ExtDescriptor, error)
func (*ExtDescriptor) API ¶ added in v0.15.0
func (d *ExtDescriptor) API() string
func (*ExtDescriptor) ClearEnv ¶ added in v0.15.0
func (d *ExtDescriptor) ClearEnv() bool
func (*ExtDescriptor) Homepage ¶ added in v0.15.0
func (d *ExtDescriptor) Homepage() string
func (*ExtDescriptor) RootDir ¶ added in v0.15.0
func (d *ExtDescriptor) RootDir() string
func (*ExtDescriptor) String ¶ added in v0.15.0
func (d *ExtDescriptor) String() string
type ExtendBuildConfig ¶ added in v0.15.0
type ExtendBuildConfig struct {
Args []ExtendArg `toml:"args"`
}
type ExtendConfig ¶ added in v0.15.0
type ExtendConfig struct {
Build ExtendBuildConfig `toml:"build"`
}
type GenerateExecutor ¶ added in v0.15.0
type GenerateExecutor interface {
Generate(d ExtDescriptor, inputs GenerateInputs, logger log.Logger) (GenerateOutputs, error)
}
type GenerateInputs ¶ added in v0.15.0
type GenerateOutputs ¶ added in v0.15.0
type GenerateOutputs struct { Dockerfiles []DockerfileInfo MetRequires []string }
type Group ¶
type Group struct { Group []GroupElement `toml:"group"` GroupExtensions []GroupElement `toml:"group-extensions,omitempty" json:"group-extensions,omitempty"` }
func (Group) HasExtensions ¶ added in v0.15.0
type GroupElement ¶ added in v0.15.0
type GroupElement struct { // ID specifies the ID of the buildpack or extension. ID string `toml:"id" json:"id"` // Version specifies the version of the buildpack or extension. Version string `toml:"version" json:"version"` // API specifies the Buildpack API that the buildpack or extension implements. API string `toml:"api,omitempty" json:"-"` // Homepage specifies the homepage of the buildpack or extension. Homepage string `toml:"homepage,omitempty" json:"homepage,omitempty"` // Extension specifies whether the group element is a buildpack or an extension. Extension bool `toml:"extension,omitempty" json:"-"` // Optional specifies that the buildpack or extension is optional. Extensions are always optional. Optional bool `toml:"optional,omitempty" json:"optional,omitempty"` // OrderExtensions holds the order for extensions during the detect phase. OrderExtensions Order `toml:"-" json:"-"` }
A GroupElement represents a buildpack referenced in a buildpack.toml's [[order.group]] OR a buildpack or extension in order.toml OR a buildpack or extension in group.toml.
func (GroupElement) Equals ¶ added in v0.15.0
func (e GroupElement) Equals(o GroupElement) bool
func (GroupElement) IsExtensionsOrder ¶ added in v0.15.0
func (e GroupElement) IsExtensionsOrder() bool
func (GroupElement) Kind ¶ added in v0.15.0
func (e GroupElement) Kind() string
func (GroupElement) NoAPI ¶ added in v0.15.0
func (e GroupElement) NoAPI() GroupElement
func (GroupElement) NoExtension ¶ added in v0.15.0
func (e GroupElement) NoExtension() GroupElement
func (GroupElement) NoHomepage ¶ added in v0.15.0
func (e GroupElement) NoHomepage() GroupElement
func (GroupElement) NoOpt ¶ added in v0.15.0
func (e GroupElement) NoOpt() GroupElement
func (GroupElement) String ¶ added in v0.15.0
func (e GroupElement) String() string
func (GroupElement) WithAPI ¶ added in v0.15.0
func (e GroupElement) WithAPI(version string) GroupElement
func (GroupElement) WithHomepage ¶ added in v0.15.0
func (e GroupElement) WithHomepage(address string) GroupElement
type LaunchTOML ¶
type LaunchTOML struct { BOM []BOMEntry Labels []Label Processes []ProcessEntry `toml:"processes"` Slices []layers.Slice `toml:"slices"` }
func (LaunchTOML) ToLaunchProcessesForBuildpack ¶ added in v0.15.0
func (lt LaunchTOML) ToLaunchProcessesForBuildpack(bpID string) []launch.Process
converts launch.toml processes to launch.Processes
type Layer ¶ added in v0.13.1
type Layer struct {
// contains filtered or unexported fields
}
func (*Layer) HasLocalContents ¶ added in v0.13.1
func (*Layer) Identifier ¶ added in v0.13.1
func (*Layer) Read ¶ added in v0.13.1
func (l *Layer) Read() (LayerMetadata, error)
func (*Layer) WriteMetadata ¶ added in v0.13.1
func (l *Layer) WriteMetadata(metadata LayerMetadataFile) error
type LayerMetadata ¶ added in v0.13.1
type LayerMetadata struct { SHA string `json:"sha" toml:"sha"` LayerMetadataFile }
type LayerMetadataFile ¶ added in v0.13.1
type LayerMetadataFile struct { Data interface{} `json:"data" toml:"metadata"` Build bool `json:"build" toml:"build"` Launch bool `json:"launch" toml:"launch"` Cache bool `json:"cache" toml:"cache"` }
func DecodeLayerMetadataFile ¶
func DecodeLayerMetadataFile(path, buildpackAPI string) (LayerMetadataFile, string, error)
type LayersDir ¶ added in v0.13.1
type LayersDir struct { Path string Buildpack GroupElement Store *StoreTOML // contains filtered or unexported fields }
func ReadLayersDir ¶ added in v0.13.1
func (*LayersDir) FindLayers ¶ added in v0.13.1
type LayersMetadata ¶ added in v0.13.1
type LayersMetadata struct { ID string `json:"key" toml:"key"` Version string `json:"version" toml:"version"` Layers map[string]LayerMetadata `json:"layers" toml:"layers"` Store *StoreTOML `json:"store,omitempty" toml:"store"` }
type PlanSections ¶
type ProcessEntry ¶ added in v0.15.0
type ProcessEntry struct { Type string `toml:"type" json:"type"` Command []string `toml:"-"` // ignored RawCommandValue toml.Primitive `toml:"command" json:"command"` Args []string `toml:"args" json:"args"` Direct *bool `toml:"direct" json:"direct"` Default bool `toml:"default,omitempty" json:"default,omitempty"` WorkingDirectory string `toml:"working-dir,omitempty" json:"working-dir,omitempty"` }
func (*ProcessEntry) ToLaunchProcess ¶ added in v0.15.0
func (p *ProcessEntry) ToLaunchProcess(bpID string) launch.Process
ToLaunchProcess converts a buildpack.ProcessEntry to a launch.Process
type Require ¶
type Require struct { Name string `toml:"name" json:"name"` Version string `toml:"version,omitempty" json:"version,omitempty"` Metadata map[string]interface{} `toml:"metadata" json:"metadata"` }
func (*Require) ConvertVersionToMetadata ¶
func (r *Require) ConvertVersionToMetadata()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.