-
Notifications
You must be signed in to change notification settings - Fork 251
/
types.go
136 lines (106 loc) · 4.26 KB
/
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// This source code file is AUTO-GENERATED by github.com/taskcluster/jsonschema2go
package tcindex
import (
"encoding/json"
tcclient "github.com/taskcluster/taskcluster/clients/client-go/v14"
)
type (
// Representation of an indexed task.
IndexedTaskResponse struct {
// Data that was reported with the task. This is an arbitrary JSON object.
//
// Additional properties allowed
Data json.RawMessage `json:"data"`
// Date at which this entry expires from the task index.
Expires tcclient.Time `json:"expires"`
// Namespace of the indexed task, used to find the indexed task in the index.
//
// Max length: 255
Namespace string `json:"namespace"`
// If multiple tasks are indexed with the same `namespace` the task with the
// highest `rank` will be stored and returned in later requests. If two tasks
// has the same `rank` the latest task will be stored.
Rank float64 `json:"rank"`
// Unique task identifier, this is UUID encoded as
// [URL-safe base64](http://tools.ietf.org/html/rfc4648#section-5) and
// stripped of `=` padding.
//
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskID string `json:"taskId"`
}
// Representation of the index entry to insert.
InsertTaskRequest struct {
// This is an arbitrary JSON object. Feel free to put whatever data you want
// here, but do limit it, you'll get errors if you store more than 32KB.
// So stay well, below that limit.
//
// Additional properties allowed
Data json.RawMessage `json:"data"`
// Date at which this entry expires from the task index.
Expires tcclient.Time `json:"expires"`
// If multiple tasks are indexed with the same `namespace` the task with the
// highest `rank` will be stored and returned in later requests. If two tasks
// has the same `rank` the latest task will be stored.
Rank float64 `json:"rank"`
// Unique task identifier, this is UUID encoded as
// [URL-safe base64](http://tools.ietf.org/html/rfc4648#section-5) and
// stripped of `=` padding.
//
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskID string `json:"taskId"`
}
// Response from a request to list namespaces within a given namespace.
ListNamespacesResponse struct {
// A continuation token is returned if there are more results than listed
// here. You can optionally provide the token in the request payload to
// load the additional results.
ContinuationToken string `json:"continuationToken,omitempty"`
// List of namespaces.
Namespaces []Namespace `json:"namespaces"`
}
// Representation of an indexed task.
ListTasksResponse struct {
// A continuation token is returned if there are more results than listed
// here. You can optionally provide the token in the request payload to
// load the additional results.
ContinuationToken string `json:"continuationToken,omitempty"`
// List of tasks.
Tasks []Task `json:"tasks"`
}
// Representation of a namespace that contains indexed tasks.
Namespace struct {
// Date at which this entry, and by implication all entries below it,
// expires from the task index.
Expires tcclient.Time `json:"expires"`
// Name of namespace within it's parent namespace.
Name string `json:"name"`
// Fully qualified name of the namespace, you can use this to list
// namespaces or tasks under this namespace.
//
// Max length: 255
Namespace string `json:"namespace"`
}
// Representation of a task.
Task struct {
// Data that was reported with the task. This is an arbitrary JSON
// object.
//
// Additional properties allowed
Data json.RawMessage `json:"data"`
// Date at which this entry expires from the task index.
Expires tcclient.Time `json:"expires"`
// Index path of the task.
//
// Max length: 255
Namespace string `json:"namespace"`
// If multiple tasks are indexed with the same `namespace` the task
// with the highest `rank` will be stored and returned in later
// requests. If two tasks has the same `rank` the latest task will be
// stored.
Rank float64 `json:"rank"`
// Unique task identifier for the task currently indexed at `namespace`.
//
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskID string `json:"taskId"`
}
)