Documentation ¶
Index ¶
- func GetClusterTmplFuncs(cluster string) (template.FuncMap, bool)
- func Patch(original interface{}, patchText string) (interface{}, error)
- func Register(tType string, transFunc TransformFunc)
- func RegisterClusterTmplFunc(cluster, funcName string, tmplFunc any) error
- func Replace(original interface{}, jsonString string) (interface{}, error)
- type TransformFunc
- type TransformFuncRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClusterTmplFuncs ¶ added in v0.5.3
func Register ¶
func Register(tType string, transFunc TransformFunc)
Register function registers a transformation function with the given type.
func RegisterClusterTmplFunc ¶ added in v0.5.3
Types ¶
type TransformFunc ¶
TransformFunc is a type definition for transformation functions that take an original data structure and a transformation string, and return a transformed data structure and an error.
func GetTransformFunc ¶
func GetTransformFunc(transformerType string) (TransformFunc, bool)
GetTransformFunc retrieves a registered transformation function by type.
type TransformFuncRegistry ¶
type TransformFuncRegistry struct {
// contains filtered or unexported fields
}
TransformFuncRegistry is a struct that holds a map of transformation functions.
func NewRegistry ¶
func NewRegistry() *TransformFuncRegistry
NewRegistry creates and returns a new instance of TransformFuncRegistry.
func (*TransformFuncRegistry) Get ¶
func (r *TransformFuncRegistry) Get(transformerType string) (transFunc TransformFunc, found bool)
Get method of TransformFuncRegistry retrieves a registered transformation function by type.
func (*TransformFuncRegistry) Register ¶
func (r *TransformFuncRegistry) Register(tType string, transFunc TransformFunc)
Register method of TransformFuncRegistry registers a transformation function with the given type.