gotransform

package module
v0.0.0-...-b47ff69 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 2

README

gotransform

A collection of transform template libraries.

Documentation

Overview

Package gotransform implements the universal template transformer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualTemplateTransformer

func EqualTemplateTransformer(a, b TemplateTransformer) bool

EqualTemplateTransformer checks if both template transformers are equal.

Types

type TemplateTransformer

type TemplateTransformer interface {
	goutils.IsZeroer
	// Type returns the transform template type of this instance.
	Type() transformtypes.TransformTemplateType
	// Transform processes and injects data into the template to transform data.
	Transform(data any) (any, error)
}

TemplateTransformer abstracts the interface to transform data.

func NewTransformerFromConfig

func NewTransformerFromConfig(
	name string,
	config TemplateTransformerConfig,
	getEnvFunc goenvconf.GetEnvFunc,
) (TemplateTransformer, error)

NewTransformerFromConfig creates a template transformer from configuration.

type TemplateTransformerConfig

type TemplateTransformerConfig struct {
	transformtypes.TemplateTransformerConfig `yaml:",inline"`
}

TemplateTransformerConfig represents configurations for transforming data.

func (TemplateTransformerConfig) Equal

Equal checks if this instance equals the target value.

func (TemplateTransformerConfig) Interface

func (TemplateTransformerConfig) IsZero

func (j TemplateTransformerConfig) IsZero() bool

IsZero checks if the config is empty.

func (*TemplateTransformerConfig) UnmarshalJSON

func (j *TemplateTransformerConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*TemplateTransformerConfig) UnmarshalYAML

func (j *TemplateTransformerConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the custom behavior for the yaml.Unmarshaler interface.

Directories

Path Synopsis
Package gotmpl implements the template transformer using Go template.
Package gotmpl implements the template transformer using Go template.
Package jmes implements the transform template using JMESPath templates.
Package jmes implements the transform template using JMESPath templates.
Package transformtypes defines common data types for other packages.
Package transformtypes defines common data types for other packages.

Jump to

Keyboard shortcuts

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