transform

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultName = "T"

Variables

This section is empty.

Functions

func NewDefault

func NewDefault(name string) dukkha.Renderer

Types

type Checksum added in v0.5.0

type Checksum struct {
	rs.BaseField `yaml:"-" json:"-"`

	// File is the local file path to the target data file
	//
	// File and Data are mutually exclusive
	File *string `yaml:"file"`

	// Data is the raw string to be verified
	//
	// Path and Data are mutually exclusive
	Data *string `yaml:"data"`

	// Kind is the name of hash algo
	Kind checksumKind `yaml:"kind"`

	// Sum is the expected hex encoded string of checksum value
	Sum string `yaml:"sum"`

	// Key is the optional hmac key, if set, will do hmac
	Key *string `yaml:"key"`
}

func (Checksum) Verify added in v0.5.0

func (cs Checksum) Verify(ofs *fshelper.OSFS) error

VerifyFile check local file if matching the checksum

type Driver added in v0.4.3

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

	renderer.BaseRenderer `yaml:",inline"`
	// contains filtered or unexported fields
}

func (*Driver) RenderYaml added in v0.4.3

func (d *Driver) RenderYaml(
	rc dukkha.RenderingContext, rawData interface{}, _ []dukkha.RendererAttribute,
) ([]byte, error)

type Operation

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

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

func (*Operation) Do

func (op *Operation) Do(_rc dukkha.RenderingContext, valueBytes []byte) ([]byte, 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