conv

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 4 packages

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

func Init

func Init(registry *xform.Registry)

Init standard transformers

func NewBoolTransformer

func NewBoolTransformer(ctx context.Context, config tags.Values, destType reflect.Type, resources *resource.Store) (xform.Transformer, error)

NewBoolTransformer creates a new bool transformer

func NewIntTransformer

func NewIntTransformer(ctx context.Context, config tags.Values, destType reflect.Type, resources *resource.Store) (xform.Transformer, error)

NewIntTransformer creates a new int transformer

func NewStringTransformer

func NewStringTransformer(ctx context.Context, config tags.Values, destType reflect.Type, resources *resource.Store) (xform.Transformer, error)

NewStringTransformer creates a new string transformer

Types

type BoolTransformer

type BoolTransformer struct {
	xform.TransformerBase
}

BoolTransformer converts compatible values to bool

func (*BoolTransformer) Transform

func (t *BoolTransformer) Transform(ctx context.Context, resolver locator.Resolver, input interface{}) (interface{}, error)

type IntTransformer

type IntTransformer struct {
	xform.TransformerBase
}

IntTransformer converts compatible values to int

func (*IntTransformer) Transform

func (t *IntTransformer) Transform(ctx context.Context, resolver locator.Resolver, input interface{}) (interface{}, error)

type StringTransformer

type StringTransformer struct {
	xform.TransformerBase
}

StringTransformer converts any value to a string

func (*StringTransformer) Transform

func (t *StringTransformer) Transform(ctx context.Context, resolver locator.Resolver, input interface{}) (interface{}, error)

type ValueConverter added in v0.2.0

type ValueConverter struct {
	TimeLayout string
	// DisallowJSON disables implicit structured decoding for non-JSON sources.
	DisallowJSON bool
}

ValueConverter converts wire or authored values to the planned source type. Codecs run after this conversion and own destination-specific semantics.

func (ValueConverter) Convert added in v0.2.0

func (c ValueConverter) Convert(value any, target reflect.Type) (any, error)

Jump to

Keyboard shortcuts

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