recipe

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRecipeVersion = errors.New("recipe version is invalid or not found")

Functions

func FromTemplate

func FromTemplate(config TemplateConfig) error

Types

type PluginNode

type PluginNode struct {
	Name   yaml.Node            `json:"name" yaml:"name"`
	Type   yaml.Node            `json:"type" yaml:"type"`
	Scope  yaml.Node            `json:"scope" yaml:"scope"`
	Config map[string]yaml.Node `json:"config" yaml:"config"`
}

PluginNode contains the json data for a recipe node that is being used for generating the plugins code for a recipe.

type PluginRecipe

type PluginRecipe struct {
	Name   string         `json:"name" yaml:"name" validate:"required"`
	Scope  string         `json:"scope" yaml:"scope"`
	Config map[string]any `json:"config" yaml:"config"`
	Node   PluginNode
}

PluginRecipe contains the json data for a recipe that is being used for generating the plugins code for a recipe.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a struct that reads recipe files.

func NewReader

func NewReader(lg log.Logger, pathToConfig string) *Reader

NewReader returns a new Reader.

func (*Reader) Read

func (r *Reader) Read(path string) ([]Recipe, error)

Read loads the list of recipes from a give file or directory path.

type Recipe

type Recipe struct {
	Name       string         `json:"name" yaml:"name" validate:"required"`
	Version    string         `json:"version" yaml:"version" validate:"required"`
	Source     PluginRecipe   `json:"source" yaml:"source" validate:"required"`
	Sinks      []PluginRecipe `json:"sinks" yaml:"sinks" validate:"required,min=1"`
	Processors []PluginRecipe `json:"processors" yaml:"processors"`
	Node       RecipeNode
}

Recipe contains the json data for a recipe

type RecipeNode

type RecipeNode struct {
	Name       yaml.Node    `json:"name" yaml:"name"`
	Version    yaml.Node    `json:"version" yaml:"version"`
	Source     PluginNode   `json:"source" yaml:"source"`
	Sinks      []PluginNode `json:"sinks" yaml:"sinks"`
	Processors []PluginNode `json:"processors" yaml:"processors"`
}

RecipeNode contains the json data for a recipe node

type TemplateConfig

type TemplateConfig struct {
	TemplateFilePath string
	OutputDirPath    string
	DataPath         string
	Data             []TemplateData
}

type TemplateData

type TemplateData struct {
	FileName string         `json:"FileName" yaml:"FileName"`
	Data     map[string]any `json:"Data" yaml:"Data"`
}

Jump to

Keyboard shortcuts

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