Documentation ¶
Index ¶
- Constants
- func Build(build BuildFunc, config Config)
- func BuildpackMain(detect DetectFunc, build BuildFunc, options ...Option)
- func Detect(detect DetectFunc, config Config)
- func ExtensionMain(detect DetectFunc, generate GenerateFunc, options ...Option)
- func Generate(generate GenerateFunc, config Config)
- func RunExecD(execDMap map[string]ExecD, options ...Option)
- type Binding
- type Bindings
- type BuildConfig
- type BuildContext
- type BuildFunc
- type BuildPlan
- type BuildPlanProvide
- type BuildPlanRequire
- type BuildPlans
- type BuildResult
- type BuildTOML
- type Buildpack
- type BuildpackInfo
- type BuildpackOrder
- type BuildpackOrderBuildpack
- type BuildpackPlan
- type BuildpackPlanEntry
- type BuildpackStackdeprecated
- type Config
- type DetectContext
- type DetectFunc
- type DetectResult
- type DockerfileArg
- type Environment
- func (e Environment) Append(name string, delimiter string, a ...interface{})
- func (e Environment) Appendf(name string, delimiter string, format string, a ...interface{})
- func (e Environment) Default(name string, a ...interface{})
- func (e Environment) Defaultf(name string, format string, a ...interface{})
- func (e Environment) Override(name string, a ...interface{})
- func (e Environment) Overridef(name string, format string, a ...interface{})
- func (e Environment) Prepend(name string, delimiter string, a ...interface{})
- func (e Environment) Prependf(name string, delimiter string, format string, a ...interface{})
- func (e Environment) ProcessAppend(processType string, name string, delimiter string, a ...interface{})
- func (e Environment) ProcessAppendf(processType string, name string, delimiter string, format string, ...)
- func (e Environment) ProcessDefault(processType string, name string, a ...interface{})
- func (e Environment) ProcessDefaultf(processType string, name string, format string, a ...interface{})
- func (e Environment) ProcessOverride(processType string, name string, a ...interface{})
- func (e Environment) ProcessOverridef(processType string, name string, format string, a ...interface{})
- func (e Environment) ProcessPrepend(processType string, name string, delimiter string, a ...interface{})
- func (e Environment) ProcessPrependf(processType string, name string, delimiter string, format string, ...)
- type EnvironmentWriter
- type Exec
- type ExecD
- type ExecDWriter
- type ExitHandler
- type ExtendConfig
- type Extension
- type ExtensionInfo
- type GenerateContext
- type GenerateFunc
- type GenerateResult
- type Label
- type LaunchTOML
- type Layer
- type LayerTypes
- type Layers
- type License
- type Option
- func WithArguments(arguments []string) Option
- func WithDirectoryContentFormatter(formatter log.DirectoryContentFormatter) Option
- func WithEnvironmentWriter(environmentWriter EnvironmentWriter) Option
- func WithExecDWriter(execdWriter ExecDWriter) Option
- func WithExitHandler(exitHandler ExitHandler) Option
- func WithLogger(logger log.Logger) Option
- func WithTOMLWriter(tomlWriter TOMLWriter) Option
- type Platform
- type Process
- type SBOMFormat
- type Slice
- type Store
- type TOMLWriter
- type Target
- type TargetDistro
- type TargetInfo
- type UnmetPlanEntry
Constants ¶
const ( // MinSupportedBPVersion indicates the minium supported version of the Buildpacks API MinSupportedBPVersion = "0.8" // MaxSupportedBPVersion indicates the maximum supported version of the Buildpacks API MaxSupportedBPVersion = "0.10" )
Constants to track minimum and maximum supported Buildpack API versions
const ( BOMFormatCycloneDXExtension = "cdx.json" BOMFormatSPDXExtension = "spdx.json" BOMFormatSyftExtension = "syft.json" BOMMediaTypeCycloneDX = "application/vnd.cyclonedx+json" BOMMediaTypeSPDX = "application/spdx+json" BOMMediaTypeSyft = "application/vnd.syft+json" BOMUnknown = "unknown" )
const ( // BindingProvider is the key for a binding's provider. BindingProvider = "provider" // BindingType is the key for a binding's type. BindingType = "type" // EnvServiceBindings is the name of the environment variable that contains the path to service bindings directory. // // See the Service Binding Specification for Kubernetes for more details - https://k8s-service-bindings.github.io/spec/ EnvServiceBindings = "SERVICE_BINDING_ROOT" // EnvBuildpackDirectory is the name of the environment variable that contains the path to the buildpack EnvBuildpackDirectory = "CNB_BUILDPACK_DIR" // EnvExtensionDirectory is the name of the environment variable that contains the path to the extension EnvExtensionDirectory = "CNB_EXTENSION_DIR" // EnvVcapServices is the name of the environment variable that contains the bindings in cloudfoundry EnvVcapServices = "VCAP_SERVICES" // EnvLayersDirectory is the name of the environment variable that contains the root path to all buildpack layers EnvLayersDirectory = "CNB_LAYERS_DIR" // EnvOutputDirectory is the name of the environment variable that contains the path to the output directory EnvOutputDirectory = "CNB_OUTPUT_DIR" // EnvPlatformDirectory is the name of the environment variable that contains the path to the platform directory EnvPlatformDirectory = "CNB_PLATFORM_DIR" // EnvDetectBuildPlanPath is the name of the environment variable that contains the path to the build plan EnvDetectPlanPath = "CNB_BUILD_PLAN_PATH" // EnvBuildPlanPath is the name of the environment variable that contains the path to the build plan EnvBuildPlanPath = "CNB_BP_PLAN_PATH" // Deprecated: EnvStackID is the name of the environment variable that contains the stack id EnvStackID = "CNB_STACK_ID" // EnvTargetOS contains the name of the os EnvTargetOS = "CNB_TARGET_OS" // EnvTargetArch contains the architecture EnvTargetArch = "CNB_TARGET_ARCH" // EnvTargetOS contains the variant of the architecture EnvTargetArchVariant = "CNB_TARGET_ARCH_VARIANT" // EnvTargetDistroName contains the name of the ditro EnvTargetDistroName = "CNB_TARGET_DISTRO_NAME" // EnvTargetDistroVersion contains the version of the distro EnvTargetDistroVersion = "CNB_TARGET_DISTRO_VERSION" // DefaultPlatformBindingsLocation is the typical location for bindings, which exists under the platform directory // // Not guaranteed to exist, but often does. This should only be used as a fallback if EnvServiceBindings and EnvPlatformDirectory are not set DefaultPlatformBindingsLocation = "/platform/bindings" )
Variables ¶
This section is empty.
Functions ¶
func BuildpackMain ¶
func BuildpackMain(detect DetectFunc, build BuildFunc, options ...Option)
BuildpackMain is called by the main function of a buildpack, encapsulating both detection and build in the same binary.
func Detect ¶
func Detect(detect DetectFunc, config Config)
Detect is called by the main function of a buildpack, for detection.
func ExtensionMain ¶
func ExtensionMain(detect DetectFunc, generate GenerateFunc, options ...Option)
ExtensionMain is called by the main function of a extension, encapsulating both detection and generation in the same binary.
func Generate ¶
func Generate(generate GenerateFunc, config Config)
Generate is called by the main function of a extension, for generate phase
Types ¶
type Binding ¶
type Binding struct { // Name is the name of the binding Name string // Path is the path to the binding directory. Path string // Type is the type of the binding. Type string // Provider is the optional provider of the binding. Provider string // Secret is the secret of the binding. Secret map[string]string }
Binding is a projection of metadata about an external entity to be bound to.
func NewBinding ¶
NewBinding creates a new Binding initialized with a secret.
func NewBindingFromPath ¶
NewBindingFromPath creates a new binding from the files located at a path.
func (Binding) SecretFilePath ¶
SecretFilePath return the path to a secret file with the given name.
type Bindings ¶
type Bindings []Binding
Bindings is a collection of bindings keyed by their name.
func NewBindings ¶
NewBindings creates a new bindings from all the bindings at the path defined by $SERVICE_BINDING_ROOT. If that isn't defined, bindings are read from <platform>/bindings. If that isn't defined, bindings are read from $VCAP_SERVICES. If that isn't defined, the specified platform path will be used
func NewBindingsFromPath ¶
NewBindingsFromPath creates a new instance from all the bindings at a given path.
func NewBindingsFromVcapServicesEnv ¶
NewBindingsFromVcapServicesEnv creates a new instance from all the bindings given from the VCAP_SERVICES.
type BuildConfig ¶
type BuildConfig struct {
Args []DockerfileArg `toml:"args"`
}
BuildConfig contains additional arguments passed to the generated Dockerfiles
type BuildContext ¶
type BuildContext struct { // ApplicationPath is the location of the application source code as provided by // the lifecycle. ApplicationPath string // Buildpack is metadata about the buildpack, from buildpack.toml. Buildpack Buildpack // Layers is the layers available to the buildpack. Layers Layers // Logger is the way to write messages to the end user Logger log.Logger // PersistentMetadata is metadata that is persisted even across cache cleaning. PersistentMetadata map[string]interface{} // Plan is the buildpack plan provided to the buildpack. Plan BuildpackPlan // Platform is the contents of the platform. Platform Platform // Deprecated: StackID is the ID of the stack. StackID string // TargetInfo contains info of the target (os, arch, ...). TargetInfo TargetInfo // TargetDistro is the target distribution (name, version). TargetDistro TargetDistro }
BuildContext contains the inputs to build.
type BuildFunc ¶
type BuildFunc func(context BuildContext) (BuildResult, error)
BuildFunc takes a context and returns a result, performing buildpack build behaviors.
type BuildPlan ¶
type BuildPlan struct { // Provides is the dependencies provided by the buildpack. Provides []BuildPlanProvide `toml:"provides,omitempty"` // Requires is the dependencies required by the buildpack. Requires []BuildPlanRequire `toml:"requires,omitempty"` }
BuildPlan represents the provisions and requirements of a buildpack during detection.
type BuildPlanProvide ¶
type BuildPlanProvide struct { // Name is the name of the dependency. Name string `toml:"name"` }
BuildPlanProvide represents a dependency provided by a buildpack.
type BuildPlanRequire ¶
type BuildPlanRequire struct { // Name is the name of the dependency. Name string `toml:"name"` // Metadata is the metadata for the dependency. Optional. Metadata map[string]interface{} `toml:"metadata,omitempty"` }
BuildPlanRequire represents a dependency required by a buildpack.
type BuildPlans ¶
type BuildPlans struct { // BuildPlan is the first build plan. BuildPlan // Or is the collection of other build plans. Or []BuildPlan `toml:"or,omitempty"` }
BuildPlans represents a collection of build plans produced by a buildpack during detection.
type BuildResult ¶
type BuildResult struct { // Labels are the image labels contributed by the buildpack. Labels []Label // Layers is the collection of LayerCreators contributed by the buildpack. Layers []Layer // PersistentMetadata is metadata that is persisted even across cache cleaning. PersistentMetadata map[string]interface{} // Processes are the process types contributed by the buildpack. Processes []Process // Slices are the application slices contributed by the buildpack. Slices []Slice // Unmet contains buildpack plan entries that were not satisfied by the buildpack and therefore should be // passed to subsequent providers. Unmet []UnmetPlanEntry }
BuildResult contains the results of detection.
func NewBuildResult ¶
func NewBuildResult() BuildResult
NewBuildResult creates a new BuildResult instance, initializing empty fields.
func (BuildResult) String ¶
func (b BuildResult) String() string
type BuildTOML ¶
type BuildTOML struct { // Unmet is a collection of buildpack plan entries that should be passed through to subsequent providers. Unmet []UnmetPlanEntry }
BuildTOML represents the contents of build.toml.
type Buildpack ¶
type Buildpack struct { // API is the api version expected by the buildpack. API string `toml:"api"` // Info is information about the buildpack. Info BuildpackInfo `toml:"buildpack"` // Path is the path to the buildpack. Path string `toml:"-"` // Deprecated: Stacks is the collection of stacks supported by the buildpack. Stacks []BuildpackStack `toml:"stacks"` // Targets is the collection of targets supported by the buildpack. Targets []Target `toml:"targets"` // Metadata is arbitrary metadata attached to the buildpack. Metadata map[string]interface{} `toml:"metadata"` }
Buildpack is the contents of the buildpack.toml file.
type BuildpackInfo ¶
type BuildpackInfo struct { // ID is the ID of the buildpack. ID string `toml:"id"` // Name is the name of the buildpack. Name string `toml:"name"` // Version is the version of the buildpack. Version string `toml:"version"` // Homepage is the homepage of the buildpack. Homepage string `toml:"homepage"` // ClearEnvironment is whether the environment should be clear of user-configured environment variables. ClearEnvironment bool `toml:"clear-env"` // Description is a string describing the buildpack. Description string `toml:"description"` // Keywords is a list of words that are associated with the buildpack. Keywords []string `toml:"keywords"` // Licenses a list of buildpack licenses. Licenses []License `toml:"licenses"` // SBOM is the list of supported SBOM media types SBOMFormats []string `toml:"sbom-formats"` }
BuildpackInfo is information about the buildpack.
type BuildpackOrder ¶
type BuildpackOrder struct { // Groups is the collection of groups within the order. Groups []BuildpackOrderBuildpack `toml:"group"` }
BuildpackOrder is an order definition in the buildpack.
type BuildpackOrderBuildpack ¶
type BuildpackOrderBuildpack struct { // ID is the id of the buildpack. ID string `toml:"id"` // Version is the version of the buildpack. Version string `toml:"version"` // Optional is whether the buildpack is optional within the buildpack. Optional bool `toml:"optional"` }
BuildpackOrderBuildpack is a buildpack within in a buildpack order group.
type BuildpackPlan ¶
type BuildpackPlan struct { // Entries represents all the buildpack plan entries. Entries []BuildpackPlanEntry `toml:"entries,omitempty"` }
BuildpackPlan represents a buildpack plan.
type BuildpackPlanEntry ¶
type BuildpackPlanEntry struct { // Name represents the name of the entry. Name string `toml:"name"` // Metadata is the metadata of the entry. Optional. Metadata map[string]interface{} `toml:"metadata,omitempty"` }
BuildpackPlanEntry represents an entry in the buildpack plan.
type BuildpackStack
deprecated
type BuildpackStack struct { // ID is the id of the stack. ID string `toml:"id"` }
Deprecated: BuildpackStack is a stack supported by the buildpack.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is an object that contains configurable properties for execution.
type DetectContext ¶
type DetectContext struct { // ApplicationPath is the location of the application source code as provided by // the lifecycle. ApplicationPath string // Buildpack is metadata about the buildpack from buildpack.toml (empty when processing an extension) Buildpack Buildpack // Extension is metadata about the extension from extension.toml (empty when processing a buildpack) Extension Extension // Logger is the way to write messages to the end user Logger log.Logger // Platform is the contents of the platform. Platform Platform // StackID is the ID of the stack. StackID string }
DetectContext contains the inputs to detection.
type DetectFunc ¶
type DetectFunc func(context DetectContext) (DetectResult, error)
DetectFunc takes a context and returns a result, performing buildpack detect behaviors.
type DetectResult ¶
type DetectResult struct { // Pass indicates whether detection has passed. Pass bool // Plans are the build plans contributed by the buildpack. Plans []BuildPlan }
DetectResult contains the results of detection.
type DockerfileArg ¶
DockerfileArg is a Dockerfile argument
type Environment ¶
Environment represents the file-based environment variable specification.
func (Environment) Append ¶
func (e Environment) Append(name string, delimiter string, a ...interface{})
Append formats using the default formats for its operands and appends the value of this environment variable to any previous declarations of the value without any delimitation. Spaces are added between operands when neither is a string. If delimitation is important during concatenation, callers are required to add it.
func (Environment) Appendf ¶
func (e Environment) Appendf(name string, delimiter string, format string, a ...interface{})
Appendf formats according to a format specifier and 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 (Environment) Default ¶
func (e Environment) Default(name string, a ...interface{})
Default formats using the default formats for its operands and sets a default for an environment variable with this value. Spaces are added between operands when neither is a string.
func (Environment) Defaultf ¶
func (e Environment) Defaultf(name string, format string, a ...interface{})
Defaultf formats according to a format specifier and sets a default for an environment variable with this value.
func (Environment) Override ¶
func (e Environment) Override(name string, a ...interface{})
Override formats using the default formats for its operands and overrides any existing value for an environment variable with this value. Spaces are added between operands when neither is a string.
func (Environment) Overridef ¶
func (e Environment) Overridef(name string, format string, a ...interface{})
Overridef formats according to a format specifier and overrides any existing value for an environment variable with this value.
func (Environment) Prepend ¶
func (e Environment) Prepend(name string, delimiter string, a ...interface{})
Prepend formats using the default formats for its operands and prepends the value of this environment variable to any previous declarations of the value without any delimitation. Spaces are added between operands when neither is a string. If delimitation is important during concatenation, callers are required to add it.
func (Environment) Prependf ¶
func (e Environment) Prependf(name string, delimiter string, format string, a ...interface{})
Prependf formats using the default formats for its operands and 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 (Environment) ProcessAppend ¶
func (e Environment) ProcessAppend(processType string, name string, delimiter string, a ...interface{})
ProcessAppend formats using the default formats for its operands and appends the value of this environment variable to any previous declarations of the value without any delimitation. Spaces are added between operands when neither is a string. If delimitation is important during concatenation, callers are required to add it.
func (Environment) ProcessAppendf ¶
func (e Environment) ProcessAppendf(processType string, name string, delimiter string, format string, a ...interface{})
ProcessAppendf formats according to a format specifier and 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 (Environment) ProcessDefault ¶
func (e Environment) ProcessDefault(processType string, name string, a ...interface{})
ProcessDefault formats using the default formats for its operands and sets a default for an environment variable with this value. Spaces are added between operands when neither is a string.
func (Environment) ProcessDefaultf ¶
func (e Environment) ProcessDefaultf(processType string, name string, format string, a ...interface{})
ProcessDefaultf formats according to a format specifier and sets a default for an environment variable with this value.
func (Environment) ProcessOverride ¶
func (e Environment) ProcessOverride(processType string, name string, a ...interface{})
ProcessOverride formats using the default formats for its operands and overrides any existing value for an environment variable with this value. Spaces are added between operands when neither is a string.
func (Environment) ProcessOverridef ¶
func (e Environment) ProcessOverridef(processType string, name string, format string, a ...interface{})
ProcessOverridef formats according to a format specifier and overrides any existing value for an environment variable with this value.
func (Environment) ProcessPrepend ¶
func (e Environment) ProcessPrepend(processType string, name string, delimiter string, a ...interface{})
ProcessPrepend formats using the default formats for its operands and prepends the value of this environment variable to any previous declarations of the value without any delimitation. Spaces are added between operands when neither is a string. If delimitation is important during concatenation, callers are required to add it.
func (Environment) ProcessPrependf ¶
func (e Environment) ProcessPrependf(processType string, name string, delimiter string, format string, a ...interface{})
ProcessPrependf formats using the default formats for its operands and 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.
type EnvironmentWriter ¶
type EnvironmentWriter interface { // Write is called with the path to a directory where the environment variables should be serialized to and the // environment variables to serialize to that directory. Write(dir string, environment map[string]string) error }
EnvironmentWriter is the interface implemented by a type that wants to serialize a map of environment variables to the file system.
type Exec ¶
type Exec struct { // Path is the path to the exec.d directory. Path string }
Exec represents the exec.d layer location
type ExecD ¶
ExecD describes an interface for types that follow the Exec.d specification. It should return a map of environment variables and their values as output.
type ExecDWriter ¶
type ExecDWriter interface { // Write is called with the map of environment value key value // pairs that will be written out Write(value map[string]string) error }
ExecDWriter is the interface implemented by a type that wants to write exec.d output to file descriptor 3.
type ExitHandler ¶
type ExitHandler interface { // Error is called when an error is encountered. Error(error) // Fail is called when a buildpack fails. Fail() // Pass is called when a buildpack passes. Pass() }
ExitHandler is the interface implemented by a type that wants to handle exit behavior when a buildpack encounters an error.
type ExtendConfig ¶
type ExtendConfig struct { Build BuildConfig `toml:"build"` Run BuildConfig `toml:"run"` }
ExtendConfig contains additional configuration for the Dockerfiles
type Extension ¶
type Extension struct { // API is the api version expected by the extension. API string `toml:"api"` // Info is information about the extension. Info ExtensionInfo `toml:"extension"` // Path is the path to the extension. Path string `toml:"-"` // Targets is the collection of targets supported by the buildpack. Targets []Target `toml:"targets"` // Metadata is arbitrary metadata attached to the extension. Metadata map[string]interface{} `toml:"metadata"` }
Extension is the contents of the extension.toml file.
type ExtensionInfo ¶
type ExtensionInfo struct { // ID is the ID of the extension. ID string `toml:"id"` // Name is the name of the extension. Name string `toml:"name"` // Version is the version of the extension. Version string `toml:"version"` // Homepage is the homepage of the extension. Homepage string `toml:"homepage"` // Description is a string describing the extension. Description string `toml:"description"` // Keywords is a list of words that are associated with the extension. Keywords []string `toml:"keywords"` // Licenses a list of extension licenses. Licenses []License `toml:"licenses"` }
ExtensionInfo is information about the extension.
type GenerateContext ¶
type GenerateContext struct { // ApplicationPath is the location of the application source code as provided by // the lifecycle. ApplicationPath string // Extension is metadata about the extension, from extension.toml. Extension Extension // OutputDirectory is the location Dockerfiles should be written to. OutputDirectory string // Logger is the way to write messages to the end user Logger log.Logger // Plan is the buildpack plan provided to the buildpack. Plan BuildpackPlan // Platform is the contents of the platform. Platform Platform // TargetInfo contains info of the target (os, arch, ...). TargetInfo TargetInfo // TargetDistro is the target distribution (name, version). TargetDistro TargetDistro // Deprecated: StackID is the ID of the stack. StackID string }
GenerateContext contains the inputs to generate.
type GenerateFunc ¶
type GenerateFunc func(context GenerateContext) (GenerateResult, error)
GenerateFunc takes a context and returns a result, performing extension generate behaviors.
type GenerateResult ¶
type GenerateResult struct { // Unmet contains buildpack plan entries that were not satisfied by the buildpack and therefore should be // passed to subsequent providers. Unmet []UnmetPlanEntry RunDockerfile []byte BuildDockerfile []byte Config *ExtendConfig }
GenerateResult contains the results of detection.
func NewGenerateResult ¶
func NewGenerateResult() GenerateResult
NewGenerateResult creates a new BuildResult instance, initializing empty fields.
func (GenerateResult) String ¶
func (b GenerateResult) String() string
type Label ¶
type Label struct { // Key is the key of the label. Key string `toml:"key"` // Value is the value of the label. Value string `toml:"value"` }
Label represents an image label.
type LaunchTOML ¶
type LaunchTOML struct { // Labels is the collection of image labels contributed by the buildpack. Labels []Label `toml:"labels"` // Processes is the collection of process types contributed by the buildpack. Processes []Process `toml:"processes"` // Slices is the collection of slices contributed by the buildpack. Slices []Slice `toml:"slices"` }
LaunchTOML represents the contents of launch.toml.
type Layer ¶
type Layer struct { // LayerTypes indicates the type of layer LayerTypes `toml:"types"` // Metadata is the metadata associated with the layer. Metadata map[string]interface{} `toml:"metadata"` // Name is the name of the layer. Name string `toml:"-"` // Path is the filesystem location of the layer. Path string `toml:"-"` // BuildEnvironment are the environment variables set at build time. BuildEnvironment Environment `toml:"-"` // LaunchEnvironment are the environment variables set at launch time. LaunchEnvironment Environment `toml:"-"` SharedEnvironment Environment `toml:"-"` // Exec is the exec.d executables set in the layer. Exec Exec `toml:"-"` }
Contribute represents a layer managed by the buildpack.
func (Layer) SBOMPath ¶
func (l Layer) SBOMPath(bt SBOMFormat) string
SBOMPath returns the path to the layer specific SBOM File
type LayerTypes ¶
type LayerTypes struct { // Build indicates that a layer should be used for builds. Build bool `toml:"build"` // Cache indicates that a layer should be cached. Cache bool `toml:"cache"` // Launch indicates that a layer should be used for launch. Launch bool `toml:"launch"` }
LayerTypes describes which types apply to a given layer. A layer may have any combination of Launch, Build, and Cache types.
type Layers ¶
type Layers struct { // Path is the layers filesystem location. Path string }
Layers represents the layers part of the specification.
func (Layers) BuildSBOMPath ¶
func (l Layers) BuildSBOMPath(bt SBOMFormat) string
BOMBuildPath returns the full path to the build SBoM file for the buildpack
func (Layers) LaunchSBOMPath ¶
func (l Layers) LaunchSBOMPath(bt SBOMFormat) string
BOMLaunchPath returns the full path to the launch SBoM file for the buildpack
type License ¶
type License struct { // Type is the identifier for the license. // It MAY use the SPDX 2.1 license expression, but is not limited to identifiers in the SPDX Licenses List. Type string `toml:"type"` // URI may be specified in lieu of or in addition to type to point to the license // if this buildpack is using a nonstandard license. URI string `toml:"uri"` }
License contains information about a Software License governing the use or redistribution of a buildpack
type Option ¶
Option is a function for configuring a Config instance.
func WithArguments ¶
WithArguments creates an Option that sets a collection of arguments.
func WithDirectoryContentFormatter ¶
func WithDirectoryContentFormatter(formatter log.DirectoryContentFormatter) Option
WithDirectoryContentFormatter creates an Option that sets a ExecDWriter implementation.
func WithEnvironmentWriter ¶
func WithEnvironmentWriter(environmentWriter EnvironmentWriter) Option
WithEnvironmentWriter creates an Option that sets an EnvironmentWriter implementation.
func WithExecDWriter ¶
func WithExecDWriter(execdWriter ExecDWriter) Option
WithExecDWriter creates an Option that sets a ExecDWriter implementation.
func WithExitHandler ¶
func WithExitHandler(exitHandler ExitHandler) Option
WithExitHandler creates an Option that sets an ExitHandler implementation.
func WithLogger ¶
WithLogger creates an Option that sets a ExecDWriter implementation.
func WithTOMLWriter ¶
func WithTOMLWriter(tomlWriter TOMLWriter) Option
WithTOMLWriter creates an Option that sets a TOMLWriter implementation.
type Platform ¶
type Platform struct { // Bindings are the external bindings available to the application. Bindings Bindings // Environment is the environment exposed by the platform. Environment map[string]string // Path is the path to the platform. Path string }
Platform is the contents of the platform directory.
type Process ¶
type Process struct { // Type is the type of the process. Type string `toml:"type"` // Command is the command of the process. Command []string `toml:"command"` // Arguments are arguments to the command. Arguments []string `toml:"args"` // WorkingDirectory is a directory to execute the command in, removes the need to use a shell environment to CD into working directory WorkingDirectory string `toml:"working-dir,omitempty"` // Default can be set to true to indicate that the process // type being defined should be the default process type for the app image. Default bool `toml:"default,omitempty"` }
Process represents metadata about a type of command that can be run.
type SBOMFormat ¶
type SBOMFormat int
BOMFormat indicates the format of the SBOM entry
const ( CycloneDXJSON SBOMFormat = iota SPDXJSON SyftJSON UnknownFormat )
func SBOMFormatFromString ¶
func SBOMFormatFromString(from string) (SBOMFormat, error)
func (SBOMFormat) MediaType ¶
func (b SBOMFormat) MediaType() string
func (SBOMFormat) String ¶
func (b SBOMFormat) String() string
type Slice ¶
type Slice struct { // Paths are the contents of the slice. Paths []string `toml:"paths"` }
Slice represents metadata about a slice.
type Store ¶
type Store struct { // Metadata represents the persistent metadata. Metadata map[string]interface{} `toml:"metadata"` }
Store represents the contents of store.toml
type TOMLWriter ¶
type TOMLWriter interface { // Write is called with the path that a TOML file should be written to and the object to serialize to that file. Write(path string, value interface{}) error }
TOMLWriter is the interface implemented by a type that wants to serialize an object to a TOML file.
type Target ¶
type Target struct { TargetInfo // Distros is the collection of distros associated with the target. Distros []TargetDistro `toml:"distros"` }
Target is a target supported by the buildpack.
type TargetDistro ¶
type TargetDistro struct { // Name is the name of the supported distro. Name string `toml:"name"` // Version is the version of the supported distro. Version string `toml:"version"` }
TargetDistro is the supported target distro
type TargetInfo ¶
type TargetInfo struct { // OS is the supported os. OS string `toml:"os"` // Arch is the supported architecture. Arch string `toml:"arch"` // Variant is the supported variant of the architecture. Variant string `toml:"variant"` }
TargetInfo is the supported target
type UnmetPlanEntry ¶
type UnmetPlanEntry struct { // Name represents the name of the entry. Name string `toml:"name"` }
UnmetPlanEntry denotes an unmet buildpack plan entry. When a buildpack returns an UnmetPlanEntry in the BuildResult, any BuildpackPlanEntry with a matching Name will be provided to subsequent providers.