function

package
v0.3.1-0...-4a36b4e Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Error_Initialization          = 101
	Error_ComponentInitialization = 102
	Error_ComponentContribution   = 103
	Error_ComponentInternal       = 104
	Error_ReadMetadata            = 105
)
View Source
const (
	RiffEnv     = "RIFF"
	ArtifactEnv = "RIFF_ARTIFACT"
	HandlerEnv  = "RIFF_HANDLER"
	OverrideEnv = "RIFF_OVERRIDE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Buildpack

type Buildpack struct {
	BuildpackImplementation BuildpackImplementation
}

func (Buildpack) Build

func (b Buildpack) Build()

func (Buildpack) Detect

func (b Buildpack) Detect()

type BuildpackImplementation

type BuildpackImplementation interface {
	// Build is called during the build phase of the buildpack lifecycle.
	Build(build build.Build) (int, error)

	// Detect is called during the detect phase of the buildpack lifecycle.
	Detect(detect detect.Detect, metadata Metadata) (int, error)

	// Id returns the id of the function buildpack.
	Id() string
}

BuildpackImplementation is an interface for types that implement concrete behaviors for build and detect.

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