Documentation
¶
Overview ¶
Package gotransform implements the universal template transformer.
Index ¶
- func EqualTemplateTransformer(a, b TemplateTransformer) bool
- type TemplateTransformer
- type TemplateTransformerConfig
- func (j TemplateTransformerConfig) Equal(target TemplateTransformerConfig) bool
- func (j TemplateTransformerConfig) Interface() transformtypes.TemplateTransformerConfig
- func (j TemplateTransformerConfig) IsZero() bool
- func (j *TemplateTransformerConfig) UnmarshalJSON(b []byte) error
- func (j *TemplateTransformerConfig) UnmarshalYAML(value *yaml.Node) error
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 ¶
func (j TemplateTransformerConfig) Equal(target TemplateTransformerConfig) bool
Equal checks if this instance equals the target value.
func (TemplateTransformerConfig) Interface ¶
func (j TemplateTransformerConfig) Interface() transformtypes.TemplateTransformerConfig
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. |
Click to show internal directories.
Click to hide internal directories.