modulepackage
0.0.0-20240311064108-2a7e695ea0c2
Repository: https://github.com/b85bagent/rabbitmq.git
Documentation: pkg.go.dev
# README
RPC 回應 API 文檔
概述
RPCResponse
是我們用於遠程過程調用(RPC)操作的標準結構。該結構提供了關於調用結果的詳細資訊,包括其狀態、消息、時間戳、處理隊列,以及關聯ID。
欄位
欄位名稱 | 類型 | 描述 | 可能的值 |
---|---|---|---|
Status | string | 描述回應的狀態。 | Success (成功), Failed (失敗) |
StatusCode | int | 回應的狀態碼。 | 200 表示成功, 400 表示錯誤 |
Response | json{} map[string]interface{} | RCP端接收後,程式處理的回應詳細資料。 | message: 成功或錯誤的詳細消息,\ data:{} 接收RCP後要回傳的資料 |
CorrelationId | string | 用於關聯RPC的請求和回應的唯一標識符。 | 例如 "88c2a620-5096-4a80-a089-11d7dab6d76e" |
Timestamp | time.Time | 回應創建的確切時間。 | 當下時間 |
Queue | string | 處理該請求的隊列。 | 隊列標識符 |
欄位描述
-
Status (狀態):此欄位快速顯示操作是否成功或失敗。
-
StatusCode (狀態碼):更細緻的狀態表示。
200
表示操作成功,而400
表示出現錯誤或異常。 -
Response (回應):對於處理此訊息的詳細結果,例如對於
Success
狀態,此欄位可能提供確認消息。對於Failed
,它將提供失敗的詳細原因。以及其他可能的回傳消息/狀態。 -
CorrelationId (關聯ID):這是一個唯一標識符,主要用於關聯RPC的請求和回應。當客戶端發送一個請求到伺服器,它將生成一個唯一的
CorrelationId
。當伺服器回應時,它會使用相同的CorrelationId
,這樣客戶端可以確定哪些回應是與其原始請求匹配的。 -
Timestamp (時間戳):表示回應生成的確切時刻,對於日誌和跟踪非常有用。
-
Queue (隊列):在多隊列設置中,此欄位告知哪一個特定隊列處理並處理了RPC請求。
# Packages
No description provided by the author
# Functions
Consume for rabbitMQ messages , rpc mode.
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author