Exemple #1
0
func NewIndexer(f io.ReadCloser) index.Indexer {
	return &indexer{
		f:     f,
		r:     multi.NewReader(f),
		Index: index.New(),
	}
}
Exemple #2
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)
	}
	return
}