MCPcopy Index your code
hub / github.com/cubefs/cubefs / getVol

Method getVol

objectnode/api_handler.go:107–122  ·  view source on GitHub ↗
(bucket string)

Source from the content-addressed store, hash-verified

105}
106
107func (o *ObjectNode) getVol(bucket string) (vol *Volume, err error) {
108 if bucket == "" {
109 return nil, errors.New("bucket name is empty")
110 }
111 vol, err = o.vm.Volume(bucket)
112 if err != nil {
113 log.LogErrorf("getVol: load Volume fail, bucket(%v) err(%v)", bucket, err)
114 if err == proto.ErrVolNotExists {
115 err = NoSuchBucket
116 return
117 }
118 err = InternalErrorCode(err)
119 return
120 }
121 return vol, nil
122}
123
124func (o *ObjectNode) errorResponse(w http.ResponseWriter, r *http.Request, err error, ec *ErrorCode) {
125 if err != nil || ec != nil {

Callers 15

getBucketCorsHandlerMethod · 0.95
putBucketCorsHandlerMethod · 0.95
uploadPartHandlerMethod · 0.95
uploadPartCopyHandlerMethod · 0.95
listPartsHandlerMethod · 0.95
policyCheckMethod · 0.95

Calls 3

LogErrorfFunction · 0.92
InternalErrorCodeFunction · 0.85
VolumeMethod · 0.45

Tested by

no test coverage detected