AI generated READMEs
This commit is contained in:
40
mock/README.md
Normal file
40
mock/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Kordophone Mock Server (Go)
|
||||
|
||||
A lightweight mock of the Kordophone macOS server for local development and tests. It emulates the REST API and updates stream, and seeds itself with sample conversations/messages/attachments.
|
||||
|
||||
## Build & Run
|
||||
|
||||
Requirements: Go 1.20+
|
||||
|
||||
```bash
|
||||
cd mock
|
||||
go run ./... # quick run
|
||||
|
||||
# or build a binary
|
||||
make # outputs ./kordophone-mock
|
||||
./kordophone-mock
|
||||
```
|
||||
|
||||
Flags:
|
||||
|
||||
- `--debug` — enable debug logging
|
||||
- `--auth` — require authentication (Bearer token via `/authenticate`)
|
||||
|
||||
Listens on `http://localhost:5738` by default.
|
||||
|
||||
## API Surface (mocked)
|
||||
|
||||
- `GET /version` — server version
|
||||
- `GET /status` — status (requires auth when enabled)
|
||||
- `GET /conversations` — list conversations
|
||||
- `GET /messages?guid=...&beforeDate=...&beforeMessageGUID=...&afterMessageGUID=...&limit=...` — list messages
|
||||
- `POST /authenticate` — exchange username/password for a bearer token (when `--auth`)
|
||||
- `POST /sendMessage` — send a message
|
||||
- `POST /markConversation?guid=...` — mark read
|
||||
- `GET /attachment?guid=...` — download attachment
|
||||
- `POST /uploadAttachment?filename=...` — upload attachment
|
||||
- `GET /pollUpdates?seq=...` — long‑poll for updates
|
||||
- `GET /updates` — WebSocket updates
|
||||
|
||||
Note: `/api/*` paths are redirected to the same endpoints for compatibility.
|
||||
|
||||
Reference in New Issue
Block a user