languages

package
v0.0.0-...-7b2e207 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedVendorTool = []string{
	"glide",
	"govendor",
}

SupportedVendorTool includes a list of supported vendor packaging tool

Functions

This section is empty.

Types

type Go

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

Go defines a deployment helper for go cocoon.

func NewGo

func NewGo(spec *types.Spec) *Go

NewGo returns a new instance a golang cocoon code deployment helper.

func (*Go) GetBuildCommand

func (g *Go) GetBuildCommand() *modo.Do

GetBuildCommand will return the command to build the source code and generate a binary.

func (*Go) GetCopyDir

func (g *Go) GetCopyDir() string

GetCopyDir returns the location in the container where the source code will be copied to

func (*Go) GetDownloadDir

func (g *Go) GetDownloadDir() string

GetDownloadDir returns the location to save the downloaded go cocoon code source on the connector

func (*Go) GetImage

func (g *Go) GetImage() string

GetImage returns the image name to deploy cocoon code on

func (*Go) GetName

func (g *Go) GetName() string

GetName returns the name for the language

func (*Go) GetRunCommand

func (g *Go) GetRunCommand() *modo.Do

GetRunCommand returns the command to start the cocoon code for this language. If DEV_RUN_ROOT_BIN env is set, it will run any ccode binary located in the mount destination.

func (*Go) GetSourceDir

func (g *Go) GetSourceDir() string

GetSourceDir returns the root directory of the cocoon source code in container.

func (*Go) RequiresBuild

func (g *Go) RequiresBuild() bool

RequiresBuild returns true if cocoon codes written in go language spec a build process. During development, If DEV_RUN_ROOT_BIN env is set, it will return false as the run command will find and find the ccode binary in the repo root.

func (*Go) SetBuildParams

func (g *Go) SetBuildParams(buildParams map[string]interface{}) error

SetBuildParams sets and validates build parameters

func (*Go) SetRunEnv

func (g *Go) SetRunEnv(env map[string]string)

SetRunEnv adds environment variables to be added when the run script is constructed.

type Language

type Language interface {

	// GetName returns the name of the language
	GetName() string

	// GetImage returns the docker image suitable for running the language
	GetImage() string

	// GetDownloadDir returns the directory path to store downloaded source code
	GetDownloadDir() string

	// GetCopyDir returns the path to copy the downloaded source from the
	// path returned by GetDownloadDir()
	GetCopyDir() string

	// GetSourceDir returns the path to the root of the downloaded source code
	GetSourceDir() string

	// RequiresBuild returns true if the language requires a build stage
	RequiresBuild() bool

	// GetBuildCommand returns the build command to run
	GetBuildCommand() *modo.Do

	// GetRunCommand returns the program execution command
	GetRunCommand() *modo.Do

	// SetBuildParams sets the build parameters required to construct the build command
	// returned by GetBuildCommand()
	SetBuildParams(map[string]interface{}) error

	// SetRunEnv sets the environment to apply when constructing the run/execution command
	// returned by GetRunCommand()
	SetRunEnv(env map[string]string)
}

Language defines a cocoon code language and its unique deployment procedure.

Jump to

Keyboard shortcuts

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