Documentation ¶
Overview ¶
Package router provides functionality to set up and run the HTTP server, manage routes, and apply middleware based on access levels.
It configures and initializes routes with varying access requirements: - Public routes: Accessible without authentication. - Protected routes: Require authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string // Address to listen on BaseURL string // Base URL for API routes RestfullControllers []api.IController // List of controllers GraphQlController http.Handler AuthorizationMiddleware func(http.Handler) http.Handler PopulateClaimsMiddleware func(http.Handler) http.Handler RateLimitMiddleware func(http.Handler) http.Handler }
Config holds configuration settings for creating a new Router instance.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router manages the HTTP server and its dependencies, including controllers and JWT authentication.
func NewRouter ¶
NewRouter creates a new Router instance with the given configuration. It initializes the router with address, base URL, controllers, and JWT service.
Click to show internal directories.
Click to hide internal directories.