config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 30
	DefaultMemory  = 512
)
View Source
const (
	RuntimeUnknown       = "unknown"
	RuntimePython        = "python"
	RuntimeGo            = "go"
	RuntimeNode          = "nodejs"
	DefaultNodeVersion   = "18.13.0"
	DefaultPythonVersion = "3.9.0"
	DefaultGoVersion     = "1.19.0"
)

Variables

This section is empty.

Functions

func ReadIgnoredFiles added in v0.1.0

func ReadIgnoredFiles(file string) ([]string, error)

Types

type Config

type Config struct {
	Name   string  `json:"name"`
	Stage  string  `json:"stage"`
	Bucket string  `json:"bucket"`
	Region string  `json:"region"`
	Lambda *Lambda `json:"lambda"`
	Dir    string  `json:"dir"`
	Entry  string  `json:"entry"`
}

Config is the Jerm configuration details

func ParseConfig

func ParseConfig(data []byte) (*Config, error)

ParseConfig parses a configuration data to Config struct

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig reads a configuration file

func (*Config) GetFunctionName added in v0.1.0

func (c *Config) GetFunctionName() string

func (*Config) PromptConfig added in v0.1.0

func (c *Config) PromptConfig() (*Config, error)

func (*Config) ToJson

func (c *Config) ToJson(name string) error

ToJson writes Config to json file

type Go added in v0.1.0

type Go struct {
	*Runtime
}

Go runtime

func (*Go) Build added in v0.1.0

func (g *Go) Build(config *Config) (string, error)

Builds the go deployment package

func (*Go) Entry added in v0.1.0

func (g *Go) Entry() string

Entry is the directory where the cloud function handler resides. The directory can be a file.

type Lambda

type Lambda struct {
	Runtime  string `json:"runtime"`
	Timeout  int    `json:"timeout"`
	Role     string `json:"role"`
	Memory   int    `json:"memory"`
	Handler  string `json:"handler"`
	KeepWarm bool   `json:"keep_warm"`
}

Lambda configuration.

func (*Lambda) Defaults

func (l *Lambda) Defaults() error

type Node added in v0.1.0

type Node struct {
	*Runtime
}

NodeJS runtime

func (*Node) Build added in v0.1.0

func (n *Node) Build(config *Config) (string, error)

Builds the nodejs deployment package

type Python

type Python struct {
	*Runtime
}

func (*Python) Build

func (p *Python) Build(config *Config) (string, error)

Builds the Python deployment package

func (*Python) Entry

func (p *Python) Entry() string

Entry is the directory where the cloud function handler resides. The directory can be a file.

func (*Python) IsDjango

func (p *Python) IsDjango() bool

Check if it's a Django project

type Runtime

type Runtime struct {
	Name    string
	Version string
}

Base Runtime

func (*Runtime) Build added in v0.1.0

func (r *Runtime) Build(*Config) (string, error)

func (*Runtime) Entry

func (r *Runtime) Entry() string

type RuntimeInterface added in v0.1.0

type RuntimeInterface interface {
	// Builds the deployment package for the underlying runtime
	Build(*Config) (string, error)

	// Entry is the directory where the cloud function handler resides.
	// The directory can be a file.
	Entry() string
	// contains filtered or unexported methods
}

func NewGoRuntime added in v0.1.0

func NewGoRuntime() RuntimeInterface

NewGoConfig instantiates a new Go runtime

func NewNodeRuntime added in v0.1.0

func NewNodeRuntime() RuntimeInterface

NewNodeConfig instantiates a new NodeJS runtime

func NewPythonRuntime added in v0.1.0

func NewPythonRuntime() RuntimeInterface

NewPythonConfig instantiates a new Python runtime

func NewRuntime added in v0.1.0

func NewRuntime() RuntimeInterface

NewRuntime instantiates a new runtime

type Stage

type Stage string
const (
	Dev           Stage = "dev"
	Production    Stage = "production"
	Staging       Stage = "staging"
	DefaultRegion       = "us-west-2"
	DefaultStage  Stage = Dev
)

Jump to

Keyboard shortcuts

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