Exemple #1
0
func NewIndexer(f *os.File) index.Indexer {
	return &indexer{
		f:     f,
		r:     multi.NewReader(f),
		Index: index.New(),
	}
}
Exemple #2
0
func NewIndexer(f *os.File) index.Indexer {
	fi, _ := f.Stat()
	return &indexer{
		f:     f,
		size:  fi.Size(),
		r:     multi.NewReader(f),
		Index: index.New(),
	}
}
Exemple #3
0
// Index functions
func (node *Node) Index(name string) (idx index.Index, err error) {
	if virtual.Has(name) {
		idx = virtual.New(name, node.FilePath(), node.File.Size, 10240)
	} else {
		idx = index.New()
		err = idx.Load(node.IndexPath() + "/" + name + ".idx")
	}
	return
}