-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi_spec.json
More file actions
1 lines (1 loc) · 10.8 KB
/
api_spec.json
File metadata and controls
1 lines (1 loc) · 10.8 KB
1
{"openapi":"3.0.0","components":{"schemas":{"dev_ctr_hello.api.file.v1.FileDownloadReq":{"properties":{"id":{"description":"File ID","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.file.v1.FileDownloadRes":{"properties":{},"type":"object"},"dev_ctr_hello.api.file.v1.FileDeleteReq":{"properties":{"id":{"description":"File ID","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.file.v1.FileDeleteRes":{"properties":{"message":{"description":"Message","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.file.v1.FileMetadataReq":{"properties":{"id":{"description":"File ID","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.file.v1.FileMetadataRes":{"properties":{"id":{"description":"File ID","format":"string","properties":{},"type":"string"},"name":{"description":"File name","format":"string","properties":{},"type":"string"},"size":{"description":"File size","format":"int64","properties":{},"type":"integer"},"content_type":{"description":"Content type","format":"string","properties":{},"type":"string"},"upload_time":{"description":"Upload time","format":"string","properties":{},"type":"string"},"expires_at":{"description":"Expiration time","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvListReq":{"properties":{"limit":{"format":"int64","properties":{},"type":"integer"},"offset":{"format":"int64","properties":{},"type":"integer"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvListRes":{"properties":{"items":{"description":"KV items","format":"[]v1.KvItem","items":{"$ref":"#/components/schemas/dev_ctr_hello.api.kv.v1.KvItem"},"properties":{},"type":"array"},"total":{"description":"Total count","format":"int64","properties":{},"type":"integer"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvItem":{"properties":{"key":{"description":"Key","format":"string","properties":{},"type":"string"},"value":{"description":"Value","format":"string","properties":{},"type":"string"},"expires_at":{"description":"Expiration time","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvSetReq":{"properties":{"key":{"description":"Key","format":"string","properties":{},"type":"string"},"value":{"description":"Value","format":"string","properties":{},"type":"string"},"ttl":{"format":"int64","properties":{},"type":"integer"}},"required":["key","value"],"type":"object"},"dev_ctr_hello.api.kv.v1.KvSetRes":{"properties":{"message":{"description":"Message","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvDeleteReq":{"properties":{"key":{"description":"Key","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvDeleteRes":{"properties":{"message":{"description":"Message","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvGetReq":{"properties":{"key":{"description":"Key","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.kv.v1.KvGetRes":{"properties":{"key":{"description":"Key","format":"string","properties":{},"type":"string"},"value":{"description":"Value","format":"string","properties":{},"type":"string"},"expires_at":{"description":"Expiration time","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.file.v1.FileUploadReq":{"properties":{"file":{"description":"File to upload","format":"*ghttp.UploadFile","properties":{},"type":"file"},"ttl":{"default":"1h","description":"Expiration time (e.g., 2h, 30m)","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.file.v1.FileUploadRes":{"properties":{"id":{"description":"File ID","format":"string","properties":{},"type":"string"},"name":{"description":"File name","format":"string","properties":{},"type":"string"},"size":{"description":"File size","format":"int64","properties":{},"type":"integer"},"content_type":{"description":"Content type","format":"string","properties":{},"type":"string"},"extension":{"description":"File extension","format":"string","properties":{},"type":"string"},"upload_time":{"description":"Upload time","format":"string","properties":{},"type":"string"},"expires_at":{"description":"Expiration time","format":"string","properties":{},"type":"string"},"download_url":{"description":"Download URL","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.ws.v1.WsConnectReq":{"properties":{"token":{"description":"WebSocket connection token","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.ws.v1.WsConnectRes":{"properties":{"message":{"description":"Message","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.ws.v1.WsBroadcastReq":{"properties":{"message":{"description":"Message content","format":"string","properties":{},"type":"string"},"room":{"description":"Room ID, empty means broadcast to all","format":"string","properties":{},"type":"string"}},"required":["message"],"type":"object"},"dev_ctr_hello.api.ws.v1.WsBroadcastRes":{"properties":{"status":{"description":"Status","format":"string","properties":{},"type":"string"},"message":{"description":"Message content","format":"string","properties":{},"type":"string"},"room":{"description":"Room ID","format":"string","properties":{},"type":"string"}},"type":"object"},"dev_ctr_hello.api.ws.v1.WsRoomsReq":{"properties":{},"type":"object"},"dev_ctr_hello.api.ws.v1.WsRoomsRes":{"properties":{"rooms":{"description":"Room info","format":"[]v1.RoomInfo","items":{"$ref":"#/components/schemas/dev_ctr_hello.api.ws.v1.RoomInfo"},"properties":{},"type":"array"},"count":{"description":"Total count","format":"int","properties":{},"type":"integer"}},"type":"object"},"dev_ctr_hello.api.ws.v1.RoomInfo":{"properties":{"room_id":{"description":"Room ID","format":"string","properties":{},"type":"string"},"client_count":{"description":"Client count","format":"int","properties":{},"type":"integer"}},"type":"object"},"dev_ctr_hello.api.ws.v1.WsStatsReq":{"properties":{},"type":"object"},"dev_ctr_hello.api.ws.v1.WsStatsRes":{"properties":{"total_connections":{"description":"Total connections","format":"int64","properties":{},"type":"integer"},"active_connections":{"description":"Active connections","format":"int","properties":{},"type":"integer"},"messages_sent":{"description":"Messages sent","format":"int64","properties":{},"type":"integer"},"messages_received":{"description":"Messages received","format":"int64","properties":{},"type":"integer"},"total_rooms":{"description":"Total rooms","format":"int","properties":{},"type":"integer"}},"type":"object"}}},"info":{"title":"","version":""},"paths":{"/api/v1/download/:id":{"get":{"parameters":[{"description":"File ID","in":"query","name":"id","schema":{"description":"File ID","format":"string","properties":{},"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.file.v1.FileDownloadRes"}}},"description":""}},"summary":"Download file","tags":["File"]}},"/api/v1/file/:id":{"delete":{"parameters":[{"description":"File ID","in":"query","name":"id","schema":{"description":"File ID","format":"string","properties":{},"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.file.v1.FileDeleteRes"}}},"description":""}},"summary":"Delete file","tags":["File"]}},"/api/v1/file/:id/metadata":{"get":{"parameters":[{"description":"File ID","in":"query","name":"id","schema":{"description":"File ID","format":"string","properties":{},"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.file.v1.FileMetadataRes"}}},"description":""}},"summary":"Get file metadata","tags":["File"]}},"/api/v1/kv":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"format":"int64","properties":{},"type":"integer"}},{"in":"query","name":"offset","schema":{"format":"int64","properties":{},"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.kv.v1.KvListRes"}}},"description":""}},"summary":"List all KV","tags":["KV"]},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.kv.v1.KvSetReq"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.kv.v1.KvSetRes"}}},"description":""}},"summary":"Set KV","tags":["KV"]}},"/api/v1/kv/:key":{"delete":{"parameters":[{"description":"Key","in":"query","name":"key","schema":{"description":"Key","format":"string","properties":{},"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.kv.v1.KvDeleteRes"}}},"description":""}},"summary":"Delete KV","tags":["KV"]},"get":{"parameters":[{"description":"Key","in":"query","name":"key","schema":{"description":"Key","format":"string","properties":{},"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.kv.v1.KvGetRes"}}},"description":""}},"summary":"Get KV","tags":["KV"]}},"/api/v1/upload":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.file.v1.FileUploadReq"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.file.v1.FileUploadRes"}}},"description":""}},"summary":"Upload file","tags":["File"]}},"/api/v1/ws":{"get":{"parameters":[{"description":"WebSocket connection token","in":"query","name":"token","schema":{"description":"WebSocket connection token","format":"string","properties":{},"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.ws.v1.WsConnectRes"}}},"description":""}},"summary":"WebSocket connection","tags":["WebSocket"]}},"/api/v1/ws/broadcast":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.ws.v1.WsBroadcastReq"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.ws.v1.WsBroadcastRes"}}},"description":""}},"summary":"Broadcast message","tags":["WebSocket"]}},"/api/v1/ws/rooms":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.ws.v1.WsRoomsRes"}}},"description":""}},"summary":"Get room stats","tags":["WebSocket"]}},"/api/v1/ws/stats":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dev_ctr_hello.api.ws.v1.WsStatsRes"}}},"description":""}},"summary":"Get WebSocket stats","tags":["WebSocket"]}}}}