forked from gencebay/httplive
/
types.go
124 lines (105 loc) · 2.66 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
package lib
// EnvironmentVariables ...
type EnvironmentVariables struct {
DbFile string
DatabaseName string
DatabaseAttachedFullPath string
DefaultPort string
HasMultiplePort bool
}
// IPResponse ...
type IPResponse struct {
Origin string `json:"origin"`
}
// UserAgentResponse ...
type UserAgentResponse struct {
UserAgent string `json:"user-agent"`
}
// HeadersResponse ...
type HeadersResponse struct {
Headers map[string]string `json:"headers"`
}
// CookiesResponse ...
type CookiesResponse struct {
Cookies map[string]string `json:"cookies"`
}
// JSONResponse ...
type JSONResponse interface{}
// GetResponse ...
type GetResponse struct {
Args map[string][]string `json:"args"`
HeadersResponse
IPResponse
URL string `json:"url"`
}
// PostResponse ...
type PostResponse struct {
Args map[string][]string `json:"args"`
Data JSONResponse `json:"data"`
Form map[string]string `json:"form"`
HeadersResponse
IPResponse
URL string `json:"url"`
}
// GzipResponse ...
type GzipResponse struct {
HeadersResponse
IPResponse
Gzipped bool `json:"gzipped"`
}
// DeflateResponse ...
type DeflateResponse struct {
HeadersResponse
IPResponse
Deflated bool `json:"deflated"`
}
// BasicAuthResponse ...
type BasicAuthResponse struct {
Authenticated bool `json:"authenticated"`
User string `json:"string"`
}
// WebCliController ...
type WebCliController struct {
Port string
}
// APIDataModel ...
type APIDataModel struct {
ID int `json:"id"`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
Body string `json:"body"`
}
// EndpointModel ...
type EndpointModel struct {
OriginKey string `json:originKey`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
}
// Pair ...
type Pair struct {
Key string
Value APIDataModel
}
// PairList ...
type PairList []Pair
func (p PairList) Len() int { return len(p) }
func (p PairList) Less(i, j int) bool { return p[i].Value.ID > p[j].Value.ID }
func (p PairList) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
// JsTreeDataModel ...
type JsTreeDataModel struct {
ID int `json:"id"`
Key string `json:"key"`
OriginKey string `json:"originKey"`
Text string `json:"text"`
Type string `json:"type"`
Children []JsTreeDataModel `json:"children"`
}
// WsMessage ...
type WsMessage struct {
Host string `json:"host"`
Body interface{} `json:"body"`
Header map[string]string `json:"header"`
URL string `json:"url"`
Method string `json:"method"`
Path string `json:"path"`
}