parser

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEnv

func ParseEnv(projectDir string) []string

ParseEnv reads .env (or .env.example) and returns the list of variable names (no values).

Types

type ControllerFunc

type ControllerFunc struct {
	Name string `json:"name"`
	File string `json:"file"`
}

ControllerFunc represents a function in a controller package.

type ControllerInfo

type ControllerInfo struct {
	Package   string           `json:"package"`
	Functions []ControllerFunc `json:"functions"`
}

ControllerInfo represents a controller package with its functions.

func ParseControllers

func ParseControllers(controllersDir string) ([]ControllerInfo, error)

ParseControllers scans the controllers directory for Go files and extracts exported function names grouped by package (subdirectory).

type FieldInfo

type FieldInfo struct {
	Name string `json:"name"`
	Type string `json:"type"`
	JSON string `json:"json,omitempty"`
	GORM string `json:"gorm,omitempty"`
}

FieldInfo represents a struct field in a model.

type LogEntry

type LogEntry struct {
	Time    string `json:"t,omitempty"`
	Level   string `json:"l,omitempty"`
	Status  int    `json:"s,omitempty"`
	Method  string `json:"m,omitempty"`
	Path    string `json:"p,omitempty"`
	Dur     string `json:"d,omitempty"`
	Error   string `json:"e,omitempty"`
	Message string `json:"msg,omitempty"`
}

LogEntry represents a compact log entry for the get_logs tool.

type MiddlewareInfo

type MiddlewareInfo struct {
	Name string `json:"name"`
	File string `json:"file"`
}

MiddlewareInfo represents a middleware function.

func ParseMiddleware

func ParseMiddleware(middlewareDir string) ([]MiddlewareInfo, error)

ParseMiddleware scans the middleware directory for Go files and extracts exported function names.

type ModelInfo

type ModelInfo struct {
	Name   string      `json:"name"`
	Fields []FieldInfo `json:"fields"`
}

ModelInfo represents a Go model struct.

func ParseModels

func ParseModels(modelsDir string) ([]ModelInfo, error)

ParseModels parses all .go files in the models directory and extracts struct definitions.

type ProjectOverview

type ProjectOverview struct {
	Module  string   `json:"module"`
	Go      string   `json:"go"`
	DB      string   `json:"db,omitempty"`
	Port    string   `json:"port,omitempty"`
	Plugins []string `json:"plugins,omitempty"`
	Dirs    []string `json:"dirs,omitempty"`
}

ProjectOverview holds a summary of the Catuaba project.

type RouteInfo

type RouteInfo struct {
	Method     string   `json:"method"`
	Path       string   `json:"path"`
	Handler    string   `json:"handler"`
	Middleware []string `json:"middleware,omitempty"`
}

RouteInfo represents a single route in the project.

func ParseRoutes

func ParseRoutes(filePath string) ([]RouteInfo, error)

ParseRoutes parses a config/routes.go file and extracts route definitions. It looks for method calls like r.GET("/path", handler) or api.POST("/path", handler).

Jump to

Keyboard shortcuts

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