feat: align google and relay providers

This commit is contained in:
lpf
2026-03-12 20:26:16 +08:00
parent e405d410c9
commit 1e9e4d8459
29 changed files with 6208 additions and 229 deletions

19
pkg/wsrelay/message.go Normal file
View File

@@ -0,0 +1,19 @@
package wsrelay
// Message represents the JSON payload exchanged with websocket clients.
type Message struct {
ID string `json:"id"`
Type string `json:"type"`
Payload map[string]any `json:"payload,omitempty"`
}
const (
MessageTypeHTTPReq = "http_request"
MessageTypeHTTPResp = "http_response"
MessageTypeStreamStart = "stream_start"
MessageTypeStreamChunk = "stream_chunk"
MessageTypeStreamEnd = "stream_end"
MessageTypeError = "error"
MessageTypePing = "ping"
MessageTypePong = "pong"
)