func (f *ChangesFeed) Err() error {
	return f.err
}
Err returns the last error that occurred during iteration.
package couchdb
import (
	"encoding/json"
	"fmt"
	"io"
)
type DBUpdatesFeed struct {
	Event string      `json:"type"`     
	DB    string      `json:"db_name"`  
	Seq   interface{} `json:"seq"`      
	OK    bool        `json:"ok"`       
	end  bool
	err  error
	conn io.Closer
	dec  *json.Decoder
}
func (c *Client) DBUpdates(options Options) (*DBUpdatesFeed, error) {
	newopts := options.clone()
	newopts["feed"] = "continuous"
	path, err := new(pathBuilder).addRaw("_db_updates").options(newopts, nil)
	if err != nil {
		return nil, err
	}
	resp, err := c.request("GET", path, nil)
	if err != nil {
		return nil, err
	}
	feed := &DBUpdatesFeed{
		conn: resp.Body,
		dec:  json.NewDecoder(resp.Body),
	}
	return feed, nil
}
func (f *DBUpdatesFeed) Next() bool {
	if f.end {
		return false
	}
	f.Event, f.DB, f.Seq, f.OK = "", "", nil, false
	if f.err = f.dec.Decode(f); f.err != nil {
		if f.err == io.EOF {
			f.err = nil
		}
		f.Close()
	}
	return !f.end
}
func (f *DBUpdatesFeed) Err() error {
	return f.err
}
func (f *DBUpdatesFeed) Close() error {
	f.end = true
	return f.conn.Close()
}
type ChangesFeed struct {
	DB *DB `json:"-"`
	ID string `json:"id"`
	Deleted bool `json:"deleted"`
	Seq interface{} `json:"seq"`
	Pending int64 `json:"pending"`
	Changes []struct {
		Rev string `json:"rev"`
	} `json:"changes"`
	Doc json.RawMessage `json:"doc"`
	end    bool
	err    error
	conn   io.Closer
	parser func() error
}
type changesRow struct {
	ID      string      `json:"id"`
	Deleted bool        `json:"deleted"`
	Seq     interface{} `json:"seq"`
	Changes []struct {
		Rev string `json:"rev"`
	} `json:"changes"`
	Doc     json.RawMessage `json:"doc"`
	LastSeq bool            `json:"last_seq"`
}
func (d *changesRow) apply(f *ChangesFeed) error {
	f.Seq = d.Seq
	f.ID = d.ID
	f.Deleted = d.Deleted
	f.Doc = d.Doc
	f.Changes = d.Changes
	return nil
}
func (f *ChangesFeed) reset() {
	f.ID, f.Deleted, f.Changes, f.Doc = "", false, nil, nil
}
func (db *DB) Changes(options Options) (*ChangesFeed, error) {
	path, err := db.path().addRaw("_changes").options(options, nil)
	if err != nil {
		return nil, err
	}
	resp, err := db.request("GET", path, nil)
	if err != nil {
		return nil, err
	}
	feed := &ChangesFeed{DB: db, conn: resp.Body}
	switch options["feed"] {
	case nil, "normal", "longpoll":
		feed.parser, err = feed.pollParser(resp.Body)
		if err != nil {
			feed.Close()
			return nil, err
		}
	case "continuous":
		feed.parser = feed.contParser(resp.Body)
	default:
		err := fmt.Errorf(`couchdb: unsupported value for option "feed": %#v`, options["feed"])
		feed.Close()
		return nil, err
	}
	return feed, nil
}
func (f *ChangesFeed) Next() bool {
	if f.end {
		return false
	}
	if f.err = f.parser(); f.err != nil || f.end {
		f.Close()
	}
	return !f.end
}