FileDownload 文件下载
(key string)
| 317 | |
| 318 | // FileDownload 文件下载 |
| 319 | func (c *CandyClient) FileDownload(key string) ([]byte, error) { |
| 320 | req := &meta.GateDownloadFileRequest{Names: []string{key}} |
| 321 | resp, err := c.api.DownloadFile(context.Background(), req) |
| 322 | if err != nil { |
| 323 | return nil, err |
| 324 | } |
| 325 | |
| 326 | return resp.Files[key], resp.Header.Error() |
| 327 | } |
| 328 | |
| 329 | // SendMessage 向服务器发送消息. |
| 330 | func (c *CandyClient) SendMessage(group, to int64, body string) (int64, error) { |