transform

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultName = "transform"

Variables

This section is empty.

Functions

func NewDefault

func NewDefault(name string) dukkha.Renderer

Types

type Operation

type Operation struct {
	rs.BaseField `yaml:"-"`

	Template *string `yaml:"template,omitempty"`
	Shell    *string `yaml:"shell,omitempty"`
}

func (*Operation) Do

func (op *Operation) Do(rc dukkha.RenderingContext, data interface{}) (interface{}, error)

type Spec

type Spec struct {
	rs.BaseField `yaml:"-"`

	// Value always be string, so you can decide which format is converts to in operations
	Value string `yaml:"value"`

	// Ops the transform operations to run
	Ops []*Operation `yaml:"ops"`
}

Spec for yaml data transformation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳