summaryrefslogtreecommitdiff
path: root/internal/cli
AgeCommit message (Collapse)Author
2026-04-14refactor(cli): split run* handlers into files (ask 24)Paul Buetow
Move runImport, runQuery, runReportFromFiles, runDaemon, runCreateClientKey, and runTests into dedicated cmd_*.go files. Keep Execute routing in cli.go. defaultListenFromEnv stays with daemon. Made-with: Cursor
2026-04-14fix: shadowing, version.Tag, prealloc LoadRecords (ask 54)Paul Buetow
- CreateKey: avoid shadowing named return err on rand.Read - daemon Run: rename slog logger to slogLog vs stdlib log package - version: rename Version to Tag to avoid version.Version stutter - LoadRecords: COUNT(*) then make slice with capacity Made-with: Cursor
2026-04-14refactor: drop goprecords DB pass-through, use storage from CLI (x3)Paul Buetow
Remove OpenDB/CreateSchema/ResetRecords/ImportFromDir/ImportFromFS wrappers and sqlite blank import from goprecords; keep LoadAggregates. CLI and integration tests call storage.* directly. Storage-focused tests live under internal/storage. Made-with: Cursor
2026-04-14test: microservice coverage for task 63Paul Buetow
Add table-driven HTTP and unit tests for report (all formats, negatives), upload/auth boundaries, upload helpers, readiness, Run and logging. Extend authkeys tests for Close, CreateKey validation, and post-close errors. Add CLI tests for defaultListenFromEnv and create-client-key with -auth-db only. Add mage CoverMicroservice for local/CI-style coverage measurement. Use context.Background and os.Chdir for Go 1.21-compatible tests. Made-with: Cursor
2026-04-14task 13: upload API keys in SQLite, Bearer auth, create-client-key CLIPaul Buetow
- Add internal/authkeys with SHA-256 hashed tokens and KeyCount gate - PUT /upload/{host}/{kind} for uptimed files; auth when any key exists - Daemon -auth-db and Config.AuthDB; plain HTTP unchanged - CLI: goprecords --create-client-key HOSTNAME (-stats-dir|-auth-db) Made-with: Cursor
2026-04-14daemon: stdout-only slog logging for HTTP (task 43)Paul Buetow
- Route http.Server ErrorLog and request access lines through slog text to stdout (or Config.LogOutput for tests). - Log daemon_listen on start and http_request per request (method, path, status, duration_ms). - CLI daemon: flag usage and missing-stats-dir message on stdout. Made-with: Cursor
2026-04-14test(x2): codify CLI backward-compatibility contractPaul Buetow
- Add internal/cli tests for stable entry points: -version/--version, file-based report (-stats-dir), import/query, test subcommand, -daemon/--daemon validation, and subcommand recognition. - Assert RegisterReportFlags keeps required flag names and defaults (CLI/HTTP). - Run integration import/export against a temp SQLite file instead of fixtures/test_import.db to avoid flaky readonly errors under parallel tests. Made-with: Cursor
2026-04-14Add --daemon plain HTTP server (y2)Paul Buetow
Long-lived goprecords --daemon with -stats-dir and -listen, env GOPRECORDS_STATS_DIR and GOPRECORDS_LISTEN. Serves GET /health and GET /report (query params match report flags). Uses standard http.Server; no TLS. Made-with: Cursor
2026-03-08fix package namesPaul Buetow
2026-03-03refactor(context): propagate context through db open and io scans (task 333)Paul Buetow
2026-03-03refactor(cli): move main orchestration into internal cli package (task 332)Paul Buetow