Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComponentInfo ¶ added in v0.3.0
type ComponentInfo struct {
Name string `json:"name"`
File string `json:"file"`
Params []ComponentParam `json:"params"`
Children bool `json:"children"`
}
ComponentInfo represents a templ component with its signature.
type ComponentParam ¶ added in v0.3.0
ComponentParam represents a parameter of a templ component.
type ComponentType ¶ added in v0.3.0
ComponentType represents a Go type defined alongside components.
type ComponentsResult ¶ added in v0.3.0
type ComponentsResult struct {
Components []ComponentInfo `json:"components"`
Types []ComponentType `json:"types,omitempty"`
}
ComponentsResult holds all parsed components and their associated types.
func ParseComponents ¶ added in v0.3.0
func ParseComponents(componentsDir string) (*ComponentsResult, error)
ParseComponents scans .templ files in componentsDir and extracts component signatures, whether they accept children, and Go types.
type ControllerFunc ¶
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 ¶
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 ¶
ModelInfo represents a Go model struct.
func ParseModels ¶
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 ¶
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).