fetch_ml/internal/api
Jeremie Fraeys 96dd604789
feat: implement WebSocket binary protocol and NOT_IMPLEMENTED error code
Add CodeNotImplemented error constant (HTTP 501) for planned but unavailable features.

Refactor WebSocket packet handling from JSON to binary protocol for improved efficiency:

New packet structure:
- PacketTypeSuccess (0x00): [type:1][json_data:var]
- PacketTypeError (0x01): [type:1][code_len:1][code:var][msg_len:2][msg:var][details_len:2][details:var]
- PacketTypeData (0x02): Reserved for future use

Update SendErrorPacket:
- Build binary error packets with length-prefixed fields
- Use WriteMessage with websocket.BinaryMessage

Update SendSuccessPacket:
- Marshal data to JSON then wrap in binary packet
- Eliminates "success" wrapper field for cleaner protocol

Add helper functions:
- NewNotImplemented(feature) - Standard 501 error
- NewNotImplementedWithIssue(feature, issueURL) - 501 with GitHub reference
2026-03-12 16:40:23 -04:00
..
audit feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
datasets feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
errors feat: implement WebSocket binary protocol and NOT_IMPLEMENTED error code 2026-03-12 16:40:23 -04:00
groups feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
helpers refactor: co-locate api, audit, auth tests with source code 2026-03-12 16:34:54 -04:00
jobs feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
jupyter feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
middleware feat(api): add groups and tokens handlers, refactor routes 2026-03-08 12:51:25 -04:00
plugins feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
responses feat(api): add groups and tokens handlers, refactor routes 2026-03-08 12:51:25 -04:00
scheduler feat(scheduler): implement capability-based routing and hub v2 2026-03-12 12:00:05 -04:00
tokens feat(auth): add token-based access and structured logging 2026-03-08 12:51:07 -04:00
validate feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
ws refactor: co-locate api, audit, auth tests with source code 2026-03-12 16:34:54 -04:00
adapter.go feat(auth): add token-based access and structured logging 2026-03-08 12:51:07 -04:00
duplicate_detection_process_test.go refactor: co-locate api, audit, auth tests with source code 2026-03-12 16:34:54 -04:00
factory.go feat(auth): add token-based access and structured logging 2026-03-08 12:51:07 -04:00
health.go feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
metrics_middleware.go feat(api): refactor websocket handlers; add health and prometheus middleware 2026-01-05 12:31:07 -05:00
middleware.go feat(api): add groups and tokens handlers, refactor routes 2026-03-08 12:51:25 -04:00
monitoring_config.go feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
protocol.go refactor(api): overhaul WebSocket handler and protocol layer 2026-03-12 12:01:21 -04:00
routes.go feat(auth): add token-based access and structured logging 2026-03-08 12:51:07 -04:00
server.go api: regenerate OpenAPI types and server code 2026-03-04 13:23:34 -05:00
server_config.go feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
server_gen.go feat(api): add structured error package and refactor handlers 2026-03-12 12:04:46 -04:00
spec_embed.go feat(api): add groups and tokens handlers, refactor routes 2026-03-08 12:51:25 -04:00
ws_jobs_args_test.go refactor: co-locate api, audit, auth tests with source code 2026-03-12 16:34:54 -04:00
ws_jupyter_test.go refactor: co-locate api, audit, auth tests with source code 2026-03-12 16:34:54 -04:00
ws_protocol.go refactor: improve API structure and WebSocket protocol 2026-02-16 20:38:12 -05:00
ws_test.go refactor: co-locate api, audit, auth tests with source code 2026-03-12 16:34:54 -04:00