I would like to be able to store the index in an object store. This needs the segment implementation to be able to load segment data from remote storage. Current implementation is tightly coupled to local file system via mmap of an os.File.
My proposal is to replace mm field in Segment struct with the slice interface like:
type Slice interface {
func range(start, end int) []byte
func len() int
}
and allow a custom slice implementation that manages data.