MCPcopy Create free account
hub / github.com/dearcode/candy / FileDownload

Method FileDownload

client/candy.go:319–327  ·  view source on GitHub ↗

FileDownload 文件下载

(key string)

Source from the content-addressed store, hash-verified

317
318// FileDownload 文件下载
319func (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 向服务器发送消息.
330func (c *CandyClient) SendMessage(group, to int64, body string) (int64, error) {

Callers 1

Calls 2

DownloadFileMethod · 0.65
ErrorMethod · 0.45

Tested by 1