xform

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string            `json:"name,omitempty" yaml:"name,omitempty"`
	Meta       map[string]string `json:"meta,omitempty" yaml:"meta,omitempty"`
	Parameters []string          `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

type Factory

type Factory interface {
	Create(ctx context.Context, config tags.Values, destType reflect.Type, resources *resource.Store) (Transformer, error)
}

func NewTransformerFactory

func NewTransformerFactory(name string, constructor func(ctx context.Context, config tags.Values, destType reflect.Type, resources *resource.Store) (Transformer, error)) Factory

NewTransformerFactory creates a new transformer factory

type Registry

type Registry struct {
	internal.Map[string, Factory]
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Lookup

func (r *Registry) Lookup(name string) (Factory, bool)

Lookup returns a transformer from the registry

func (*Registry) Register

func (r *Registry) Register(name string, factory Factory)

Register adds a transformer to the registry

type Transformer

type Transformer interface {
	Transform(ctx context.Context, resolver locator.Resolver, input interface{}) (interface{}, error)
}

type TransformerBase

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

TransformerBase provides basic transformer functionality

func NewTransformerBase

func NewTransformerBase(name string, destType reflect.Type, config tags.Values, resources *resource.Store) TransformerBase

NewTransformerBase creates a new transformer base

func (*TransformerBase) ReadResource added in v0.3.0

func (b *TransformerBase) ReadResource(reference string) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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