// Redis KEYS command.
195409
func (c *syncClient) Keys(arg0 string) (result []string, err Error) {
	arg0bytes := []byte(arg0)

	var resp Response
	resp, err = c.conn.ServiceRequest(&KEYS, [][]byte{arg0bytes})
	if err == nil {
		//		result = strings.Split(bytes.NewBuffer(resp.GetBulkData()).String(), " ", 0);
		res := resp.GetMultiBulkData()
		result = make([]string, len(res))
		for i, key_bytes := range res {
			result[i] = string(key_bytes)
		}
	}
	return result, err

}
792762
func Keys(argv []string) error {
	usage := `
Valid commands for SSH keys:

keys:list        list SSH keys for the logged in user
keys:add         add an SSH key
keys:remove      remove an SSH key

Use 'deis help [command]' to learn more.
`

	switch argv[0] {
	case "keys:list":
		return keysList(argv)
	case "keys:add":
		return keyAdd(argv)
	case "keys:remove":
		return keyRemove(argv)
	default:
		if printHelp(argv, usage) {
			return nil
		}

		if argv[0] == "keys" {
			argv[0] = "keys:list"
			return keysList(argv)
		}

		PrintUsage()
		return nil
	}
}
308011
func (o *orderedDict) keys() isolated.HexDigests {
	out := make(isolated.HexDigests, 0, o.length())
	for e := o.ll.Front(); e != nil; e = e.Next() {
		out = append(out, e.Value.(*entry).key)
	}
	return out
}
324898
func (c *Client) Keys(pattern string) ([]string, error) {
	keys := []string{}
	v, err := c.execOnFirst(true, "KEYS", pattern)
	if err != nil {
		return keys, err
	}
	return iface2vstr(v), nil
}
470835
func (k *KV) Keys(prefix, separator string, q *QueryOptions) ([]string, *QueryMeta, error) {
	params := map[string]string{"keys": ""}
	if separator != "" {
		params["separator"] = separator
	}
	resp, qm, err := k.getInternal(prefix, params, q)
	if err != nil {
		return nil, nil, err
	}
	if resp == nil {
		return nil, qm, nil
	}
	defer resp.Body.Close()

	var entries []string
	if err := decodeBody(resp, &entries); err != nil {
		return nil, nil, err
	}
	return entries, qm, nil
}
1079639
func (s *RedisQueueStore) Get(key string) (res []string, err error) {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	res, err = s.client.LRange(key, 0, -1).Result()
	if err == redis.Nil {
		return res, nil
	}
	return res, err
}
873352
func (ip *Interpreter) getKeys(args []string) {
	list, err := ip.Backend.GetUserDataKeys(args[0])
	if err == nil {
		for _, key := range list {
			ip.Write(key)
		}
	}
	ip.simpleResponder(err)
}
319126
func (c *signerInfoContext) Keys() string {
	sort.Strings(c.s.Keys)
	truncatedKeys := []string{}
	if c.trunc {
		for _, keyID := range c.s.Keys {
			truncatedKeys = append(truncatedKeys, stringid.TruncateID(keyID))
		}
		return strings.Join(truncatedKeys, ", ")
	}
	return strings.Join(c.s.Keys, ", ")
}
387392
func SortedKeys(m interface{}) []string {
	list := Keys(m)
	sort.Strings(list)

	return list
}
1228493
func (p Pairs) Keys() []uint64 {
	a := make([]uint64, len(p))
	for i := range p {
		a[i] = p[i].ID
	}
	return a
}
819149
func (v Map) Keys() []string {
	var keys []string
	for key := range v {
		keys = append(keys, key)
	}
	return keys
}
222815
func (r *Redis) HGet(key, field string) ([]byte, error) {
	rp, err := r.ExecuteCommand("HGET", key, field)
	if err != nil {
		return nil, err
	}
	return rp.BytesValue()
}
943044
func (db *RedisDB) HKeys(key string) ([]string, error) {
	db.master.Lock()
	defer db.master.Unlock()
	if !db.exists(key) {
		return nil, ErrKeyNotFound
	}
	if db.t(key) != "hash" {
		return nil, ErrWrongType
	}
	return db.hashFields(key), nil
}
869263
func (m *SortedMap) Keys() []string {
	keys := make([]string, 0, m.Size())
	m.trie.Allprefixed([]byte{}, func(k []byte, v interface{}) bool {
		keys = append(keys, string(k))
		return true
	})
	return keys
}
352225
func (f *FileStore) Keys() map[string]byte {
	f.mu.RLock()
	defer f.mu.RUnlock()

	uniqueKeys := map[string]byte{}
	if err := f.WalkKeys(nil, func(key []byte, typ byte) error {
		uniqueKeys[string(key)] = typ
		return nil
	}); err != nil {
		return nil
	}

	return uniqueKeys
}
1046541
func (rc *Redis) Del(key string) error {
	var err error
	if _, err = rc.do("DEL", key); err != nil {
		return err
	}
	_, err = rc.do("HDEL", rc.key, key)
	if err != nil {
		if rc.Debug {
			log.Println("[Redis]DelErr: ", err, "Key:", key)
		}
		return err
	}
	if rc.Debug {
		log.Println("[Redis]Del: ", key)
	}
	return err
}
1063505
func (c *ARC) Keys() []interface{} {
	keys := []interface{}{}
	for _, k := range c.keys() {
		_, err := c.GetIFPresent(k)
		if err == nil {
			keys = append(keys, k)
		}
	}
	return keys
}