core

package
v1.6.4-d1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b reflect.Value) (interface{}, error)

func ConvertDecimalToType added in v1.6.0

func ConvertDecimalToType(newValue reflect.Value, toKind reflect.Type) (reflect.Value, error)

newValue 入参类型 toKind 期望类型

func Div

func Div(a, b reflect.Value) (interface{}, error)

func GetFunctionName added in v1.6.5

func GetFunctionName(i reflect.Value) string

func GetRawTypeValue

func GetRawTypeValue(rs []reflect.Value) (reflect.Value, error)

* todo 多返回值修改如下函数 if want to support multi return ,change this method implements

func GetStructAttributeValue

func GetStructAttributeValue(obj reflect.Value, fieldName string) (reflect.Value, error)

func GetWantedValue

func GetWantedValue(newValue reflect.Value, toKind reflect.Type) (reflect.Value, error)

newValue: 真实入参类型 toKind: 期望的入参类型

func InvokeFunction

func InvokeFunction(obj reflect.Value, methodName string, parameters []reflect.Value) (reflect.Value, error)

func IsNil

func IsNil(v interface{}) bool

func MakeDecimalByType added in v1.6.0

func MakeDecimalByType(val reflect.Value) (decimal.Decimal, string, error)

func Mul

func Mul(a, b reflect.Value) (interface{}, error)

func ParamsTypeChange

func ParamsTypeChange(f reflect.Value, params []reflect.Value) []reflect.Value

ParamsTypeChange 自定义算子函数入参的数据类型转换 @param f是定义的注入函数反射值,可以直接调用 @param params 是入参

func SetAttributeValue

func SetAttributeValue(obj reflect.Value, fieldName string, value reflect.Value) error

SetAttributeValue set field value value 就是右表达式的值,可能是decimal类型

func SetSingleValue

func SetSingleValue(obj reflect.Value, fieldName string, value reflect.Value) error

SetSingleValue 单值设置 @param obj是变量声明时候的默认类型 @param value是规则表达式中赋值的类型(会被转换成decimal)

func Sub

func Sub(a, b reflect.Value) (interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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