/
response_types.go
60 lines (49 loc) · 1.31 KB
/
response_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
package compute
import (
"time"
"github.com/suborbital/atmo/directive"
)
type TokenResponse struct {
Token string `json:"token"`
}
type UserFunctionsResponse struct {
Functions []*directive.Runnable `json:"functions"`
}
type ExecError struct {
Code int `json:"code"`
Message string `json:"string"`
}
type ExecMetadata struct {
UUID string `json:"uuid"`
Timestamp time.Time `json:"timestamp"`
Success bool `json:"success"`
Error ExecError `json:"error"`
}
type FeatureLanguage struct {
ID string `json:"identifier"`
Short string `json:"short"`
Pretty string `json:"pretty"`
}
type FeaturesResponse struct {
Features []string `json:"features"`
Langauges []FeatureLanguage `json:"languages"`
}
// TestPayload is a single test for a Runnable
type TestPayload struct {
Name string `json:"name"`
Description string `json:"description"`
Payload string `json:"payload"`
}
// EditorStateResponse is a response to requests to get editorState
type EditorStateResponse struct {
Lang string `json:"lang"`
Contents string `json:"contents"`
Tests []TestPayload `json:"tests"`
}
type BuildResult struct {
Succeeded bool `json:"succeeded"`
OutputLog string `json:"outputLog"`
}
type PromoteDraftResponse struct {
Version string `json:"version"`
}