- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for GetOffsetLength (0.08 sec)
-
cmd/httprange_test.go
{"bytes=-1000", 0, 10}, } for i, testCase := range validRangeSpecs { rs, err := parseRequestRangeSpec(testCase.spec) if err != nil { t.Errorf("unexpected err: %v", err) } o, l, err := rs.GetOffsetLength(resourceSize) if err != nil { t.Errorf("unexpected err: %v", err) } if o != testCase.expOffset || l != testCase.expLength { t.Errorf("Case %d: got bad offset/length: %d,%d expected: %d,%d",
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun May 05 16:56:21 UTC 2024 - 3.7K bytes - Viewed (0) -
cmd/httprange.go
default: return 0, errors.New("Unexpected range specification case") } return rangeLength, nil } // GetOffsetLength computes the start offset and length of the range // given the size of the resource func (h *HTTPRangeSpec) GetOffsetLength(resourceSize int64) (start, length int64, err error) { if h == nil { // No range specified, implies whole object. return 0, resourceSize, nil }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu May 09 08:44:07 UTC 2024 - 5.9K bytes - Viewed (0) -
cmd/copy-part-range_test.go
for _, successCase := range successCases { rs, err := parseCopyPartRangeSpec(successCase.rangeString) if err != nil { t.Fatalf("expected: <nil>, got: %s", err) } start, length, err1 := rs.GetOffsetLength(objectSize) if err1 != nil { t.Fatalf("expected: <nil>, got: %s", err1) } if start != successCase.offsetBegin { t.Fatalf("expected: %d, got: %d", successCase.offsetBegin, start) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Apr 23 18:58:53 UTC 2021 - 2.5K bytes - Viewed (0) -
cmd/veeam-sos-api.go
default: return nil, errFileNotFound } etag := getMD5Hash(buf) r := bytes.NewReader(buf) off, length := int64(0), r.Size() if rs != nil { off, length, err = rs.GetOffsetLength(r.Size()) if err != nil { return nil, err } } r.Seek(off, io.SeekStart) return NewGetObjectReaderFromReader(io.LimitReader(r, length), ObjectInfo{ Bucket: bucket,
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Aug 15 00:34:56 UTC 2024 - 8.8K bytes - Viewed (0) -
cmd/api-headers.go
if err != nil { return err } if rs == nil && opts.PartNumber > 0 { rs = partNumberToRangeSpec(objInfo, opts.PartNumber) } // For providing ranged content start, rangeLen, err = rs.GetOffsetLength(totalObjectSize) if err != nil { return err } // Set content length. w.Header().Set(xhttp.ContentLength, strconv.FormatInt(rangeLen, 10)) if rs != nil {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue May 28 04:44:00 UTC 2024 - 7K bytes - Viewed (0)