// ListKeys sends a query to all members to return a list of their keys
979910
func (a *Agent) ListKeys() (*serf.KeyResponse, error) {
	a.logger.Print("[INFO] agent: Initiating key listing")
	manager := a.serf.KeyManager()
	return manager.ListKeys()
}
747124
func (e *ADLDAPInterface) ListGroups() ([]string, error) {
	if err := e.populateCache(); err != nil {
		return nil, err
	}

	return sets.StringKeySet(e.ldapGroupToLDAPMembers).List(), nil
}
39081
func (db *BytesConnectionEtcd) ListKeys(prefix string) (keyval.BytesKeyIterator, error) {
	return listKeysInternal(db.Logger, db.etcdClient, db.opTimeout, prefix)
}
1173384
func listKeys(db keyval.ProtoBroker) {
	resp, err := db.ListKeys(phonebook.EtcdPath())
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("list keys:")
	for {
		key, _, stop := resp.GetNext()
		if stop {
			break
		}

		fmt.Printf("- %s\n", key)

	}
}
455907
func (db *BytesConnectionRedis) ListValues(match string) (keyval.BytesKeyValIterator, error) {
	if db.closed {
		return nil, fmt.Errorf("ListValues(%s) called on a closed connection", match)
	}
	return listValues(db, match, nil, nil)
}
753392
func (s *RedisStore) Keys(selector string, opts *ListOptions) ([]string, error) {
	if opts != nil && opts.cacheKey != "" {
		cacheExists, err := s.client.Exists(opts.cacheKey).Result()
		if err != nil {
			return nil, err
		}
		if cacheExists {
			res, err := s.client.SMembers(opts.cacheKey).Result()
			if err == nil {
				return res, nil
			}
		}
	}

	if selector == "" {
		selector = "*"
	}
	if !strings.HasPrefix(selector, s.prefix) {
		selector = s.prefix + selector
	}
	var allKeys []string
	var cursor uint64
	for {
		keys, next, err := s.client.Scan(cursor, selector, 10000).Result()
		if err != nil {
			return nil, err
		}
		allKeys = append(allKeys, keys...)
		cursor = next
		if cursor == 0 {
			break
		}
	}

	if opts != nil && opts.cacheKey != "" {
		pipe := s.client.Pipeline()
		defer pipe.Close()
		pipe.Del(opts.cacheKey)
		if len(allKeys) > 0 {
			var allKeysAsInterface = make([]interface{}, len(allKeys))
			for i, key := range allKeys {
				allKeysAsInterface[i] = key
			}
			pipe.SAdd(opts.cacheKey, allKeysAsInterface...)
			if opts.cacheTTL > 0 {
				pipe.Expire(opts.cacheKey, opts.cacheTTL)
			}
		}
		pipe.Exec()
	}

	return allKeys, nil
}
1279950
func (o *InfrastructureAccessProfile) SSHKeys(info *bambou.FetchingInfo) (SSHKeysList, *bambou.Error) {

	var list SSHKeysList
	err := bambou.CurrentSession().FetchChildren(o, SSHKeyIdentity, &list, info)
	return list, err
}
855346
func (e *Ed25519) ListKeys(role data.RoleName) []string {
	keyIDs := make([]string, 0, len(e.keys))
	for id, edCryptoKey := range e.keys {
		if edCryptoKey.role == role {
			keyIDs = append(keyIDs, id)
		}
	}
	return keyIDs
}
952120
func (r *queryTable) tagKeys() []string {
	tags := []string{}
	for t := range r.row.Tags {
		tags = append(tags, t)
	}
	sort.Strings(tags)
	return tags
}
479502
func (r *KeyResource) List() ([]*Key, error) {
	keys := []*Key{}
	const path = "/user/keys"

	if err := r.client.do("GET", path, nil, &keys); err != nil {
		return nil, err
	}

	return keys, nil
}
1004120
func (h HeaderMap) ListKeys() []string {
	keys := make([]string, 0, len(h))
	for k := range h {
		keys = append(keys, k)
	}
	return keys
}
103851
func (fs *FSObjects) ListObjects(ctx context.Context, bucket, prefix, marker, delimiter string, maxKeys int) (loi ListObjectsInfo, e error) {
	return listObjects(ctx, fs, bucket, prefix, marker, delimiter, maxKeys, fs.listPool,
		fs.listDirFactory(), fs.getObjectInfo, fs.getObjectInfo)
}
1055038
func (r *keyring) List() ([]*Key, error) {
	r.mu.Lock()
	defer r.mu.Unlock()
	if r.locked {
		// section 2.7: locked agents return empty.
		return nil, nil
	}

	var ids []*Key
	for _, k := range r.keys {
		pub := k.signer.PublicKey()
		ids = append(ids, &Key{
			Format:  pub.Type(),
			Blob:    pub.Marshal(),
			Comment: k.comment})
	}
	return ids, nil
}
783147
func ListResponse(keys []string) *Response {
	resp := &Response{
		Data: map[string]interface{}{},
	}
	if len(keys) != 0 {
		resp.Data["keys"] = keys
	}
	return resp
}
1233892
func (ctx *Context) GETKeys() []string {
	var res []string
	ctx.Request.URI().QueryArgs().VisitAll(func(key, value []byte) {
		res = append(res, string(key))
	})
	return res
}
82118
func (pdb *protoBroker) ListValues(key string) (keyval.ProtoKeyValIterator, error) {
	return listValuesProtoInternal(pdb.broker, pdb.serializer, key)
}
157194
func (c *Client) ListKeys(keyPrefix string) (keyval.BytesKeyIterator, error) {
	boltLogger.Debugf("ListKeys: %q", keyPrefix)

	var keys []string
	err := c.db.View(func(tx *bolt.Tx) error {
		c := tx.Bucket(rootBucket).Cursor()
		prefix := []byte(keyPrefix)

		for k, _ := c.Seek(prefix); k != nil && bytes.HasPrefix(k, prefix); k, _ = c.Next() {
			boltLogger.Debugf(" listing key: %q", string(k))
			keys = append(keys, string(k))
		}

		return nil
	})

	return &bytesKeyIterator{len: len(keys), keys: keys}, err
}