Implement web API foundation
Add application container, Gin router, graceful shutdown handler, and version endpoint. This establishes the skeleton for the WebDisk HTTP API as described in the architecture. - Add internal/app/WebApp for runtime dependencies and version - Add internal/server/router with GET /api/v1/version route - Add graceful shutdown runner with signal handling in cmd/serve - Add internal/api/ErrorResponse for standard HTTP error body - Update roadmap, architecture, and decisions documentation
This commit is contained in:
19
internal/app/webapp.go
Normal file
19
internal/app/webapp.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/dhao2001/mygo/internal/config"
|
||||
)
|
||||
|
||||
// WebApp contains application-wide runtime dependencies and metadata.
|
||||
type WebApp struct {
|
||||
Config *config.Config
|
||||
Version string
|
||||
}
|
||||
|
||||
// NewWebApp creates the application dependency container for the HTTP server.
|
||||
func NewWebApp(cfg *config.Config) *WebApp {
|
||||
return &WebApp{
|
||||
Config: cfg,
|
||||
Version: AppVersion,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user