project

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOTELCollectorVersion string

Functions

This section is empty.

Types

type BaseComputeConfig added in v1.16.0

type BaseComputeConfig struct {
	Type string `yaml:"type"`
}

Config shared by all compute types

type BaseConfig added in v1.16.0

type BaseConfig struct {
	Name     string `yaml:"name"`
	Dir      string `yaml:"-"`
	Handlers []any  `yaml:"handlers"`
}

type ComputeUnit

type ComputeUnit struct {
	Name string `yaml:"-"`

	Type string `yaml:"-"`
}

type Config

type Config struct {
	BaseConfig       `yaml:",inline"`
	ConcreteHandlers []*HandlerConfig `yaml:"-"`
}

func ConfigFromProjectPath added in v1.4.0

func ConfigFromProjectPath(projPath string) (*Config, error)

ConfigFromProjectPath - loads the config nitric.yaml file from the project path, defaults to the current working directory

func (*Config) ToFile

func (p *Config) ToFile() error

type Function

type Function struct {
	// The location of the function handler
	Handler string `yaml:"handler"`

	ComputeUnit `yaml:",inline"`

	// The number of workers this function contains
	WorkerCount int
}

func FunctionFromHandler

func FunctionFromHandler(h string, t string) (Function, error)

func (*Function) RelativeHandlerPath

func (f *Function) RelativeHandlerPath(s *Project) (string, error)

type HandlerConfig added in v1.16.0

type HandlerConfig struct {
	BaseComputeConfig
	Match string
}

type Project

type Project struct {
	Dir       string              `yaml:"-"`
	Name      string              `yaml:"name"`
	Functions map[string]Function `yaml:"functions,omitempty"`
	History   *history.History    `yaml:"-"`
}

func FromConfig

func FromConfig(c *Config) (*Project, error)

func New

func New(config BaseConfig) *Project

Jump to

Keyboard shortcuts

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