Documentation ¶
Index ¶
- Constants
- func EncodeLayerMetadataFile(lmf LayerMetadataFile, path, buildpackAPI string) error
- func MadeCached(l Layer) bool
- func MadeLaunch(l Layer) bool
- func Malformed(l Layer) bool
- type BOMEntry
- type BOMFile
- type BOMValidator
- type BuildConfig
- type BuildEnv
- type BuildPlan
- type BuildResult
- type BuildTOML
- type Buildpack
- type Descriptor
- type DetectConfig
- type DetectRun
- type DirBuildpackStore
- type Error
- type ErrorType
- type Group
- type GroupBuildpack
- type Info
- 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 Logger
- type Order
- type Plan
- type PlanSections
- type Provide
- type Require
- type StoreTOML
- type Unmet
Constants ¶
View Source
const ( EnvLayersDir = "CNB_LAYERS_DIR" EnvBpPlanPath = "CNB_BP_PLAN_PATH" )
View Source
const ( EnvBuildpackDir = "CNB_BUILDPACK_DIR" EnvPlatformDir = "CNB_PLATFORM_DIR" EnvBuildPlanPath = "CNB_BUILD_PLAN_PATH" )
Variables ¶
This section is empty.
Functions ¶
func EncodeLayerMetadataFile ¶
func EncodeLayerMetadataFile(lmf LayerMetadataFile, path, buildpackAPI string) error
func MadeCached ¶ added in v0.13.1
func MadeLaunch ¶ added in v0.13.1
Types ¶
type BOMEntry ¶
type BOMEntry struct { Require Buildpack GroupBuildpack `toml:"buildpack" json:"buildpack"` }
func WithBuildpack ¶
func WithBuildpack(bp GroupBuildpack, 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(GroupBuildpack, []BOMEntry) ([]BOMEntry, error)
}
func NewBOMValidator ¶ added in v0.13.0
func NewBOMValidator(bpAPI string, layersDir string, logger Logger) BOMValidator
type BuildConfig ¶
type BuildPlan ¶
type BuildPlan struct { PlanSections Or planSectionsList `toml:"or"` }
type BuildResult ¶
type Buildpack ¶
type Buildpack interface { Build(bpPlan Plan, config BuildConfig, bpEnv BuildEnv) (BuildResult, error) ConfigFile() *Descriptor Detect(config *DetectConfig, bpEnv BuildEnv) DetectRun }
type Descriptor ¶
type Descriptor struct { API string `toml:"api"` Buildpack Info `toml:"buildpack"` Order Order `toml:"order"` Dir string `toml:"-"` }
func (*Descriptor) Build ¶
func (b *Descriptor) Build(bpPlan Plan, config BuildConfig, bpEnv BuildEnv) (BuildResult, error)
func (*Descriptor) ConfigFile ¶
func (b *Descriptor) ConfigFile() *Descriptor
func (*Descriptor) Detect ¶
func (b *Descriptor) Detect(config *DetectConfig, bpEnv BuildEnv) DetectRun
func (*Descriptor) IsMetaBuildpack ¶
func (b *Descriptor) IsMetaBuildpack() bool
func (*Descriptor) String ¶
func (b *Descriptor) String() string
type DetectConfig ¶
type DirBuildpackStore ¶
type DirBuildpackStore struct {
Dir string
}
func NewBuildpackStore ¶
func NewBuildpackStore(dir string) (*DirBuildpackStore, error)
type ErrorType ¶
type ErrorType string
const ErrTypeBuildpack ErrorType = "ERR_BUILDPACK"
const ErrTypeFailedDetection ErrorType = "ERR_FAILED_DETECTION"
type Group ¶
type Group struct {
Group []GroupBuildpack `toml:"group"`
}
type GroupBuildpack ¶
type GroupBuildpack struct { API string `toml:"api,omitempty" json:"-"` Homepage string `toml:"homepage,omitempty" json:"homepage,omitempty"` ID string `toml:"id" json:"id"` Optional bool `toml:"optional,omitempty" json:"optional,omitempty"` Version string `toml:"version" json:"version"` }
A GroupBuildpack represents a buildpack referenced in a buildpack.toml's [[order.group]]. It may be a regular buildpack, or a meta buildpack.
func (GroupBuildpack) NoAPI ¶
func (bp GroupBuildpack) NoAPI() GroupBuildpack
func (GroupBuildpack) NoHomepage ¶
func (bp GroupBuildpack) NoHomepage() GroupBuildpack
func (GroupBuildpack) NoOpt ¶
func (bp GroupBuildpack) NoOpt() GroupBuildpack
func (GroupBuildpack) String ¶
func (bp GroupBuildpack) String() string
type LaunchTOML ¶
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 GroupBuildpack Store *StoreTOML // contains filtered or unexported fields }
func ReadLayersDir ¶ added in v0.13.1
func ReadLayersDir(layersDir string, bp GroupBuildpack, logger Logger) (LayersDir, error)
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 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.