Exemple #1
0
func (this *BoltHelper) Traverse(tablename string, tx *bolt.Tx) func() ([]byte, []byte) {

	var c *bolt.Cursor

	b := tx.Bucket([]byte(tablename))
	c = b.Cursor()

	k, v := c.First()
	return func() ([]byte, []byte) {

		if k != nil {
			k1, v1 := k, v
			k, v = c.Next()
			return k1, v1
		}

		return nil, nil

	}

}