PocketBase view collection benutzen. Dokumentation aktualisieren.

This commit is contained in:
2026-07-14 20:06:19 +02:00
parent a1504dd5e6
commit b8b4e00b92
10 changed files with 162 additions and 138 deletions

View File

@@ -14,9 +14,8 @@ PocketBase bookmarks collection and reports their last-update times.
│ asserts JSON shape and entry count
├── internal/
│ ├── pocketbase/
│ │ └── client.go - Authenticates and queries the
│ │ /api/collections/bookmarks/records endpoint.
│ │ Accepts filter, perPage, and field params.
│ │ └── client.go - Queries the public PocketBase collection endpoint.
│ │ Accepts perPage and field params.
│ │ Returns a list of structs with URL fields.
│ ├── royalroad/
│ │ └── scraper.go - Given a URL, fetches the page, confirms it
@@ -33,13 +32,13 @@ PocketBase bookmarks collection and reports their last-update times.
│ │ └── relative.go - Computes "X minutes/hours/days/months/years
│ │ ago" strings from time.Time.
│ └── app.go - Orchestrates the full pipeline:
│ 1. Load credentials (compile-time vars).
│ 1. Load endpoint URL from compile-time var.
│ 2. Query PocketBase for URLs.
│ 3. Iterate URLs sequentially.
│ 4. Collect valid RoyalRoad results.
│ 5. Sort by dateModified descending.
│ 6. Dispatch to appropriate formatter.
├── .env - Real credentials (gitignored).
├── .env - Real endpoint URL (gitignored).
├── .env.example - Template showing required env vars.
├── .gitignore - Must include .env and the built binary.
├── Makefile - All build, test, and check targets.
@@ -71,8 +70,8 @@ PocketBase bookmarks collection and reports their last-update times.
- **No local Go installation.** Use `make` targets which wrap
`docker run --rm -v $(pwd):/src -w /src golang:1.22`.
- **Credential injection:** The Makefile reads `.env` and passes values as
`-ldflags '-X main.PB_URL=... -X main.PB_USER=... -X main.PB_PASSWORD=...'`.
- **Endpoint injection:** The Makefile reads `.env` and passes the value as
`-ldflags '-X main.PBURL=...'`.
- **Output:** The compiled binary is written to `./royalroadupdates` in the
repository root.
- **Targets:**