el

package
v0.0.0-...-ec16f60 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	PARAMETER_PREFIX = "${"
	PARAMETER_SUFFIX = "}"
)
View Source
const (
	JobElContextVar        = "JOB_EL"
	JobIdContextVar        = "JOB_ID"
	JobNameContextVar      = "JOB_NAME"
	JobUserContextVar      = "JOB_USER"
	JobStartTimeContextVar = "JOB_START_TIME"
)
View Source
const (
	WRONG_ARGS_MESSAGE          = "Wrong number of arguments '%d' to function '%s', Expected : '%d'"
	CAST_TO_FLOAT_ERROR_MESSAGE = "Cannot convert argument idx: '%d' with value '%v' and type '%v' to float64 for operation '%s'"
	MATH_PREFIX                 = "math"
	ABS                         = "abs"
	CEIL                        = "ceil"
	FLOOR                       = "floor"
	MAX                         = "max"
	MIN                         = "min"
)
View Source
const (
	PipelineElContextVar        = "PIPELINE_EL"
	PipelineIdContextVar        = "PIPELINE_ID"
	PipelineTitleContextVar     = "PIPELINE_TITLE"
	PipelineUserContextVar      = "PIPELINE_USER"
	PipelineStartTimeContextVar = "PIPELINE_START_TIME"
	UndefinedValue              = "UNDEFINED"
)
View Source
const (
	NAMESPACE_FN_SEPARATOR = ":"
)
View Source
const (
	RecordContextVar = "record"
)

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(
	value string,
	configName string,
	parameters map[string]interface{},
	elContext context.Context,
) (interface{}, error)

func IsElString

func IsElString(configValue string) bool

Types

type Definitions

type Definitions interface {
	GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction
}

type Evaluator

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

func NewEvaluator

func NewEvaluator(
	configName string,
	parameters map[string]interface{},
	definitionsList []Definitions,
) (*Evaluator, error)

func (*Evaluator) Evaluate

func (elEvaluator *Evaluator) Evaluate(expression string) (interface{}, error)

type JobEL

type JobEL struct {
	Context context.Context
}

func (*JobEL) GetELFunctionDefinitions

func (j *JobEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*JobEL) GetId

func (j *JobEL) GetId(args ...interface{}) (interface{}, error)

func (*JobEL) GetName

func (j *JobEL) GetName(args ...interface{}) (interface{}, error)

func (*JobEL) GetStartTime

func (j *JobEL) GetStartTime(args ...interface{}) (interface{}, error)

func (*JobEL) GetUser

func (j *JobEL) GetUser(args ...interface{}) (interface{}, error)

type MapListEL

type MapListEL struct {
}

func (*MapListEL) EmptyList

func (mapListEL *MapListEL) EmptyList(args ...interface{}) (interface{}, error)

func (*MapListEL) EmptyMap

func (mapListEL *MapListEL) EmptyMap(args ...interface{}) (interface{}, error)

func (*MapListEL) GetELFunctionDefinitions

func (mapListEL *MapListEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*MapListEL) IsEmptyList

func (mapListEL *MapListEL) IsEmptyList(args ...interface{}) (interface{}, error)

func (*MapListEL) IsEmptyMap

func (mapListEL *MapListEL) IsEmptyMap(args ...interface{}) (interface{}, error)

func (*MapListEL) Length

func (mapListEL *MapListEL) Length(args ...interface{}) (interface{}, error)

func (*MapListEL) Size

func (mapListEL *MapListEL) Size(args ...interface{}) (interface{}, error)

type MathEL

type MathEL struct {
}

func (*MathEL) Abs

func (m *MathEL) Abs(args ...interface{}) (interface{}, error)

func (*MathEL) Ceil

func (m *MathEL) Ceil(args ...interface{}) (interface{}, error)

func (*MathEL) Floor

func (m *MathEL) Floor(args ...interface{}) (interface{}, error)

func (*MathEL) GetELFunctionDefinitions

func (m *MathEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*MathEL) Max

func (m *MathEL) Max(args ...interface{}) (interface{}, error)

func (*MathEL) Min

func (m *MathEL) Min(args ...interface{}) (interface{}, error)

type PipelineEL

type PipelineEL struct {
	Context context.Context
}

func (*PipelineEL) GetELFunctionDefinitions

func (p *PipelineEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*PipelineEL) GetId

func (p *PipelineEL) GetId(args ...interface{}) (interface{}, error)

func (*PipelineEL) GetStartTime

func (p *PipelineEL) GetStartTime(args ...interface{}) (interface{}, error)

func (*PipelineEL) GetTitle

func (p *PipelineEL) GetTitle(args ...interface{}) (interface{}, error)

func (*PipelineEL) GetUser

func (p *PipelineEL) GetUser(args ...interface{}) (interface{}, error)

type RecordEL

type RecordEL struct {
	Context context.Context
}

func (*RecordEL) Exists

func (r *RecordEL) Exists(args ...interface{}) (interface{}, error)

func (*RecordEL) GetAttribute

func (r *RecordEL) GetAttribute(args ...interface{}) (interface{}, error)

func (*RecordEL) GetAttributeOrDefault

func (r *RecordEL) GetAttributeOrDefault(args ...interface{}) (interface{}, error)

func (*RecordEL) GetELFunctionDefinitions

func (r *RecordEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*RecordEL) GetType

func (r *RecordEL) GetType(args ...interface{}) (interface{}, error)

func (*RecordEL) GetValue

func (r *RecordEL) GetValue(args ...interface{}) (interface{}, error)

func (*RecordEL) GetValueOrDefault

func (r *RecordEL) GetValueOrDefault(args ...interface{}) (interface{}, error)

type SdcEL

type SdcEL struct {
}

func (*SdcEL) GetELFunctionDefinitions

func (j *SdcEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*SdcEL) GetHostName

func (j *SdcEL) GetHostName(args ...interface{}) (interface{}, error)

type StringEL

type StringEL struct {
}

func (*StringEL) Concat

func (stringEL *StringEL) Concat(args ...interface{}) (interface{}, error)

func (*StringEL) Contains

func (stringEL *StringEL) Contains(args ...interface{}) (interface{}, error)

func (*StringEL) EndsWith

func (stringEL *StringEL) EndsWith(args ...interface{}) (interface{}, error)

func (*StringEL) EscapeXML10

func (stringEL *StringEL) EscapeXML10(args ...interface{}) (interface{}, error)

func (*StringEL) EscapeXML11

func (stringEL *StringEL) EscapeXML11(args ...interface{}) (interface{}, error)

func (*StringEL) GetELFunctionDefinitions

func (stringEL *StringEL) GetELFunctionDefinitions() map[string]govaluate.ExpressionFunction

func (*StringEL) IndexOf

func (stringEL *StringEL) IndexOf(args ...interface{}) (interface{}, error)

func (*StringEL) Length

func (stringEL *StringEL) Length(args ...interface{}) (interface{}, error)

func (*StringEL) RegExCapture

func (stringEL *StringEL) RegExCapture(args ...interface{}) (interface{}, error)

func (*StringEL) Replace

func (stringEL *StringEL) Replace(args ...interface{}) (interface{}, error)

func (*StringEL) ReplaceAll

func (stringEL *StringEL) ReplaceAll(args ...interface{}) (interface{}, error)

func (*StringEL) Split

func (stringEL *StringEL) Split(args ...interface{}) (interface{}, error)

func (*StringEL) StartsWith

func (stringEL *StringEL) StartsWith(args ...interface{}) (interface{}, error)

func (*StringEL) Substring

func (stringEL *StringEL) Substring(args ...interface{}) (interface{}, error)

func (*StringEL) ToLower

func (stringEL *StringEL) ToLower(args ...interface{}) (interface{}, error)

func (*StringEL) ToUpper

func (stringEL *StringEL) ToUpper(args ...interface{}) (interface{}, error)

func (*StringEL) Trim

func (stringEL *StringEL) Trim(args ...interface{}) (interface{}, error)

func (*StringEL) Truncate

func (stringEL *StringEL) Truncate(args ...interface{}) (interface{}, error)

func (*StringEL) UnescapeJava

func (stringEL *StringEL) UnescapeJava(args ...interface{}) (interface{}, error)

func (*StringEL) UnescapeXML

func (stringEL *StringEL) UnescapeXML(args ...interface{}) (interface{}, error)

func (*StringEL) UrlEncode

func (stringEL *StringEL) UrlEncode(args ...interface{}) (interface{}, error)

func (*StringEL) Uuid

func (stringEL *StringEL) Uuid(args ...interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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