runtime

package
v0.0.0-...-f7ae98d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RuntimeRegistrySingleton = registry.NewRegistry("processor_build_runtime")

Functions

This section is empty.

Types

type AbstractRuntime

type AbstractRuntime struct {
	Logger         logger.Logger
	StagingDir     string
	FunctionConfig *functionconfig.Config
	DockerClient   dockerclient.Client
	CmdRunner      cmdrunner.CmdRunner
}

func NewAbstractRuntime

func NewAbstractRuntime(logger logger.Logger,
	stagingDir string,
	functionConfig *functionconfig.Config) (*AbstractRuntime, error)

func (*AbstractRuntime) DetectFunctionHandlers

func (ar *AbstractRuntime) DetectFunctionHandlers(functionPath string) ([]string, error)

DetectFunctionHandlers returns a list of all the handlers in that directory given a path holding a function (or functions)

func (*AbstractRuntime) GetFunctionDir

func (ar *AbstractRuntime) GetFunctionDir() string

func (*AbstractRuntime) GetHandlerDirObjectPaths

func (ar *AbstractRuntime) GetHandlerDirObjectPaths() []string

GetProcessorImageObjectPaths returns the paths of all objects that should reside in the handler directory

func (*AbstractRuntime) GetProcessorImageObjectPaths

func (ar *AbstractRuntime) GetProcessorImageObjectPaths() map[string]string

return a map of objects the runtime needs to copy into the processor image the key can be a dir, a file or a url of a file the value is an absolute path into the docker image

func (*AbstractRuntime) GetRuntimeNameAndVersion

func (ar *AbstractRuntime) GetRuntimeNameAndVersion() (string, string)

GetRuntimeNameAndVersion returns name and version of runtime from runtime. e.g. go:1.8 -> go, 1.8

func (*AbstractRuntime) OnAfterStagingDirCreated

func (ar *AbstractRuntime) OnAfterStagingDirCreated(stagingDir string) error

type Factory

type Factory interface {
	Create(logger.Logger, string, *functionconfig.Config) (Runtime, error)
}

type ProcessorDockerfileInfo

type ProcessorDockerfileInfo struct {
	BaseImage            string
	OnbuildImage         string
	OnbuildArtifactPaths map[string]string
	ImageArtifactPaths   map[string]string
	Directives           map[string][]functionconfig.Directive
}

type Runtime

type Runtime interface {

	// DetectFunctionHandlers returns a list of all the handlers
	// in that directory given a path holding a function (or functions)
	DetectFunctionHandlers(functionPath string) ([]string, error)

	// OnAfterStagingDirCreated prepares anything it may need in that directory
	// towards building a functioning processor,
	OnAfterStagingDirCreated(stagingDir string) error

	// GetProcessorDockerfileInfo returns information required to build the processor Dockerfile
	GetProcessorDockerfileInfo(versionInfo *version.Info) (*ProcessorDockerfileInfo, error)

	// GetName returns the name of the runtime, including version if applicable
	GetName() string

	// GetProcessorImageObjectPaths returns the paths of all objects that should reside in the handler
	// directory
	GetHandlerDirObjectPaths() []string
}

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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