transform

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTemplate

func NewTemplate(tmpl string) (*template.Template, error)

func Patch

func Patch(original interface{}, patchText string) (interface{}, error)

func Register

func Register(tType string, transFunc TransformFunc)

func Replace

func Replace(original interface{}, jsonString string) (interface{}, error)

Types

type TransformFunc

type TransformFunc func(original interface{}, data string) (target interface{}, err error)

func GetTransformFunc

func GetTransformFunc(transformerType string) (TransformFunc, bool)

type TransformFuncRegistry

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

func (*TransformFuncRegistry) Get

func (r *TransformFuncRegistry) Get(transformerType string) (transFunc TransformFunc, found bool)

func (*TransformFuncRegistry) Register

func (r *TransformFuncRegistry) Register(tType string, transFunc TransformFunc)

type Transformer

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

func NewTransformer

func NewTransformer(tType string, tmpl string, cluster string) (*Transformer, error)

func (*Transformer) Transform

func (t *Transformer) Transform(original interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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