-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
53 lines (41 loc) · 1.17 KB
/
doc.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Package doxiego communicates with a Doxie Go scanner.
The below example demonstrates how to use the API to communicate with a Doxie
scanner.
package main
import (
"fmt"
"github.com/umahmood/doxiego"
)
func main() {
doxieGo, err := doxiego.Hello()
if err != nil {
//...
}
fmt.Println("Doxie name", doxieGo.Name)
// if the scanner has a password set, fill in the password field
doxieGo.Password = "mypassword"
// get a list of scanned items on the scanner
items, err := doxieGo.Scans()
if err != nil {
//...
}
for _, s := range items {
fmt.Println("name:", s.Name, "size:", s.Size, "modified:", s.Modified)
}
// download a scan
img, err := doxieGo.Scan("img_0001.jpg")
if err != nil {
//...
}
jpeg.Encode(file, img, nil)
// delete scans off the scanner
ok, err := doxieGo.Delete("img_0001.jpg", "img_0002.jpg")
if err != nil {
//...
} else if ok {
fmt.Println("scans deleted.")
}
}
*/
package doxiego