sherpa

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 11 Imported by: 110

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(source *os.File, destination string) error

CopyFile copies a file from the source to the destination. It ensures that the parent directory is created and matches the source and destination permissions.

func Execute

func Execute(f ExecuteFunc, options ...Option)

Execute is called by the main function of a buildpack helper application, for execution.

func NewFileListing

func NewFileListing(root string) ([]map[string]interface{}, error)

NewFileListing generates a listing of all entries under root.

func ResolveVersion

func ResolveVersion(key string, entry libcnb.BuildpackPlanEntry, id string, defaultVersions map[string]string) string

ResolveVersion resolves a version declaration through four methods, in order of precedence. 1. An environment variable ($<key>) 2. Buildpack plan entry 3. Buildpack default version 4. Empty version ("")

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is an object that contains configurable properties for execution.

type ExecuteFunc

type ExecuteFunc func() error

ExecuteFunc is the callback function for buildpack helper application implementations.

type FileEntry

type FileEntry struct {

	// Path is the path of a file.
	Path string

	// Mode is the mode of the source file.
	Mode string

	// ModificationTime is the modification time of the file.
	ModificationTime time.Time

	// SHA256 is the SHA256 has of the source file.
	SHA256 string
}

FileEntry is metadata about a file.

type Option

type Option func(config Config) Config

Option is a function for configuring a Config instance.

func WithExitHandler

func WithExitHandler(exitHandler libcnb.ExitHandler) Option

WithExitHandler creates an Option that sets an ExitHandler implementation.

Jump to

Keyboard shortcuts

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