project

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOTELCollectorVersion string

Functions

This section is empty.

Types

type BaseConfig added in v1.16.0

type BaseConfig struct {
	Name            string            `yaml:"name"`
	Dir             string            `yaml:"-"`
	Handlers        []any             `yaml:"handlers"`
	PreviewFeatures []preview.Feature `yaml:"preview-features"`
}

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 DockerConfig added in v1.23.0

type DockerConfig struct {
	File string
	Args map[string]string
}

type Function

type Function struct {
	// Parent Project backreference
	Project *Project
	// The functions unique name
	Name string `yaml:"-"`
	// The location of the function handler
	Handler string `yaml:"handler"`
	// The functions type
	Config *HandlerConfig `yaml:"-"`
}

func FunctionFromHandler

func FunctionFromHandler(handlerFile string, config *HandlerConfig) (Function, error)

func (*Function) GetRuntime added in v1.23.0

func (f *Function) GetRuntime() (runtime.Runtime, error)

func (*Function) RelativeHandlerPath

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

type HandlerConfig added in v1.16.0

type HandlerConfig struct {
	Type   string        `yaml:"type" mapstructure:"type"`
	Match  string        `yaml:"match" mapstructure:"match"`
	Docker *DockerConfig `yaml:"docker,omitempty" mapstructure:"docker,omitempty"`
}

type Project

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

func FromConfig

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

func New

func New(config BaseConfig) *Project

func (*Project) IsPreviewFeatureEnabled added in v1.23.0

func (p *Project) IsPreviewFeatureEnabled(feat preview.Feature) bool

Jump to

Keyboard shortcuts

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