sherpa

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: Apache-2.0 Imports: 16 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 Helpers added in v1.41.0

func Helpers(helpers map[string]ExecD, options ...Option) error

Helpers is called by the main function of a buildpack's helper application, for execution.

func NodeJSMainModule added in v1.17.0

func NodeJSMainModule(path string) (string, error)

NodeJSMainModule returns the name of the main module as defined in <path>/package.json.

func StaticFile added in v1.20.0

func StaticFile(name string) (string, error)

StaticFile returns the contents of a file in a statik filesystem.

func TemplateFile added in v1.20.0

func TemplateFile(name string, data interface{}) (string, error)

TemplateFile uses the contents of a file in a statik filesystem as a text/template template and returns the template as applied to the data object.

Types

type Config

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

Config is an object that contains configurable properties for execution.

type ExecD added in v1.41.0

type ExecD interface {
	Execute() (map[string]string, error)
}

ExecD describes an interface for types that Exec.d specification.

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 `toml:"path"`

	// Mode is the mode of the source file.
	Mode string `toml:"mode"`

	// SHA256 is the SHA256 hash of the source file.
	SHA256 string `toml:"sha256,omitempty"`
}

FileEntry is metadata about a file.

func NewFileListing

func NewFileListing(roots ...string) ([]FileEntry, error)

NewFileListing generates a listing of all entries under the roots.

type Option

type Option func(config Config) Config

Option is a function for configuring a Config instance.

func WithArguments added in v1.41.0

func WithArguments(arguments []string) Option

WithArguments creates an Option that sets a collection of arguments.

func WithExecdWriter added in v1.41.0

func WithExecdWriter(writer io.Writer) Option

WithExecdWriter creates an Option that sets an exec.d Writer implementation.

func WithExitHandler

func WithExitHandler(exitHandler libcnb.ExitHandler) Option

WithExitHandler creates an Option that sets an ExitHandler implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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