transformation

package
v0.0.0-...-20c3865 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transformation

type Transformation map[string]*template.Template

Transformation is the transformation matrix for a given payload.

func NewTransformation

func NewTransformation() Transformation

NewTransformation creates an empty Transformation.

func TransformationFromConfig

func TransformationFromConfig(config map[string]string, funcs template.FuncMap) (out Transformation, err error)

TransformationFromConfig creates a transformation from a configuration description.

func (Transformation) Apply

func (t Transformation) Apply(b *blob.Blob) (*blob.Blob, error)

Apply takes a serialized JSON payload and returns a Blob on which the transformation has been applied, as well as a collection of metadata corresponding to fields prefixed by an underscore.

func (Transformation) ApplyMap

func (t Transformation) ApplyMap(m map[string]interface{}) (map[string]interface{}, error)

ApplyMap is a less capable version of Apply that only knows how to deal with simple objects, and won't handle any metadata fields. It is used when applying a transformation to a nested object where metadata transformation is not expected.

type Transformations

type Transformations struct {
	Funcs template.FuncMap
	// contains filtered or unexported fields
}

Transformations is a collection of Transformation for different event types.

func NewTransformations

func NewTransformations() *Transformations

func (*Transformations) Get

func (t *Transformations) Get(name string) Transformation

func (*Transformations) Load

func (t *Transformations) Load(config config.SerializedTable) error

Jump to

Keyboard shortcuts

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