-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
42 lines (37 loc) · 1.04 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
package main
type MarvelCharacter struct {
ID string `json:"_id,omitempty"`
FullName string `json:"fullname,omitempty"`
Identity string `json:"identity,omitempty"`
KnownAs string `json:"knownas,omitempty"`
Type string `json:"type,omitempty"`
}
type BackendResponse struct {
Index string `json:"_index"`
ID string `json:"_id"`
Version int `json:"_version"`
Source *MarvelCharacter `json:"_source"`
}
type BackendSearchResponse struct {
Hits struct {
Total struct {
Value int64 `json:"value"`
} `json:"total"`
Hits []*struct {
ID string `json:"_id"`
Source *MarvelCharacter `json:"_source"`
} `json:"hits"`
} `json:"hits"`
}
const (
backendAddressField = "backend_address"
backendAddress = "http://localhost:9200"
backendIndex = "sample"
fullNameField = "fullname"
identityField = "identity"
knownasField = "knownas"
typeField = "type"
)
var (
characterTypes = []string{"hero", "super-hero", "anti-hero", "villain"}
)