project

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package project implements multi-function operations.

Index

Constants

View Source
const (
	// DefaultMemory defines default memory value (MB) for every function in a project
	DefaultMemory = 128

	// DefaultTimeout defines default timeout value (s) for every function in a project
	DefaultTimeout = 3

	// DefaultRetainedVersions defines numbers of retained versions
	DefaultRetainedVersions = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name               string            `json:"name" validate:"nonzero"`
	Description        string            `json:"description"`
	Runtime            string            `json:"runtime"`
	Memory             int64             `json:"memory"`
	Timeout            int64             `json:"timeout"`
	Role               string            `json:"role"`
	Handler            string            `json:"handler"`
	Shim               bool              `json:"shim"`
	NameTemplate       string            `json:"nameTemplate"`
	RetainedVersions   *int              `json:"retainedVersions"`
	DefaultEnvironment string            `json:"defaultEnvironment"`
	Environment        map[string]string `json:"environment"`
	Hooks              hooks.Hooks       `json:"hooks"`
	VPC                vpc.VPC           `json:"vpc"`
}

Config for project.

type Project

type Project struct {
	Config
	Path             string
	Alias            string
	Concurrency      int
	Environment      string
	InfraEnvironment string
	Log              log.Interface
	Service          lambdaiface.LambdaAPI
	Functions        []*function.Function
	IgnoreFile       []byte
	// contains filtered or unexported fields
}

Project represents zero or more Lambda functions.

func (*Project) Clean

func (p *Project) Clean() error

Clean up function build artifacts.

func (*Project) Delete

func (p *Project) Delete() error

Delete functions.

func (*Project) Deploy

func (p *Project) Deploy() error

Deploy functions and their configurations.

func (*Project) DeployAndClean

func (p *Project) DeployAndClean() error

DeployAndClean deploys functions and then cleans up their build artifacts.

func (*Project) FunctionDirNames added in v0.4.0

func (p *Project) FunctionDirNames() (list []string, err error)

FunctionDirNames returns a list of function directory names.

func (*Project) LoadEnvFromFile added in v0.10.0

func (p *Project) LoadEnvFromFile(path string) error

LoadEnvFromFile reads `path` JSON and applies it to the environment.

func (*Project) LoadFunction added in v0.7.0

func (p *Project) LoadFunction(name string) (*function.Function, error)

LoadFunction returns the function in the ./functions/<name> directory.

func (*Project) LoadFunctionByPath added in v0.7.0

func (p *Project) LoadFunctionByPath(name, path string) (*function.Function, error)

LoadFunctionByPath returns the function in the given directory.

func (*Project) LoadFunctions added in v0.6.0

func (p *Project) LoadFunctions(patterns ...string) error

LoadFunctions reads the ./functions directory, populating the Functions field. If no `patterns` are specified, all functions are loaded.

func (*Project) Open

func (p *Project) Open() error

Open the project.json file and prime the config.

func (*Project) Rollback added in v0.9.0

func (p *Project) Rollback() error

Rollback project functions to previous version.

func (*Project) RollbackVersion added in v0.9.0

func (p *Project) RollbackVersion(version string) error

RollbackVersion project functions to the specified version.

func (*Project) Setenv added in v0.5.0

func (p *Project) Setenv(name, value string)

Setenv sets environment variable `name` to `value` on every function in project.

Jump to

Keyboard shortcuts

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