forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdtos.go
70 lines (56 loc) · 1.8 KB
/
dtos.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
package gmsclient
import "time"
type MigrateDataType string
const (
DashboardDataType MigrateDataType = "DASHBOARD"
DatasourceDataType MigrateDataType = "DATASOURCE"
FolderDataType MigrateDataType = "FOLDER"
)
type MigrateDataRequestDTO struct {
Items []MigrateDataRequestItemDTO `json:"items"`
}
type MigrateDataRequestItemDTO struct {
Type MigrateDataType `json:"type"`
RefID string `json:"refId"`
Name string `json:"name"`
Data interface{} `json:"data"`
}
type ItemStatus string
const (
ItemStatusOK ItemStatus = "OK"
ItemStatusError ItemStatus = "ERROR"
)
type MigrateDataResponseDTO struct {
RunUID string `json:"uid"`
Items []MigrateDataResponseItemDTO `json:"items"`
}
type MigrateDataResponseListDTO struct {
RunUID string `json:"uid"`
}
type MigrateDataResponseItemDTO struct {
// required:true
Type MigrateDataType `json:"type"`
// required:true
RefID string `json:"refId"`
// required:true
Status ItemStatus `json:"status"`
Error string `json:"error,omitempty"`
}
type CreateSnapshotUploadUrlResponseDTO struct {
UploadUrl string `json:"uploadUrl"`
}
type EventRequestDTO struct {
LocalID string `json:"migrationClientId"`
Event LocalEventType `json:"event"`
Error string `json:"error"`
DurationIfFinished time.Duration `json:"duration"`
}
type LocalEventType string
const (
EventConnect LocalEventType = "connect"
EventDisconnect LocalEventType = "disconnect"
EventStartBuildingSnapshot LocalEventType = "start_building_snapshot"
EventDoneBuildingSnapshot LocalEventType = "done_building_snapshot"
EventStartUploadingSnapshot LocalEventType = "start_uploading_snapshot"
EventDoneUploadingSnapshot LocalEventType = "done_uploading_snapshot"
)