// ListPrefix returns a map of matching keys
326277
func (c *consulClient) ListPrefix(prefix string) (KeyValuePairs, error) {
	duration := spanstat.Start()
	pairs, _, err := c.KV().List(prefix, nil)
	increaseMetric(prefix, metricRead, "ListPrefix", duration.EndError(err).Total(), err)
	if err != nil {
		return nil, err
	}

	p := KeyValuePairs(make(map[string][]byte, len(pairs)))
	for i := 0; i < len(pairs); i++ {
		p[pairs[i].Key] = pairs[i].Value
	}

	return p, nil
}
521363
func (aSpace *addrSpace) KeyPrefix() []string {
	aSpace.Lock()
	defer aSpace.Unlock()
	return []string{dsConfigKey}
}
1244661
func (pdb *BrokerWatcher) ListKeys(prefix string) (keyval.BytesKeyIterator, error) {
	entries := pdb.Client.db.GetDataForPrefix(prefix)
	var keys []string
	for _, entry := range entries {
		keys = append(keys, entry.Key)
	}
	return &bytesKeyIterator{len: len(keys), keys: keys, prefix: pdb.prefix}, nil
}
643053
func (m *InMem) List(ctx context.Context, prefix string) ([]string, error) {
	m.Lock()
	defer m.Unlock()

	keys := make([]string, 0, len(m.data))
	for k := range m.data {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	return keys, nil
}
1345041
func ListProducts(w io.Writer, products map[string]registry.Record) {
	table := tablewriter.NewWriter(w)
	table.SetHeader([]string{"Name", "Command", "Properties"})

	var keys []string
	for k := range products {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	for _, key := range keys {
		row := []string{
			products[key].Name,
			path.Base(products[key].Path),
			formatProps(products[key].Properties),
		}
		table.Append(row)
	}
	table.Render()
}
1012012
func GetPrefix(ctx context.Context, prefix string) (k string, v []byte, err error) {
	k, v, err = Client().GetPrefix(ctx, prefix)
	Trace("GetPrefix", err, logrus.Fields{fieldPrefix: prefix, fieldKey: k, fieldValue: string(v)})
	return
}
694042
func WithPrefix(ctx context.Context, prefix string) context.Context {
	return context.WithValue(ctx, ctxKeyPrefix, prefix)
}
187324
func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDestination {
	s.Prefix = &v
	return s
}
461695
func (c *CloudAPI) ListKeys() ([]cloudapi.Key, error) {
	if err := c.ProcessFunctionHook(c); err != nil {
		return nil, err
	}

	return c.keys, nil
}
669767
func MatchPrefix(s, prefix string) (string, bool) {
	if strings.HasPrefix(s, prefix) {
		return s[len(prefix):], true
	}
	return s, false
}
812934
func (r *Router) PathPrefix(tpl string) *Route {
	return r.NewRoute().PathPrefix(tpl)
}
346777
func ArgsWithPrefix(args map[string][]string, prefix string) map[string][]string {
	filtered := map[string][]string{}
	for key, slice := range args {
		if !strings.HasPrefix(key, prefix) {
			continue
		}
		for _, val := range slice {
			filtered[key] = append(filtered[key], val)
		}
	}
	return filtered
}
936117
func (mem *memNamedMapping) ListNames(field string, value string) []string {
	mem.access.RLock()
	defer mem.access.RUnlock()

	ix, found := mem.indexes[field]
	if !found {
		return nil
	}
	set, found := ix[value]

	if !found {
		return nil
	}

	return set.content()
}
1266199
func (t *Trie) MatchPrefix(view []byte) string {
	for t != nil {
		if len(t.label) != 0 {
			return t.label
		}

		if len(view) == 0 {
			break
		}

		t = t.children[view[0]]
		view = view[1:]
	}

	return ""
}
13789
func (db *ProtoWrapper) ListKeys(prefix string) (keyval.ProtoKeyIterator, error) {
	return listKeysProtoInternal(db.broker, prefix)
}
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
}
555644
func WithPrefix(prefix string) option {
	return func(m *Module) {
		m.prefix = strings.ToLower(prefix)
	}
}