function

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ErrorInitialize          = 101
	ErrorDetectReadMetadata  = 102
	ErrorDetectInternalError = 103
	ErrorBuildInternalError  = 104
)
View Source
const (
	RiffEnv     = "RIFF"
	ArtifactEnv = "RIFF_ARTIFACT"
	HandlerEnv  = "RIFF_HANDLER"
	OverrideEnv = "RIFF_OVERRIDE"
)

Variables

This section is empty.

Functions

func Build

func Build(bp Buildpack)

func Detect

func Detect(bp Buildpack)

Types

type Buildpack

type Buildpack interface {
	Id() string
	Detect(detect detect.Detect, metadata Metadata) (*buildplan.Plan, error)
	Build(build build.Build) error
}

type Metadata

type Metadata struct {
	// Artifact is the path to the main function artifact. This may be a java jar file, an executable file, etc
	// May be autodetected or chosen by a collaborating buildpack
	Artifact string `toml:"artifact"`

	// Handler is a "finer grained" handler for the function within the artifact, if applicable.
	// This may be a classname, a function name, etc. May be autodetected or chosen by a collaborating
	// buildpack or function invoker.
	Handler string `toml:"handler"`

	// Override is an optional value provided by the user to force a given language for the function and
	// completely bypass the detection mechanism, if needed.
	Override string `toml:"override"`
}

Metadata represents the contents of the riff.toml file in an application root

func NewMetadata

func NewMetadata(application application.Application, logger logger.Logger) (Metadata, bool, error)

NewMetadata creates a new Metadata from the contents of $APPLICATION_ROOT/riff.toml. If that file does not exist, the second return value is false.

func (Metadata) String

func (m Metadata) String() string

String makes Metadata satisfy the Stringer interface.

Jump to

Keyboard shortcuts

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