Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func InitServer ¶ added in v0.3.0
func (*Server) Start ¶ added in v0.4.0
Start initializes the server, sets up routes and middlewares, and starts listening for incoming requests.
This method:
- Initializes analytics.
- Configures the echo server with recovery, logging, and CORS middleware.
- Sets up various routes, including serving static files for the dashboard and a swagger UI.
- Starts the echo server and manages its lifecycle with background goroutines.
- Gracefully shuts down the server on context cancellation.
- Closes database connections and other resources.
Parameters:
- ctx: A context.Context used to control the server's lifecycle and propagate cancellation.
- exitErr: A channel that receives the terminal error (or nil) once the server has shut down.
Returns:
- An error if there is an issue during the initialization phase, otherwise nil.
Click to show internal directories.
Click to hide internal directories.