libbs

package module
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 19 Imported by: 22

README

github.com/paketo-buildpacks/libbs

libbs is a Go library that forms the basis for building the different Paketo-style build system-providing buildpacks.

Usage

go get github.com/paketo-buildpacks/libbs

License

This library is released under version 2.0 of the Apache License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveArguments added in v1.1.0

func ResolveArguments(configurationKey string, configurationResolver libpak.ConfigurationResolver) ([]string, error)

ResolveArguments resolves the arguments that should be passed to a build system.

Types

type AlwaysInterestingFileDetector

type AlwaysInterestingFileDetector struct{}

AlwaysInterestingFileDetector is an implementation of InterestingFileDetector that always returns true, indicating that all files are interesting.

func (AlwaysInterestingFileDetector) Interesting

func (AlwaysInterestingFileDetector) Interesting(path string) (bool, error)

type Application

type Application struct {
	ApplicationPath  string
	Arguments        []string
	ArtifactResolver ArtifactResolver
	Cache            Cache
	Command          string
	Executor         effect.Executor
	LayerContributor libpak.LayerContributor
	Logger           bard.Logger
	BOM              *libcnb.BOM
	SBOMScanner      sbom.SBOMScanner
}

func (Application) Contribute

func (a Application) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (Application) Name

func (Application) Name() string

type ApplicationFactory added in v1.2.1

type ApplicationFactory struct {
	Executor effect.Executor
}

func NewApplicationFactory added in v1.2.1

func NewApplicationFactory() *ApplicationFactory

func (*ApplicationFactory) NewApplication added in v1.2.1

func (f *ApplicationFactory) NewApplication(
	additionalMetadata map[string]interface{},
	arguments []string,
	artifactResolver ArtifactResolver,
	cache Cache,
	command string,
	bom *libcnb.BOM,
	applicationPath string,
	bomScanner sbom.SBOMScanner,
) (Application, error)

type ArtifactResolver

type ArtifactResolver struct {

	// ArtifactConfigurationKey is the environment variable key to lookup for user configured artifacts.
	ArtifactConfigurationKey string

	// ConfigurationResolver is the configuration resolver to use.
	ConfigurationResolver libpak.ConfigurationResolver

	// ModuleConfigurationKey is the environment variable key to lookup for user configured modules.
	ModuleConfigurationKey string

	// InterestingFileDetector is used to determine if a file is a candidate for artifact resolution.
	InterestingFileDetector InterestingFileDetector

	// AdditionalHelpMessage can be used to supply context specific instructions if no matching artifact is found
	AdditionalHelpMessage string
}

ArtifactResolver provides functionality for resolve build system built artifacts.

func (*ArtifactResolver) Pattern added in v1.2.0

func (a *ArtifactResolver) Pattern() string

Pattern returns the space separated list of globs that ArtifactResolver will use for resolution.

func (*ArtifactResolver) Resolve

func (a *ArtifactResolver) Resolve(applicationPath string) (string, error)

Resolve resolves the artifact that was created by the build system.

func (*ArtifactResolver) ResolveMany added in v1.11.0

func (a *ArtifactResolver) ResolveMany(applicationPath string) ([]string, error)

type Cache

type Cache struct {
	Logger bard.Logger
	Path   string
}

func (*Cache) AsBOMEntry added in v1.8.0

func (c *Cache) AsBOMEntry() (libcnb.BOMEntry, error)

func (Cache) Contribute

func (c Cache) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (Cache) Name

func (Cache) Name() string

type InterestingFileDetector

type InterestingFileDetector interface {

	// Interesting determines if a path is an interesting path for consideration.
	Interesting(path string) (bool, error)
}

InterestingFileDetector is an interface for types that determine whether a given file is interesting.

type JARInterestingFileDetector

type JARInterestingFileDetector struct{}

JARInterestingFileDetector is an implementation of InterestingFileDetector that returns true if the path represents a JAR file with a Main-Class manifest entry or a WAR file with a WEB-INF/ directory.

func (JARInterestingFileDetector) Interesting

func (j JARInterestingFileDetector) Interesting(path string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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