Documentation
¶
Index ¶
- Constants
- func CopyDirectory(srcDir, destDir string) error
- func CopyFile(source, destFile string) error
- func ExtractTarGz(tarFile, destDir string, stripComponents int) error
- func ExtractZip(zipfile, destDir string, stripComponents int) error
- func FileExists(file string) (bool, error)
- func FromTomlFile(file string, v interface{}) error
- func WriteToFile(source io.Reader, destFile string, mode os.FileMode) error
- type DependencyLayer
- type DependencyLayerContributor
- type DownloadLayer
- type Flag
- type Layer
- func (l Layer) AppendBuildEnv(name string, format string, args ...interface{}) error
- func (l Layer) AppendLaunchEnv(name string, format string, args ...interface{}) error
- func (l Layer) AppendPathBuildEnv(name string, format string, args ...interface{}) error
- func (l Layer) AppendPathLaunchEnv(name string, format string, args ...interface{}) error
- func (l Layer) AppendPathSharedEnv(name string, format string, args ...interface{}) error
- func (l Layer) AppendSharedEnv(name string, format string, args ...interface{}) error
- func (l Layer) Contribute(expected logger.Identifiable, contributor LayerContributor, flags ...Flag) error
- func (l Layer) MetadataMatches(expected interface{}) (bool, error)
- func (l Layer) OverrideBuildEnv(name string, format string, args ...interface{}) error
- func (l Layer) OverrideLaunchEnv(name string, format string, args ...interface{}) error
- func (l Layer) OverrideSharedEnv(name string, format string, args ...interface{}) error
- func (l Layer) String() string
- func (l Layer) WriteProfile(file string, format string, args ...interface{}) error
- type LayerContributor
- type Layers
- type Metadata
- type Process
- type Processes
- type TouchedLayers
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func CopyDirectory ¶
CopyDirectory copies srcDir to destDir
func CopyFile ¶
CopyFile copies source file to destFile, creating all intermediate directories in destFile
func ExtractTarGz ¶
ExtractTarGz extracts tarfile to destDir
func ExtractZip ¶
ExtractZip extracts zipfile to destDir
func FileExists ¶
FileExists returns true if a file exists, otherwise false.
func FromTomlFile ¶
FromTomlFile decodes a TOML file into a struct.
Types ¶
type DependencyLayer ¶
type DependencyLayer struct {
Layer
// Dependency is the dependency provided by this layer
Dependency buildpack.Dependency
// Logger is used to write debug and info to the console.
Logger logger.Logger
// contains filtered or unexported fields
}
DependencyLayer is an extension to Layer that is unique to a dependency.
func (DependencyLayer) ArtifactName ¶
func (l DependencyLayer) ArtifactName() string
ArtifactName returns the name portion of the download path for the dependency.
func (DependencyLayer) Contribute ¶
func (l DependencyLayer) Contribute(contributor DependencyLayerContributor, flags ...Flag) error
Contribute facilitates custom contribution of an artifact to a layer. If the artifact has already been contributed, the contribution is validated and the contributor is not called.
func (DependencyLayer) String ¶
func (l DependencyLayer) String() string
String makes DependencyLayer satisfy the Stringer interface.
type DependencyLayerContributor ¶
type DependencyLayerContributor func(artifact string, layer DependencyLayer) error
DependencyLayerContributor defines a callback function that is called when a dependency needs to be contributed.
type DownloadLayer ¶
type DownloadLayer struct {
Layer
// contains filtered or unexported fields
}
DownloadLayer is an extension to Layer that is unique to a dependency download.
func (DownloadLayer) Artifact ¶
func (l DownloadLayer) Artifact() (string, error)
Artifact returns the path to an artifact cached in the layer. If the artifact has already been downloaded, the cache will be validated and used directly.
func (DownloadLayer) String ¶
func (l DownloadLayer) String() string
String makes DownloadLayer satisfy the Stringer interface.
type Layer ¶
type Layer struct {
layers.Layer
// Logger is used to write debug and info to the console.
Logger logger.Logger
// TouchedLayers registers the layers that have been touched during this execution.
TouchedLayers TouchedLayers
}
LaunchLayer is an extension to libbuildpack.LaunchLayer that allows additional functionality to be added
func (Layer) AppendBuildEnv ¶
AppendBuildEnv appends the value of this environment variable to any previous declarations of the value without any delimitation. If delimitation is important during concatenation, callers are required to add it.
func (Layer) AppendLaunchEnv ¶
AppendLaunchEnv appends the value of this environment variable to any previous declarations of the value without any delimitation. If delimitation is important during concatenation, callers are required to add it.
func (Layer) AppendPathBuildEnv ¶
AppendPathBuildEnv appends the value of this environment variable to any previous declarations of the value using the OS path delimiter.
func (Layer) AppendPathLaunchEnv ¶
AppendPathLaunchEnv appends the value of this environment variable to any previous declarations of the value using the OS path delimiter.
func (Layer) AppendPathSharedEnv ¶
AppendPathSharedEnv appends the value of this environment variable to any previous declarations of the value using the OS path delimiter.
func (Layer) AppendSharedEnv ¶
AppendSharedEnv appends the value of this environment variable to any previous declarations of the value without any delimitation. If delimitation is important during concatenation, callers are required to add it.
func (Layer) Contribute ¶
func (l Layer) Contribute(expected logger.Identifiable, contributor LayerContributor, flags ...Flag) error
Contribute facilitates custom contribution of a layer. If the layer has already been contributed, the contribution is validated and the contributor is not called.
func (Layer) MetadataMatches ¶
MetadataMatches compares the expected metadata for the actual metadata of this layer.
func (Layer) OverrideBuildEnv ¶
OverrideBuildEnv overrides any existing value for an environment variable with this value.
func (Layer) OverrideLaunchEnv ¶
OverrideLaunchEnv overrides any existing value for an environment variable with this value.
func (Layer) OverrideSharedEnv ¶
OverrideSharedEnv overrides any existing value for an environment variable with this value.
type LayerContributor ¶
LayerContributor defines a callback function that is called when a layer needs to be contributed.
type Layers ¶
type Layers struct {
layers.Layers
// BuildpackCacheRoot is the root of the cache of dependencies in the buildpack.
BuildpackCache layers.Layers
// DependencyBuildPlans contains all contributed dependencies.
DependencyBuildPlans buildplan.BuildPlan
// Logger logger is used to write debug and info to the console.
Logger logger.Logger
// TouchedLayers registers the layers that have been touched during this execution.
TouchedLayers TouchedLayers
}
Layers is an extension allows additional functionality to be added.
func (Layers) DependencyLayer ¶
func (l Layers) DependencyLayer(dependency buildpack.Dependency) DependencyLayer
DependencyLayer returns a DependencyLayer unique to a dependency.
func (Layers) DownloadLayer ¶
func (l Layers) DownloadLayer(dependency buildpack.Dependency) DownloadLayer
DownloadLayer returns a DownloadLayer unique to a dependency.
func (Layers) WriteMetadata ¶
WriteMetadata writes Launch metadata to the filesystem.
type TouchedLayers ¶ added in v1.26.0
type TouchedLayers struct {
// Logger logger is used to write debug and info to the console.
Logger logger.Logger
// Root is the root location of all layers to inspect for unused layers.
Root string
// Touched is the set of layers that have been touched
Touched map[string]struct{}
}
TouchedLayers contains information about the layers that have been touched as part of this execution.
func NewTouchedLayers ¶ added in v1.26.0
func NewTouchedLayers(root string, logger logger.Logger) TouchedLayers
func (TouchedLayers) Add ¶ added in v1.26.0
func (t TouchedLayers) Add(metadata string)
Add registers that a given layer has been touched
func (TouchedLayers) Cleanup ¶ added in v1.26.0
func (t TouchedLayers) Cleanup() error
Cleanup removes all layers that have not been touched as part of this execution.
func (TouchedLayers) String ¶ added in v1.26.0
func (t TouchedLayers) String() string
String makes TouchedLayers satisfy the Stringer interface.