-
Notifications
You must be signed in to change notification settings - Fork 50
/
response_results.go
79 lines (69 loc) · 1.93 KB
/
response_results.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
package goseaweedfs
// UploadResult contains upload result after put file to SeaweedFS
// Raw response: {"name":"go1.8.3.linux-amd64.tar.gz","size":82565628,"error":""}
type UploadResult struct {
Name string `json:"name,omitempty"`
Size int64 `json:"size,omitempty"`
Error string `json:"error,omitempty"`
}
// AssignResult contains assign result.
// Raw response: {"fid":"1,0a1653fd0f","url":"localhost:8899","publicUrl":"localhost:8899","count":1,"error":""}
type AssignResult struct {
FileID string `json:"fid,omitempty"`
URL string `json:"url,omitempty"`
PublicURL string `json:"publicUrl,omitempty"`
Count uint64 `json:"count,omitempty"`
Error string `json:"error,omitempty"`
}
// SubmitResult result of submit operation.
type SubmitResult struct {
FileName string `json:"fileName,omitempty"`
FileURL string `json:"fileUrl,omitempty"`
FileID string `json:"fid,omitempty"`
Size int64 `json:"size,omitempty"`
Error string `json:"error,omitempty"`
}
// ClusterStatus result of getting status of cluster
type ClusterStatus struct {
IsLeader bool
Leader string
Peers []string
}
// SystemStatus result of getting status of system
type SystemStatus struct {
Topology Topology
Version string
Error string
}
// Topology result of topology stats request
type Topology struct {
DataCenters []*DataCenter
Free int
Max int
Layouts []*Layout
}
// DataCenter stats of a datacenter
type DataCenter struct {
Free int
Max int
Racks []*Rack
}
// Rack stats of racks
type Rack struct {
DataNodes []*DataNode
Free int
Max int
}
// DataNode stats of data node
type DataNode struct {
Free int
Max int
PublicURL string `json:"PublicUrl"`
URL string `json:"Url"`
Volumes int
}
// Layout of replication/collection stats. According to https://github.com/chrislusf/seaweedfs/wiki/Master-Server-API
type Layout struct {
Replication string
Writables []uint64
}