layers

package
v1.91.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 21 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// Build indicates that a layer should be used for builds
	Build = layers.Build

	// Cache indicates that a layer should be cached
	Cache = layers.Cache

	// Launch indicates that a layer should be used for launch
	Launch = layers.Launch
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyLayer

type DependencyLayer struct {
	Layer

	// Dependency is the dependency provided by this layer.
	Dependency buildpack.Dependency
	// 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. If the contribution is out of date, the layer is completely removed before contribution occurs.

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. If the artifact is out of date, the layer is left untouched and the contributor is responsible for cleaning the layer if necessary.

type Flag

type Flag = layers.Flag

type HelperLayer added in v1.45.0

type HelperLayer struct {
	Layer

	// ID is the id of the buildpack provided helper.
	ID string
	// contains filtered or unexported fields
}

HelperLayer is an extension to Layer that is unique to a buildpack provided helper.

func (HelperLayer) Contribute added in v1.45.0

func (l HelperLayer) Contribute(contributor HelperLayerContributor, flags ...Flag) error

Contribute facilitates custom contribution of a buildpack provided helper to a layer. If the artifact has already been contributed, the contribution is validated and the contributor is not called. If the contribution is out of date, the layer is completely removed before contribution occurs.

type HelperLayerContributor added in v1.45.0

type HelperLayerContributor func(artifact string, layer HelperLayer) error

HelperLayerContributor defines a callback function that is called when a buildpack provided helper needs to be contributed.

type Layer

type Layer struct {
	layers.Layer

	// Logger is used to write debug and info to the console.
	Logger logger.Logger
	// contains filtered or unexported fields
}

LaunchLayer is an extension to libbuildpack.LaunchLayer that allows additional functionality to be added

func (Layer) AppendBuildEnv

func (l Layer) AppendBuildEnv(name string, format string, args ...interface{}) error

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

func (l Layer) AppendLaunchEnv(name string, format string, args ...interface{}) error

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 deprecated

func (l Layer) AppendPathBuildEnv(name string, format string, args ...interface{}) error

AppendPathBuildEnv appends the value of this environment variable to any previous declarations of the value using the OS path delimiter.

Deprecated: Use PrependPathBuildEnv

func (Layer) AppendPathLaunchEnv deprecated

func (l Layer) AppendPathLaunchEnv(name string, format string, args ...interface{}) error

AppendPathLaunchEnv appends the value of this environment variable to any previous declarations of the value using the OS path delimiter.

Deprecated: Use PrependPathLaunchEnv

func (Layer) AppendPathSharedEnv deprecated

func (l Layer) AppendPathSharedEnv(name string, format string, args ...interface{}) error

AppendPathSharedEnv appends the value of this environment variable to any previous declarations of the value using the OS path delimiter.

Deprecated: Use PrependPathSharedEnv

func (Layer) AppendSharedEnv

func (l Layer) AppendSharedEnv(name string, format string, args ...interface{}) error

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. If the contribution is out of date, the layer is // completely removed before contribution occurs.

func (Layer) DefaultBuildEnv added in v1.89.2

func (l Layer) DefaultBuildEnv(name string, format string, args ...interface{}) error

DefaultBuildEnv sets a default for an environment variable with this value.

func (Layer) DefaultLaunchEnv added in v1.89.2

func (l Layer) DefaultLaunchEnv(name string, format string, args ...interface{}) error

DefaultLaunchEnv sets a default for an environment variable with this value.

func (Layer) DefaultSharedEnv added in v1.89.2

func (l Layer) DefaultSharedEnv(name string, format string, args ...interface{}) error

DefaultSharedEnv sets a default for an environment variable with this value.

func (Layer) DelimiterBuildEnv added in v1.89.2

func (l Layer) DelimiterBuildEnv(name string, delimiter string) error

DelimiterBuildEnv sets a delimiter for an environment variable with this value.

func (Layer) DelimiterLaunchEnv added in v1.89.2

func (l Layer) DelimiterLaunchEnv(name string, delimiter string) error

DelimiterLaunchEnv sets a delimiter for an environment variable with this value.

func (Layer) DelimiterSharedEnv added in v1.89.2

func (l Layer) DelimiterSharedEnv(name string, delimiter string) error

DelimiterSharedEnv sets a delimiter for an environment variable with this value.

func (Layer) MetadataMatches

func (l Layer) MetadataMatches(expected interface{}) (bool, error)

MetadataMatches compares the expected metadata for the actual metadata of this layer.

func (Layer) OverrideBuildEnv

func (l Layer) OverrideBuildEnv(name string, format string, args ...interface{}) error

OverrideBuildEnv overrides any existing value for an environment variable with this value.

func (Layer) OverrideLaunchEnv

func (l Layer) OverrideLaunchEnv(name string, format string, args ...interface{}) error

OverrideLaunchEnv overrides any existing value for an environment variable with this value.

func (Layer) OverrideSharedEnv

func (l Layer) OverrideSharedEnv(name string, format string, args ...interface{}) error

OverrideSharedEnv overrides any existing value for an environment variable with this value.

func (Layer) PrependBuildEnv added in v1.89.2

func (l Layer) PrependBuildEnv(name string, format string, args ...interface{}) error

PrependBuildEnv prepends 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) PrependLaunchEnv added in v1.89.2

func (l Layer) PrependLaunchEnv(name string, format string, args ...interface{}) error

PrependLaunchEnv prepends 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) PrependPathBuildEnv added in v1.89.2

func (l Layer) PrependPathBuildEnv(name string, format string, args ...interface{}) error

PrependPathBuildEnv prepends the value of this environment variable to any previous declarations of the value using the OS path delimiter.

func (Layer) PrependPathLaunchEnv added in v1.89.2

func (l Layer) PrependPathLaunchEnv(name string, format string, args ...interface{}) error

PrependPathLaunchEnv prepends the value of this environment variable to any previous declarations of the value using the OS path delimiter.

func (Layer) PrependPathSharedEnv added in v1.89.2

func (l Layer) PrependPathSharedEnv(name string, format string, args ...interface{}) error

PrependPathSharedEnv prepends the value of this environment variable to any previous declarations of the value using the OS path delimiter.

func (Layer) PrependSharedEnv added in v1.89.2

func (l Layer) PrependSharedEnv(name string, format string, args ...interface{}) error

PrependSharedEnv prepends 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) Touch added in v1.30.0

func (l Layer) Touch()

Touch touches a layer, indicating that it was used and should not be removed.

func (Layer) WriteProfile

func (l Layer) WriteProfile(file string, format string, args ...interface{}) error

WriteProfile writes a file to profile.d with this value.

type LayerContributor

type LayerContributor func(layer Layer) error

LayerContributor defines a callback function that is called when a layer needs to be contributed.

type Layers

type Layers struct {
	layers.Layers

	// Plans contains all contributed dependencies.
	Plans *buildpackplan.Plans

	// TouchedLayers registers the layers that have been touched during this execution.
	TouchedLayers TouchedLayers
	// contains filtered or unexported fields
}

Layers is an extension allows additional functionality to be added.

func NewLayers added in v1.28.0

func NewLayers(layers layers.Layers, buildpackCache layers.Layers, buildpack buildpack.Buildpack, logger logger.Logger) Layers

NewLayers creates a new instance of Layers.

func (Layers) DependencyLayer

func (l Layers) DependencyLayer(dependency buildpack.Dependency) DependencyLayer

DependencyLayer returns a DependencyLayer unique to a dependency.

func (Layers) DependencyLayerWithID added in v1.87.1

func (l Layers) DependencyLayerWithID(id string, dependency buildpack.Dependency) DependencyLayer

DependencyLayerWithID returns a DependencyLayer unique to a dependency with an explicit id.

func (Layers) DownloadLayer

func (l Layers) DownloadLayer(dependency buildpack.Dependency) DownloadLayer

DownloadLayer returns a DownloadLayer unique to a dependency.

func (Layers) HelperLayer added in v1.45.0

func (l Layers) HelperLayer(id string, name string) HelperLayer

HelperLayer returns a HelperLayer unique to a buildpack provided dependency.

func (Layers) Layer

func (l Layers) Layer(name string) Layer

Layer creates a Layer with a specified name.

func (Layers) MultiDependencyLayer added in v1.64.0

func (l Layers) MultiDependencyLayer(id string, dependencies ...buildpack.Dependency) MultiDependencyLayer

MultiDependencyLayer returns a MultiDependencyLayer unique to a collection of dependencies.

func (Layers) WriteApplicationMetadata added in v1.45.0

func (l Layers) WriteApplicationMetadata(metadata Metadata) error

WriteApplicationMetadata writes application metadata to the filesystem.

func (Layers) WritePersistentMetadata added in v1.45.0

func (l Layers) WritePersistentMetadata(metadata interface{}) error

WritePersistentMetadata writes persistent metadata to the filesystem.

type Metadata

type Metadata = layers.Metadata

type MultiDependencyLayer added in v1.64.0

type MultiDependencyLayer struct {
	Layer

	// Dependencies are the dependencies provided by this layer.
	Dependencies []buildpack.Dependency
	// contains filtered or unexported fields
}

MultiDependencyLayer is an extension to Layer that is unique to a collection of dependencies.

func (MultiDependencyLayer) Contribute added in v1.64.0

func (l MultiDependencyLayer) Contribute(contributors map[string]MultiDependencyLayerContributor, flags ...Flag) error

type MultiDependencyLayerContributor added in v1.64.0

type MultiDependencyLayerContributor func(artifact string, layer MultiDependencyLayer) error

MultiDependencyLayerContributor defines a callback function that is called when a dependency needs to be contributed.

type Process

type Process = layers.Process

type Processes

type Processes = layers.Processes

type Slice added in v1.45.0

type Slice = layers.Slice

type Slices added in v1.45.0

type Slices = layers.Slices

type TouchedLayers added in v1.26.0

type TouchedLayers struct {
	// Root is the root location of all layers to inspect for unused layers.
	Root string
	// contains filtered or unexported fields
}

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

NewTouchedLayers creates a new instance that monitors a given root.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL