Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router handles the registration and management of routes in the application.
func (*Router) DiscoverAndRegisterRoutes ¶
DiscoverAndRegisterRoutes automatically discovers and registers all routes in the pages and components directories.
Returns: - error: An error if discovery or registration fails, nil otherwise.
func (*Router) RegisterRoute ¶
RegisterRoute automatically registers a route based on the file name and location. It determines if it's a page or component, imports the corresponding Params struct, and sets up the route with the correct handler.
Parameters: - filePath: The path to the .templ.go file, relative to the project root.
Returns: - error: An error if registration fails, nil otherwise.