mapper

package
v0.9.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: BSD-3-Clause Imports: 12 Imported by: 28 modules, 41 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

View Source
const (
	EnvMappingRelexed        = "FLOGO_MAPPING_RELAXED"
	EnvMappingRelexedDefault = false
)
View Source
const (
	//To do an array mapping from upstreaming, use @foreach.
	/*
			"input": {

		    "val" : {
		        "a" : "=$activity[blah].out",
		        "addresses": {
		            "@foreach($activity[blah].out2, i)":
		            {
		              "street"  : "=$.street",
		              "zipcode" : "9999",
		              "state"   : "=$activity[test].state",
		              "addresses2": {
		                  "@foreach($.addresses2)":{
		                        "street2"  : "=$loop[i].street2",
		                        "zipcode2" : "=$.zipcode",
		                        "state2"   : "=$activity[test].state"
		                	  }
		               	}
		            	}
		        	}
		    	}
			}

	*/
	FOREACH = "@foreach"
)

Variables

This section is empty.

Functions

func ConvertMappingValue

func ConvertMappingValue(mappingType string, mappingValue interface{}) (interface{}, error)

Deprecated

func GetObjectMapping

func GetObjectMapping(value interface{}) (interface{}, bool)

func IsLiteral

func IsLiteral(value interface{}) bool

func IsMappingRelaxed

func IsMappingRelaxed() bool

func NewObjectMapperFactory

func NewObjectMapperFactory(exprFactory expression.Factory) expression.Factory

func ToObjectMap added in v0.9.1

func ToObjectMap(value interface{}) (map[string]interface{}, error)

Types

type ExprMapper

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

func (*ExprMapper) Apply

func (m *ExprMapper) Apply(inputScope data.Scope) (map[string]interface{}, error)

type ExprMapperFactory

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

func (*ExprMapperFactory) NewMapper

func (mf *ExprMapperFactory) NewMapper(mappings map[string]interface{}) (Mapper, error)

type Factory

type Factory interface {
	NewMapper(mappings map[string]interface{}) (Mapper, error)
}

func NewFactory

func NewFactory(resolver resolve.CompositeResolver) Factory

type Mapper

type Mapper interface {
	Apply(scope data.Scope) (map[string]interface{}, error)
}

Mapper is a constructs that maps values to a map

type ObjectMapper

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

func (*ObjectMapper) Eval

func (am *ObjectMapper) Eval(inputScope data.Scope) (interface{}, error)

type ObjectMapperFactory

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

func (*ObjectMapperFactory) NewExpr

func (am *ObjectMapperFactory) NewExpr(value string) (expression.Expr, error)

func (*ObjectMapperFactory) NewObjectMapper

func (am *ObjectMapperFactory) NewObjectMapper(value interface{}) (expression.Expr, error)

type ObjectMapping

type ObjectMapping struct {
	Mapping interface{} `json:"mapping"`
}

Jump to

Keyboard shortcuts

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