This repository was archived by the owner on Jan 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
68 lines (61 loc) · 1.71 KB
/
types.go
File metadata and controls
68 lines (61 loc) · 1.71 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package es
// Obj represents any structure
type Obj map[string]interface{}
// ErrorCause
type ErrorCause struct {
RootCause []ErrorCause `json:"root_cause"`
Type string `json:"type"`
Reason string `json:"reason"`
ResourceType string `json:"resource.type"`
ResourceId string `json:"resource.id"`
IndexUuid string `json:"index_uuid"`
Index string `json:"index"`
}
// ErrorResponse
type ErrorResponse struct {
Message string
}
// Result
type Result struct {
Index string `json:"_index"`
Type string `json:"_type"`
Id string `json:"_id"`
Version int `json:"_version"`
ResultType string `json:"result"`
Found bool `json:"found"`
Shards struct {
Total int `json:"total"`
Successful int `json:"successful"`
Failed int `json:"failed"`
} `json:"_shards"`
SeqNo int `json:"_seq_no"`
PrimaryTerm int `json:"_primary_term"`
Source map[string]interface{} `json:"_source"`
Error string `json:"error"`
Status int `json:"status"`
}
// HitsMeta
type HitsMeta struct {
Total int `json:"total"`
MaxScore float64 `json:"max_score"`
Hits []Result `json:"hits"`
}
// SearchResults
type SearchResults struct {
Took int `json:"took"`
TimedOut bool `json:"timed_out"`
Shards struct {
Total int `json:"total"`
Successful int `json:"successful"`
Skipped int `json:"skipped"`
Failed int `json:"failed"`
} `json:"_shards"`
Hits HitsMeta `json:"hits"`
Error string `json:"error"`
Status int `json:"status"`
}
// IndexTemplate
type IndexTemplate struct {
Name string
Template Obj
}