libbs

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 16 Imported by: 22

README

github.com/paketo-buildpacks/libbs

libs 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

This section is empty.

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
	ArgumentResolver ArgumentResolver
	ArtifactResolver ArtifactResolver
	Cache            Cache
	Command          string
	Executor         effect.Executor
	LayerContributor libpak.LayerContributor
	Logger           bard.Logger
	Plan             *libcnb.BuildpackPlan
}

func NewApplication

func NewApplication(applicationPath string, argumentResolver ArgumentResolver, artifactResolver ArtifactResolver,
	cache Cache, command string, plan *libcnb.BuildpackPlan) (Application, error)

func (Application) Contribute

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

func (Application) Name

func (Application) Name() string

type ArgumentResolver

type ArgumentResolver struct {

	// ConfigurationKey is the environment variable key to lookup for user configured arguments.
	ConfigurationKey string

	// DefaultArguments are the default arguments to use if the user has not configured any.
	DefaultArguments []string
}

ArgumentResolver provides functionality for resolving build system arguments.

func NewArgumentResolver

func NewArgumentResolver(configurationKey string, defaultArguments []string, logger bard.Logger) ArgumentResolver

NewArgumentResolver creates a new instance, logging the user configuration key and default value.

func (*ArgumentResolver) Resolve

func (a *ArgumentResolver) Resolve() ([]string, error)

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

type ArtifactResolver

type ArtifactResolver struct {

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

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

	// DefaultArtifact is the default artifact pattern to use if the user has not configured any.
	DefaultArtifact string

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

ArtifactResolver provides functionality for resolve build system built artifacts.

func NewArtifactResolver

func NewArtifactResolver(artifactConfigurationKey string, moduleConfigurationKey string, defaultArtifact string, logger bard.Logger) ArtifactResolver

NewArtifactResolver creates a new instance, logging the user configuration keys and default values. The instance uses the AlwaysInterestingFileDetector.

func (*ArtifactResolver) Resolve

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

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

type Cache

type Cache struct {
	Logger bard.Logger
	Path   string
}

func (*Cache) AsBuildpackPlanEntry

func (c *Cache) AsBuildpackPlanEntry() (libcnb.BuildpackPlanEntry, 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