func (fc *FCache) Reindex(newKeys []Key, opts ...LookupOption) error {
	// Process the options
	o, err := procLookupOpts(opts)
	if err != nil {
		return err
	}

	// Lock the cache
	fc.Lock()
	defer fc.Unlock()

	// Look for the index of the primary key
	idx, ok := fc.indexes[o.key.Index]
	if !ok {
		return ErrBadIndex
	}

	// Find the existing entry
	ent, ok := idx.entries[o.key.Key]
	if !ok || ent.content == nil {
		return ErrNotCached
	}

	// Construct the initial keymap
	indexes, err := fc.fillKeyMap(ent)
	if err != nil {
		return err
	}

	// Finish the keymap construction
	if err = fc.finishKeyMap(indexes, newKeys); err != nil {
		return err
	}

	// Perform the remap
	fc.remap(indexes, ent)

	return nil
}
// Reindex reindexes an existing entry in the cache--that is, it
// changes the set of old keys to a set of new keys.  It should be
// passed the list of new keys and appropriate options to find the
// object to reindex in the cache.
Reindex reindexes an existing entry in the cache--that is, it
changes the set of old keys to a set of new keys.  It should be
passed the list of new keys and appropriate options to find the
object to reindex in the cache.
// Reindex reindexes an existing entry in the cache -- that is it // changes the set of old keys to a set of new keys . It should be // passed the list of new keys and appropriate options to find the // object to reindex in the cache .
func (fc *FCache) Reindex(newKeys []Key, opts ...LookupOption) error {
	o, err := procLookupOpts(opts)
	if err != nil {
		return err
	}
	fc.Lock()
	defer fc.Unlock()
	idx, ok := fc.indexes[o.key.Index]
	if !ok {
		return ErrBadIndex
	}
	ent, ok := idx.entries[o.key.Key]
	if !ok || ent.content == nil {
		return ErrNotCached
	}
	indexes, err := fc.fillKeyMap(ent)
	if err != nil {
		return err
	}
	if err = fc.finishKeyMap(indexes, newKeys); err != nil {
		return err
	}
	fc.remap(indexes, ent)
	return nil
}
func ( fc * FCache ) Reindex ( newKeys [ ] Key , opts ... LookupOption ) error { o , err := procLookupOpts ( opts ) if err != nil { return err } fc . Lock ( ) defer fc . Unlock ( ) idx , ok := fc . indexes [ o . key . Index ] if ! ok { return ErrBadIndex } ent , ok := idx . entries [ o . key . Key ] if ! ok || ent . content == nil { return ErrNotCached } indexes , err := fc . fillKeyMap ( ent ) if err != nil { return err } if err = fc . finishKeyMap ( indexes , newKeys ) ; err != nil { return err } fc . remap ( indexes , ent ) return nil }
Reindex reindexes an existing entry in the cache--that is, it
changes the set of old keys to a set of new keys.
Reindex reindexes an existing entry in the cache -- that is it changes the set of old keys to a set of new keys .
// Process the options // Lock the cache // Look for the index of the primary key // Find the existing entry // Construct the initial keymap // Finish the keymap construction // Perform the remap