// Items returns a slice of key/value pairs.  Each k/v pair in the slice
// is of type Item (`struct{ Key, Value []byte }`).
330655
func (bk *Bucket) Items() (items []Item, err error) {
	return items, bk.db.View(func(tx *bolt.Tx) error {
		c := tx.Bucket(bk.Name).Cursor()
		var key, value []byte
		for k, v := c.First(); k != nil; k, v = c.Next() {
			if v != nil {
				key = make([]byte, len(k))
				copy(key, k)
				value = make([]byte, len(v))
				copy(value, v)
				items = append(items, Item{key, value})
			}
		}
		return nil
	})
}
1341015
func (collection *Collection) Items() ([]Item, error) {
  val, err := collection.dbus.GetProperty("org.freedesktop.Secret.Collection.Items")
  if err != nil {
    return []Item{}, err
  }

  items := []Item{}
  for _, path := range val.Value().([]dbus.ObjectPath) {
    items = append(items, *NewItem(collection.conn, path))
  }

  return items, nil
}
1016562
func (commonResource) Slice(in interface{}) (interface{}, error) {
	switch items := in.(type) {
	case resource.Resources:
		return items, nil
	case []interface{}:
		groups := make(resource.Resources, len(items))
		for i, v := range items {
			g, ok := v.(resource.Resource)
			if !ok {
				return nil, fmt.Errorf("type %T is not a Resource", v)
			}
			groups[i] = g
		}
		return groups, nil
	default:
		return nil, fmt.Errorf("invalid slice type %T", items)
	}
}
713030
func (cc *ConsolidatorCache) Items() []ConsolidatorCacheItem {
	items := cc.LRUCache.Items()
	ret := make([]ConsolidatorCacheItem, len(items))
	for i, v := range items {
		ret[i] = ConsolidatorCacheItem{Query: v.Key, Count: v.Value.(*ccount).get()}
	}
	return ret
}
231215
func (self Object) Keys() []string {
	var keys []string
	self.object.enumerate(false, func(name string) bool {
		keys = append(keys, name)
		return true
	})
	return keys
}
1091645
func (n *node) get(key Item) Item {
	i, found := n.items.find(key)
	if found {
		return n.items[i]
	} else if len(n.children) > 0 {
		return n.children[i].get(key)
	}
	return nil
}
498674
func (c *keyValueChanger) List() ([]KeyValue, error) {
	if c.err != nil {
		return nil, c.err
	}
	var list []KeyValue
	err := c.node.doChildren(func(cn *node) error {
		list = append(list, KeyValue{cn.content.key().(string), cn.content.value()})
		return nil
	})
	if err != nil {
		return nil, err
	}
	return list, nil
}
119365
func (v List) Strings() []string {
	var strings []string
	for _, value := range v {
		strings = append(strings, value.String())
	}
	return strings
}
443156
func (section *Section) Keys() []string {
	var keys []string
	for key := range section.values {
		keys = append(keys, key)
	}

	sort.Strings(keys)
	return keys
}
633597
func (c *Container) Item(id string) (stow.Item, error) {
	res, err := c.client.Objects.Get(c.name, id).Do()
	if err != nil {
		return nil, stow.ErrNotFound
	}

	t, err := time.Parse(time.RFC3339, res.Updated)
	if err != nil {
		return nil, err
	}

	u, err := prepUrl(res.MediaLink)
	if err != nil {
		return nil, err
	}

	mdParsed, err := parseMetadata(res.Metadata)
	if err != nil {
		return nil, err
	}

	i := &Item{
		name:         id,
		container:    c,
		client:       c.client,
		size:         int64(res.Size),
		etag:         res.Etag,
		hash:         res.Md5Hash,
		lastModified: t,
		url:          u,
		metadata:     mdParsed,
		object:       res,
	}

	return i, nil
}
20092
func (c *Client) Get(key string) (item *Item, err error) {
	err = c.withKeyAddr(key, func(addr net.Addr) error {
		return c.getFromAddr(addr, []string{key}, func(it *Item) { item = it })
	})
	if err == nil && item == nil {
		err = ErrCacheMiss
	}
	return
}
819149
func (v Map) Keys() []string {
	var keys []string
	for key := range v {
		keys = append(keys, key)
	}
	return keys
}
896625
func (c *Cache) Items() []Item {
	c.Lock()
	defer c.Unlock()
	items := make([]Item, 0, c.l.Len())
	for elem := c.l.Front(); elem != nil; elem = elem.Next() {
		items = append(items, *elem.Value.(*Item))
	}
	return items
}
1197963
func (m ConcurrentMap) Items() map[string]interface{} {
	tmp := make(map[string]interface{})

	// Insert items to temporary map.
	for item := range m.IterBuffered() {
		tmp[item.Key] = item.Val
	}

	return tmp
}
560217
func (c *container) Items(prefix, cursor string, count int) ([]stow.Item, string, error) {
	items := make([]stow.Item, 0, count)
	for {
		response, err := c.bucket.ListFileNames(cursor, count)
		if err != nil {
			return nil, "", err
		}

		for _, obj := range response.Files {
			if prefix != stow.NoPrefix && !strings.HasPrefix(obj.Name, prefix) {
				continue
			}
			items = append(items, &item{
				id:           obj.ID,
				name:         obj.Name,
				size:         int64(obj.Size),
				lastModified: time.Unix(obj.UploadTimestamp/1000, 0),
				bucket:       c.bucket,
			})
			if len(items) == count {
				break
			}
		}

		cursor = response.NextFileName

		if prefix == "" || cursor == "" {
			return items, cursor, nil
		}

		if len(items) == count {
			break
		}

		if !strings.HasPrefix(cursor, prefix) {
			return items, "", nil
		}
	}

	if cursor != "" && cursor != items[len(items)-1].Name() {
		// append a space because that's a funny quirk of backblaze's implementation
		cursor = items[len(items)-1].Name() + " "
	}

	return items, cursor, nil
}
249038
func (c *container) Items(prefix, cursor string, count int) ([]stow.Item, string, error) {
	params := &swift.ObjectsOpts{
		Limit:  count,
		Marker: cursor,
		Prefix: prefix,
	}
	objects, err := c.client.Objects(c.id, params)
	if err != nil {
		return nil, "", err
	}

	items := make([]stow.Item, len(objects))
	for i, obj := range objects {

		items[i] = &item{
			id:           obj.Name,
			container:    c,
			client:       c.client,
			hash:         obj.Hash,
			size:         obj.Bytes,
			lastModified: obj.LastModified,
		}
	}
	marker := ""
	if len(objects) == count {
		marker = objects[len(objects)-1].Name
	}
	return items, marker, nil
}
341073
func (c *Cache) values(key []byte) Values {
	e := c.store.entry(key)
	if e == nil {
		return nil
	}
	e.mu.RLock()
	v := e.values
	e.mu.RUnlock()
	return v
}