internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version           = "1.1.0"
	FunctionMarker    = "//go:ahead functions"
	CommentPattern    = `^\s*//\s*:([^:]+)(?::(.*))?`
	ExecutionTemplate = `` /* 278-byte string literal not displayed */

)

Variables

View Source
var (
	GoInstallPaths = []string{
		"/usr/lib/go",
		"/usr/local/go",
		"/opt/go",
		"\\Go\\",
	}
	SystemPaths = []string{
		"/runtime/",
		"/internal/",
		"/vendor/",
		"/pkg/mod/",

		"\\runtime\\",
		"\\internal\\",
		"\\vendor\\",
		"\\pkg\\mod\\",
	}
)

Functions

func FilterUserFiles

func FilterUserFiles(files []string) []string

func FindCommonDir

func FindCommonDir(files []string) string

func RunCodegen

func RunCodegen(dir string, verbose bool) error

Types

type CodeProcessor

type CodeProcessor struct {
	// contains filtered or unexported fields
}

func NewCodeProcessor

func NewCodeProcessor(ctx *ProcessorContext, executor *FunctionExecutor) *CodeProcessor

func (*CodeProcessor) ProcessFile

func (cp *CodeProcessor) ProcessFile(filePath string, verbose bool) error

type Config

type Config struct {
	Dir     string
	Verbose bool
	Help    bool
	Version bool
}

type FileProcessor

type FileProcessor struct {
	// contains filtered or unexported fields
}

func NewFileProcessor

func NewFileProcessor(ctx *ProcessorContext) *FileProcessor

func (*FileProcessor) FindFunctionFiles

func (fp *FileProcessor) FindFunctionFiles(dir string) error

func (*FileProcessor) IsFunctionFile

func (fp *FileProcessor) IsFunctionFile(path string) bool

func (*FileProcessor) LoadUserFunctions

func (fp *FileProcessor) LoadUserFunctions() error

func (*FileProcessor) ProcessDirectory

func (fp *FileProcessor) ProcessDirectory(dir string, verbose bool, codeProcessor *CodeProcessor) error

type FunctionExecutor

type FunctionExecutor struct {
	// contains filtered or unexported fields
}

func NewFunctionExecutor

func NewFunctionExecutor(ctx *ProcessorContext) *FunctionExecutor

func (*FunctionExecutor) ExecuteFunction

func (fe *FunctionExecutor) ExecuteFunction(funcName string, argsStr string) (string, error)

func (*FunctionExecutor) Prepare

func (fe *FunctionExecutor) Prepare() error

type ProcessorContext

type ProcessorContext struct {
	Functions       map[string]*UserFunction
	FileSet         *token.FileSet
	CurrentFile     string
	FuncFiles       []string
	TempDir         string
	ImportOverrides map[string]string
}

type ToolexecManager

type ToolexecManager struct{}

func NewToolexecManager

func NewToolexecManager() *ToolexecManager

func (*ToolexecManager) RunAsToolexec

func (tm *ToolexecManager) RunAsToolexec()

RunAsToolexec esegue goahead come wrapper toolexec

type UserFunction

type UserFunction struct {
	Name       string
	InputTypes []string
	OutputType string
	FilePath   string
}

Jump to

Keyboard shortcuts

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