-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp_service_testdata_test.go
More file actions
46 lines (41 loc) · 1.14 KB
/
app_service_testdata_test.go
File metadata and controls
46 lines (41 loc) · 1.14 KB
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
package truenas
import "encoding/json"
// sampleAppJSON returns a JSON response for a single app (no config).
func sampleAppJSON() json.RawMessage {
return json.RawMessage(`[{
"name": "my-app",
"state": "RUNNING",
"custom_app": true
}]`)
}
// sampleAppWithConfigJSON returns a JSON response for a single app with config.
func sampleAppWithConfigJSON() json.RawMessage {
return json.RawMessage(`[{
"name": "my-app",
"state": "RUNNING",
"custom_app": true,
"config": {"version": "1.0", "port": 8080}
}]`)
}
// sampleRegistryJSON returns a JSON response for a single registry.
func sampleRegistryJSON() json.RawMessage {
return json.RawMessage(`[{
"id": 1,
"name": "my-registry",
"description": "A test registry",
"username": "admin",
"password": "secret",
"uri": "https://registry.example.com"
}]`)
}
// sampleRegistryNullDescJSON returns a JSON response for a registry with null description.
func sampleRegistryNullDescJSON() json.RawMessage {
return json.RawMessage(`[{
"id": 2,
"name": "null-desc-registry",
"description": null,
"username": "user",
"password": "pass",
"uri": "https://registry2.example.com"
}]`)
}