-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
99 lines (82 loc) · 2.94 KB
/
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package btsync_api
type Folder struct {
Dir string `json:"dir"`
Secret string `json:"secret"`
Size int64 `json:"size"`
Type string `json:"type"`
Files int64 `json:"files"`
Error int `json:"error"`
Indexing int `json:"indexing"`
}
type File struct {
HavePieces int `json:"have_pieces"`
Name string `json:"name"`
Size int64 `json:"size"`
State string `json:"state"`
TotalPieces int `json:"total_pieces"`
Type string `json:"type"`
Download int `json:"download"`
}
type Peer struct {
Id string `json:"id"`
Connection string `json:"connection"`
Name string `json:"name"`
Synced int `json:"synced"`
Download int64 `json:"download"`
Upload int64 `json:"upload"`
}
type Preferences struct {
DeviceName string `json:"device_name"`
DiskLowPriority bool `json:"disk_low_priority"`
DownloadLimit int `json:"download_limit"`
FolderRescanInterval int `json:"folder_rescan_interval"`
LANEncryptData bool `json:"lan_encrypt_data"`
LANUseTCP bool `json:"lan_use_tcp"`
Lang int `json:"lang"`
ListeningPort int `json:"listening_port"`
MaxFileSizeDiffForPatching int64 `json:"max_file_size_diff_for_patching"`
MaxFileSizeForVersioning int64 `json:"max_file_size_for_versioning"`
RateLimitLocalPeers bool `json:"rate_limit_local_peers"`
ReadPoolSize int64 `json:"read_pool_size"`
SyncMaxTimeDiff int64 `json:"sync_max_time_diff"`
SyncTrashTTL int64 `json:"sync_trash_ttl"`
UploadLimit int64 `json:"upload_limit"`
UseUPnP int `json:"use_upnp"`
WritePoolSize int `json:"write_pool_size"`
}
type FolderPreferences struct {
SearchLAN int `json:"search_lan"`
SelectiveSync int `json:"selective_sync"`
UseDHT int `json:"use_dht"`
UseHosts int `json:"use_hosts"`
UseRelayServer int `json:"use_relay_server"`
UseSyncTrash int `json:"use_sync_trash"`
UseTracker int `json:"use_tracker"`
}
type Response struct {
Error int `json:"error"`
Message string `json:"message"`
}
type GetFoldersResponse []Folder
type GetFilesResponse []File
type SetFilePrefsResponse []File
type GetFolderPeersResponse []Peer
type GetSecretsResponse struct {
ReadOnly string `json:"read_only"`
ReadWrite string `json:"read_write"`
Encryption string `json:"encryption"`
}
type GetFolderPrefsResponse FolderPreferences
type SetFolderPrefsResponse FolderPreferences
type GetFolderHostsResponse map[string][]string
type GetPreferencesResponse Preferences
type GetOSResponse struct {
Name string `json:"os"`
}
type GetVersionResponse struct {
Version string `json:"version"`
}
type GetSpeedResponse struct {
Download int64 `json:"download"`
Upload int64 `json:"upload"`
}