recipe

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate added in v0.0.2

func Validate(rcp *Recipe) error

Validate validates the recipe

func ValidateFramework added in v0.0.2

func ValidateFramework(frameworkRcp *Framework) error

ValidateFramework validates the recipe for a Framework

func ValidateResource added in v0.0.2

func ValidateResource(resourceRcp *Resource) error

ValidateResource validates the recipe for a Resource

Types

type Definition added in v0.0.2

type Definition struct {
	Name         string    `yaml:"name" validate:"required"`
	Format       string    `yaml:"format" validate:"required,oneof=json yaml"`
	Type         string    `yaml:"type" validate:"required,oneof=dir file"`
	Path         string    `yaml:"path" validate:"required"`
	RegexPattern string    `yaml:"regex_pattern"`
	Function     *Function `yaml:"function"`
}

Definition is a recipe on how and where to read the actual Definition data

type Framework

type Framework struct {
	Name        string        `yaml:"name" validate:"required"`
	Schemas     []*Schema     `yaml:"schemas"`
	Definitions []*Definition `yaml:"definitions"`
	Procedures  []*Procedure  `yaml:"procedures"`
}

Framework is a recipe on how and where to read the actual Framework data

type Function added in v0.0.2

type Function struct {
	Type string `yaml:"type" validate:"required,oneof=dir file"`
	Path string `yaml:"path" validate:"required"`
}

Function is a recipe on how to construct a Definition

type Output added in v0.0.3

type Output struct {
	TreatAs string    `yaml:"treat_as" validate:"required,oneof=info warning error success"`
	Targets []*Target `yaml:"targets" validate:"required,min=1"`
}

Output defines how the last procedure output is written

type Procedure added in v0.0.2

type Procedure struct {
	Name   string  `yaml:"name" validate:"required"`
	Type   string  `yaml:"type" validate:"required,oneof=dir file"`
	Path   string  `yaml:"path" validate:"required"`
	Output *Output `yaml:"output"`
}

Procedure is a recipe on how and where to read the actual Procedure data

type Recipe

type Recipe struct {
	Resources  []*Resource  `yaml:"resources" validate:"required"`
	Frameworks []*Framework `yaml:"frameworks" validate:"required"`
}

Recipe is the main structure for storing recipe execution flow

func Load added in v0.0.2

func Load(reader model.Reader, decode model.Decode) (*Recipe, error)

Load loads recipe from the passed Reader with Decoder to decode

type Resource

type Resource struct {
	Name           string   `yaml:"name" validate:"required"`
	Format         string   `yaml:"format" validate:"required,oneof=json yaml"`
	Type           string   `yaml:"type" validate:"required,oneof=dir file"`
	RegexPattern   string   `yaml:"regex_pattern"`
	Path           string   `yaml:"path" validate:"required"`
	BatchSize      int      `yaml:"batch_size"`
	FrameworkNames []string `yaml:"framework_names" validate:"required,min=1"`
}

Resource is a recipe on how and where to read the actual Resource data

type Schema added in v0.0.2

type Schema struct {
	Name   string  `yaml:"name" validate:"required"`
	Type   string  `yaml:"type" validate:"required,oneof=dir file"`
	Path   string  `yaml:"path" validate:"required"`
	Output *Output `yaml:"output"`
}

Schema is a recipe on how and where to read the actual Schema data

type Target added in v0.0.3

type Target struct {
	Name   string `yaml:"name" validate:"required"`
	Format string `yaml:"format" validate:"required,oneof=json yaml"`
	Type   string `yaml:"type" validate:"required,eq=dir"`
	Path   string `yaml:"path"`
}

Target defines how an output is written to the targetted stream

Jump to

Keyboard shortcuts

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