stack

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright © 2020 Vertigo Tecnologia. All rights reserved. Licensed under the Apache License, Version 2.0. See LICENSE file in the project root for full license information.

Copyright © 2020 Vertigo Tecnologia. All rights reserved. Licensed under the Apache License, Version 2.0. See LICENSE file in the project root for full license information.

Copyright © 2020 Vertigo Tecnologia. All rights reserved. Licensed under the Apache License, Version 2.0. See LICENSE file in the project root for full license information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFunction

func AppendFunction(function Function) error

func CreateTemplate

func CreateTemplate(function Function) error

func GetAllFunctions

func GetAllFunctions() (map[string]Function, error)

func GetStackFileName added in v0.0.12

func GetStackFileName() string

func ParseYAMLForLanguageTemplate

func ParseYAMLForLanguageTemplate(fileName string) (fileData []byte, err error)

func RemoveFunction added in v0.0.8

func RemoveFunction(functionName string, removeFolder, verboseFlag bool) error

Types

type Build added in v0.0.15

type Build struct {
	Enabled *bool             `yaml:"enabled,omitempty"`
	Args    map[string]string `yaml:"args,omitempty"`
}

type Config

type Config struct {
	Build Build `yaml:"build,omitempty"`
	Scale struct {
		Min string `yaml:"min"`
		Max string `yaml:"max"`
	} `yaml:"scale,omitempty"`

	// Resource limit that the function will use
	Limits CpuMemory `yaml:"limits,omitempty"`

	// Minimum resource required that the function will use
	Requests CpuMemory `yaml:"requests,omitempty"`

	// Environment variables
	Environments map[string]interface{} `yaml:"environments,omitempty"`
}

Config apply one or all functions in stack.yaml

type ConfigFromPlugin added in v0.0.9

type ConfigFromPlugin struct {
	SecretKeyRef SecretKeyRef `yaml:"secretKeyRef,omitempty"`
}

type CpuMemory added in v0.0.5

type CpuMemory struct {
	Cpu    string `yaml:"cpu,omitempty"`
	Memory string `yaml:"memory,omitempty"`
}

type Function

type Function struct {
	// Name of deployed function
	Name string `yaml:"-"`

	// Lang/Template name
	Lang string `yaml:"lang"`

	// Handler Local folder to use for function
	Handler string `yaml:"handler"`

	// Docker image name
	Image string `yaml:"image"`

	// Path
	Path string `yaml:"path,omitempty"`

	// Config
	FunctionConfig Config `yaml:"config,omitempty"`

	// Kong Plugins
	Plugins map[string]Plugin `yaml:"plugins,omitempty"`
}

Function as deployed or built on FaaS

type Plugin added in v0.0.9

type Plugin struct {
	// Plugin name
	Name string `yaml:"-"`

	// Plugin type
	Type string `yaml:"type,omitempty"`

	Global string `yaml:"global,omitempty"`

	Config map[string]interface{} `yaml:"config,omitempty"`

	ConfigFrom ConfigFromPlugin `yaml:"configFrom,omitempty"`
}

type Provider

type Provider struct {
	Name       string `yaml:"name"`
	GatewayURL string `yaml:"gateway"`
}

Provider for the FaaS set of functions

type SecretKeyRef added in v0.0.9

type SecretKeyRef struct {
	Name string `yaml:"name,omitempty"`
	Key  string `yaml:"key,omitempty"`
}

type Stack

type Stack struct {
	Version     string              `yaml:"version,omitempty"`
	Provider    Provider            `yaml:"provider,omitempty"`
	Hostname    string              `yaml:"hostname,omitempty"`
	Functions   map[string]Function `yaml:"functions,omitempty"`
	StackConfig Config              `yaml:"config,omitempty"`
	Custom      []string            `yaml:"custom,omitempty"`
}

Stack root level YAML file to define FaaS function-set

func LoadStackFile

func LoadStackFile(envFile string) (*Stack, error)

Jump to

Keyboard shortcuts

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