-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapps.go
More file actions
38 lines (31 loc) · 1.01 KB
/
apps.go
File metadata and controls
38 lines (31 loc) · 1.01 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
package api
// App is the definition of the app object.
type App struct {
Created string `json:"created"`
ID string `json:"id"`
Owner string `json:"owner"`
Updated string `json:"updated"`
UUID string `json:"uuid"`
}
// Apps defines a collection of app objects.
type Apps []App
func (a Apps) Len() int { return len(a) }
func (a Apps) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Apps) Less(i, j int) bool { return a[i].ID < a[j].ID }
// AppCreateRequest is the definition of POST /v2/apps/.
type AppCreateRequest struct {
ID string `json:"id,omitempty"`
}
// AppUpdateRequest is the definition of POST /v2/apps/<app id>/.
type AppUpdateRequest struct {
Owner string `json:"owner,omitempty"`
}
// AppRunRequest is the definition of POST /v2/apps/<app id>/run.
type AppRunRequest struct {
Command string `json:"command"`
}
// AppRunResponse is the definition of /v2/apps/<app id>/run.
type AppRunResponse struct {
Output string `json:"output"`
ReturnCode int `json:"exit_code"`
}