splitted go and expr function bindings in dedicated source files

This commit is contained in:
2024-06-09 10:41:06 +02:00
parent 9df9ad5dd1
commit 33d70d6d1a
3 changed files with 63 additions and 53 deletions
+19
View File
@@ -0,0 +1,19 @@
// Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.
// bind-go-function.go
package expr
// ---- Linking with Go functions
type golangFunctor struct {
baseFunctor
f FuncTemplate
}
func NewGolangFunctor(f FuncTemplate) *golangFunctor {
return &golangFunctor{f: f}
}
func (functor *golangFunctor) Invoke(ctx ExprContext, name string, args []any) (result any, err error) {
return functor.f(ctx, name, args)
}