Documentation
¶
Index ¶
- type Call
- type Callable
- type Definition
- type FuncInfo
- type Function
- func (f *Function) Call(params *Params, ignoreParams ...any) (resultInterfaces []any, err error)
- func (f *Function) GetCallable(p *Params) (Callable, error)
- func (f *Function) GetDef() *Definition
- func (f *Function) GetFn() any
- func (f *Function) GetIgnoreIdx() []int
- func (f *Function) GetName() string
- func (f *Function) GetOrGenFuncInfo() (*FuncInfo, error)
- type ParamInfo
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct {
Name string `json:"name"` // function name should be unique
Description string `json:"description"`
Parameters any `json:"parameters"`
}
Definition provides the calling information of a function
func (*Definition) String ¶
func (d *Definition) String() string
type FuncInfo ¶
type FuncInfo struct {
Name string `json:"name"`
Comments string `json:"comments"`
SourceCode string `json:"source_code"`
Params map[string]ParamInfo `json:"-"` // ignore by json
}
func GetFunctionDetails ¶
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function struct stores the registered function
func CreateFunction ¶
func CreateFunction(fn any, def Definition, ignoreIdx ...int) (*Function, error)
CreateFunction creates a Function from a function
func (*Function) GetDef ¶
func (f *Function) GetDef() *Definition
func (*Function) GetIgnoreIdx ¶
func (*Function) GetOrGenFuncInfo ¶
Click to show internal directories.
Click to hide internal directories.