| 5095 | } |
| 5096 | |
| 5097 | func (c *unixSocketClient) AgentChannelRecv( |
| 5098 | ctx context.Context, |
| 5099 | channel string, |
| 5100 | query AgentChannelRecvQuery, |
| 5101 | credentials agentidentity.Credentials, |
| 5102 | ) ([]AgentChannelMessageRecord, error) { |
| 5103 | var response contract.AgentChannelMessagesResponse |
| 5104 | path := "/api/agent/channels/" + url.PathEscape(strings.TrimSpace(channel)) + "/recv" |
| 5105 | if err := c.doAgentJSON( |
| 5106 | ctx, |
| 5107 | http.MethodGet, |
| 5108 | path, |
| 5109 | agentChannelRecvValues(query), |
| 5110 | nil, |
| 5111 | credentials, |
| 5112 | &response, |
| 5113 | ); err != nil { |
| 5114 | return nil, err |
| 5115 | } |
| 5116 | return response.Messages, nil |
| 5117 | } |
| 5118 | |
| 5119 | func (c *unixSocketClient) AgentChannelSend( |
| 5120 | ctx context.Context, |