- Add Server struct with store Store and webhookSecret fields - Add NewServer constructor - Convert all 6 handler functions to methods on *Server - Replace all inline SQL with s.store.X() calls - Remove package-level globals db, mu, webhookSecret - Remove InitDB, SetWebhookSecret, UpdateEvent, GetUpdates functions - Update export_test.go: replace old helpers with NewTestServer, NewTestServerWithSecret, TestUpsertEvent, TestGetUpdatesMap - Update main.go: sql.Open -> RunMigrations -> NewSQLiteStore -> NewServer -> routes
1.9 KiB
1.9 KiB