functiondefinitions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFunctionDefinitionsFromPackage

func ExtractFunctionDefinitionsFromPackage(content string) error

ExtractFunctionDefinitionsFromPackage parses the given file for public functions and populates internalstates.AvailableFunctions. The function definitions are stored in the internalstates.AvailableFunctions map. The key is the function name and the value is a FunctionDefinition struct. The FunctionDefinition struct contains the function's name, description, package, inputs, and outputs. The inputs and outputs are stored as FunctionInput and FunctionOutput structs, respectively. The FunctionInput and FunctionOutput structs contain the name, type, and GoType of the input/output. The GoType is the Go type of the input/output, while the Type is a simplified type string (e.g., "string", "number", "boolean", "json").

The function returns an error if the file cannot be parsed.

Parameters:

  • packagePath: the path to the package file to parse.

Returns:

  • error: an error if the file cannot be parsed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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