serverless

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ServerlessFile = "serverless.yml"

Default serverless configuration file

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition added in v0.6.0

type Definition struct {
	Service     string
	Description string
	Provider    struct {
		Name        string // see `providers` variable for supported providers
		Registry    string
		Envs        map[string]string
		Environment map[string]string // legacy entry
		Secrets     []string
		EnvSecrets  []string `yaml:"env-secrets"` // legacy entry
		Annotations map[string]string
	}
	Functions map[string]struct {
		Handler     string
		Source      string
		Runtime     string
		Description string
		Labels      []string
		Envs        map[string]string
		Environment map[string]string // legacy entry
		Secrets     []string
		EnvSecrets  []string `yaml:"env-secrets"` // legacy entry
		Annotations map[string]string
	}
}

type Deployer added in v0.6.0

type Deployer interface {
	DeployDryRun() (string, error)
	Deploy(ctx context.Context) (string, error)
}

Deployer is an interface that we use to perform a serverless deployment

type Function

type Function struct {
	Name        string // Function name
	Service     string // Function service name
	Directory   string // Function base directory
	Handler     string
	Image       string // Source or destination image
	Runtime     string // Function runtime address
	Description string
	Labels      []string
	Secrets     []string
	Envs        map[string]string
	Annotations map[string]string
}

func (Function) ToRuntime

func (function Function) ToRuntime() runtime.Runtime

type Manifest added in v0.6.0

type Manifest struct {
	Definition
}

Manifest represents serverless file format

func NewServerlessConfig added in v0.6.0

func NewServerlessConfig() (Manifest, error)

NewServerlessConfig returns a new serverless config struct

func NewServerlessConfigYAML added in v0.6.0

func NewServerlessConfigYAML(path string) (Manifest, error)

NewServerlessConfigYAML parses a serverless config file

func (Manifest) BaseDirectory added in v0.6.0

func (manifest Manifest) BaseDirectory() string

Returns a current working directory that is a config base

func (Manifest) ToFunctions added in v0.6.0

func (manifest Manifest) ToFunctions() (functions []Function)

ToFunctions returns definitions of functions from the serverless configuration

func (Manifest) Validate added in v0.6.0

func (manifest Manifest) Validate() error

Jump to

Keyboard shortcuts

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