MCPcopy Index your code
hub / github.com/dearcode/candy / downloadFile

Method downloadFile

gate/store.go:179–193  ·  view source on GitHub ↗
(userID int64, names []string)

Source from the content-addressed store, hash-verified

177}
178
179func (s *store) downloadFile(userID int64, names []string) (map[string][]byte, error) {
180 log.Debugf("store downloadFile, userID:%v", userID)
181 req := &meta.StoreDownloadFileRequest{
182 Header: &meta.RequestHeader{User: userID},
183 Names: names,
184 }
185
186 resp, err := s.api.DownloadFile(s.ctx, req)
187 if err != nil {
188 return nil, errors.Trace(err)
189 }
190 log.Debugf("store downloadFile finished, userID:%v, err:%v", userID, resp.Header.Error())
191
192 return resp.Files, errors.Trace(resp.Header.Error())
193}
194
195func (s *store) newMessage(msg *meta.Message) error {
196 log.Debugf("store newMessage[%d]:%+v", msg.ID, msg)

Callers 1

DownloadFileMethod · 0.80

Calls 2

DownloadFileMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected