forked from prasmussen/gdrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
67 lines (55 loc) · 981 Bytes
/
types.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package drive
import (
"net/http"
"google.golang.org/api/drive/v3"
)
type Client interface {
Service() *drive.Service
Http() *http.Client
}
type Drive struct {
service *drive.Service
http *http.Client
}
func NewDrive(client Client) *Drive {
return &Drive{
service: client.Service(),
http: client.Http(),
}
}
type ListFilesArgs struct {
MaxFiles int64
Query string
SkipHeader bool
SizeInBytes bool
}
type DownloadFileArgs struct {
Id string
Force bool
NoProgress bool
Stdout bool
}
type UploadFileArgs struct {
Path string
Name string
Parent string
Mime string
Recursive bool
Stdin bool
Share bool
}
type FileInfoArgs struct {
Id string
SizeInBytes bool
}
type PrintFileInfoArgs struct {
File *drive.File
SizeInBytes bool
}
type kv [2]string
func (self kv) key() string {
return self[0]
}
func (self kv) value() string {
return self[1]
}