-
Notifications
You must be signed in to change notification settings - Fork 0
/
brograb.go
30 lines (23 loc) · 911 Bytes
/
brograb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package brograb
import "errors"
var (
BadDestFile = errors.New("bad destination type")
)
// Grabber is a basic data grabbing interface. Use Next and Scan to fetch the next grabbing data.
type Grabber interface {
// Next prepares the next fetch data for reading with the Scan method. It
// returns true on success, or false if there is no next result row or an error
// happened while preparing it. Err should be consulted to distinguish between
// the two cases.
//
// Every call to Scan, even the first one, must be preceded by a call to Next.
Next() bool
// Scan copies the current fetched data into the interface pointed at
// by dest.
Scan(dest interface{}) error
// Err returns the error, if any, that was encountered during iteration.
Err() error
// Close stops the iteration, and closes all open databases, connections,
// and files used to fetch the browser data.
Close() error
}