core

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: BSD-3-Clause Imports: 6 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)

func Div

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

func GetRawTypeValue

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

* 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

number type exchange f是定义的注入函数的类型,根据入参个数,轮询参数并拿到参数类型

func SetAttributeValue

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

* set field value value 就是右表达式的值,即可能是decimal

func SetSingleValue

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

set single value

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