template

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NamedStage

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

type Option

type Option = helper.Option[Template]

func WithStageLoader

func WithStageLoader(loader StageLoader) Option

type PluginLoader

type PluginLoader interface {
	LoadPlugin(name string) graph.IOWorkerVertex[[]byte]
}

type Stage

type Stage struct {
	NamedStage
	Parents    []string               `yaml:"parents"`
	PluginPath string                 `yaml:"pluginPath"`
	Plugin     string                 `yaml:"plugin"`
	Config     any                    `yaml:"config"`
	Pipe       []map[string]yaml.Node `yaml:"pipe"`
}

func (Stage) LoadPlugin

func (st Stage) LoadPlugin(name string) graph.IOWorkerVertex[[]byte]

type StageLoader

type StageLoader func(name string, yml *yaml.Node) (PluginLoader, error)

func SimpleStageLoader

func SimpleStageLoader(getPluginLoader func() PluginLoader) StageLoader

type Template

type Template struct {
	Name        string                `yaml:"name" json:"name"`
	Description string                `yaml:"description" json:"description"`
	Version     string                `yaml:"version" json:"version"`
	Author      string                `yaml:"author" json:"author"`
	Stages      map[string]*yaml.Node `yaml:"stages" json:"stages"`
	// contains filtered or unexported fields
}

func New

func New[S Stage](raw []byte, opt ...Option) (Template, error)

func NewFile

func NewFile[S Stage](path string, opt ...Option) (Template, error)

func (Template) IterPluginLoader

func (t Template) IterPluginLoader() iter.Seq2[string, PluginLoader]

func (Template) Raw

func (t Template) Raw() ([]byte, error)

func (Template) WorkerVertexIterator

func (t Template) WorkerVertexIterator() iter.Seq[graph.IOWorkerVertex[[]byte]]

Jump to

Keyboard shortcuts

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