func (fc *FCache) Contents(index interface{}) ([]Entry, error) {
	// Lock the cache
	fc.Lock()
	defer fc.Unlock()

	// Look for the index
	idx, ok := fc.indexes[index]
	if !ok {
		return nil, ErrBadIndex
	}

	// Initialize a container for entries
	result := make([]Entry, 0, len(idx.entries))
	for _, ent := range idx.entries {
		if ent.content != nil {
			result = append(result, *ent.content)
		}
	}

	return result, nil
}
// Contents returns all completed entries in the specified cache
// index.  Only completed entries are returned; any uncompleted
// entries are skipped.  What is returned is a list of Entry
// structures; this allows Contents to return cached errors.
Contents returns all completed entries in the specified cache
index.  Only completed entries are returned; any uncompleted
entries are skipped.  What is returned is a list of Entry
structures; this allows Contents to return cached errors.
// Contents returns all completed entries in the specified cache // index . Only completed entries are returned ; any uncompleted // entries are skipped . What is returned is a list of Entry // structures ; this allows Contents to return cached errors .
func (fc *FCache) Contents(index interface{}) ([]Entry, error) {
	fc.Lock()
	defer fc.Unlock()
	idx, ok := fc.indexes[index]
	if !ok {
		return nil, ErrBadIndex
	}
	result := make([]Entry, 0, len(idx.entries))
	for _, ent := range idx.entries {
		if ent.content != nil {
			result = append(result, *ent.content)
		}
	}
	return result, nil
}
func ( fc * FCache ) Contents ( index interface { } ) ( [ ] Entry , error ) { fc . Lock ( ) defer fc . Unlock ( ) idx , ok := fc . indexes [ index ] if ! ok { return nil , ErrBadIndex } result := make ( [ ] Entry , 0 , len ( idx . entries ) ) for _ , ent := range idx . entries { if ent . content != nil { result = append ( result , * ent . content ) } } return result , nil }
Contents returns all completed entries in the specified cache
index.
Contents returns all completed entries in the specified cache index .
// Lock the cache // Look for the index // Initialize a container for entries