// GetKeys returns keys from pattern
GetKeys returns keys from pattern
// GetKeys returns keys from pattern
func (c *Cache) GetKeys(pattern string) ([]string, error) {
	conn := c.Pool.Get()
	defer conn.Close()
	iter := 0
	keys := []string{}
	for {
		arr, err := redis.Values(conn.Do("SCAN", iter, "MATCH", pattern))
		if err != nil {
			return keys, fmt.Errorf("dscache.Cache.GetKeys: error retrieving '%s' keys", pattern)
		}
		iter, _ = redis.Int(arr[0], nil)
		k, _ := redis.Strings(arr[1], nil)
		keys = append(keys, k...)
		if iter == 0 {
			break
		}
	}
	return keys, nil
}
func ( c * Cache ) GetKeys ( pattern string ) ( [ ] string , error ) { conn := c . Pool . Get ( ) defer conn . Close ( ) iter := 0 keys := [ ] string { } for { arr , err := redis . Values ( conn . Do ( " " , iter , " " , pattern ) ) if err != nil { return keys , fmt . Errorf ( " " , pattern ) } iter , _ = redis . Int ( arr [ 0 ] , nil ) k , _ := redis . Strings ( arr [ 1 ] , nil ) keys = append ( keys , k ... ) if iter == 0 { break } } return keys , nil }
GetKeys returns keys from pattern
GetKeys returns keys from pattern