type BlobRangeFinder interface { // Retrieves the ranges associated with a given blob. GetRanges(name string, offset int64, length int64) []ds3Models.Range }
func NewBlobRangeFinder(getObjects *[]helperModels.GetObject) BlobRangeFinder
Creates a BlobRangeFinderImpl which is populated with the provided getObjects
type BlobRangeFinderImpl struct {
// contains filtered or unexported fields
}
func (rangeFinder *BlobRangeFinderImpl) GetRanges(name string, offset int64, length int64) []ds3Models.Range
type RangeCollapser interface { // Collapses a set of ranges. Any duplicates or sub-ranges are removed. // The original range slice must remain unmodified. Collapse(ranges []ds3Models.Range) []ds3Models.Range }
type RangeCollapserImpl struct{}
func (RangeCollapserImpl) Collapse(ranges []ds3Models.Range) []ds3Models.Range
Creates a slice of ranges that contain the collapsed ranges provided. The original range slice remains unmodified.
Used to sort a slice of Range objects in ascending order. Original slice is modified on sort.
type Ranges []ds3Models.Range
func (ranges Ranges) Len() int
func (ranges Ranges) Less(i, j int) bool
compares Start and then End
func (ranges Ranges) Swap(i, j int)