package web import ( "context" "net/http" "nfeeder/internal/db" ) type Server struct { httpServer *http.Server store *db.Store } func NewServer(store *db.Store) *Server { s := &Server { store: store, } s.httpServer = &http.Server { Handler: s.setupRoutes(), } return s } func (s *Server) Start(addr string) error { s.httpServer.Addr = addr return s.httpServer.ListenAndServe() } func (s *Server) Shutdown(ctx context.Context) error { return s.httpServer.Shutdown(ctx) }