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

Method uploadFile

gate/store.go:147–161  ·  view source on GitHub ↗
(userID int64, data []byte)

Source from the content-addressed store, hash-verified

145}
146
147func (s *store) uploadFile(userID int64, data []byte) error {
148 log.Debugf("store UploadFile, userID:%v", userID)
149 req := &meta.StoreUploadFileRequest{
150 Header: &meta.RequestHeader{User: userID},
151 File: data,
152 }
153 resp, err := s.api.UploadFile(s.ctx, req)
154 if err != nil {
155 return errors.Trace(err)
156 }
157
158 log.Debugf("store UploadFile finished, userID:%v, err:%v", userID, resp.Header.Error())
159
160 return errors.Trace(resp.Header.Error())
161}
162
163func (s *store) checkFile(userID int64, names []string) ([]string, error) {
164 log.Debugf("store checkFile, userID:%v", userID)

Callers 1

UploadFileMethod · 0.80

Calls 2

UploadFileMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected