forked from SpectoLabs/hoverfly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviews.go
More file actions
165 lines (136 loc) · 4.44 KB
/
Copy pathviews.go
File metadata and controls
165 lines (136 loc) · 4.44 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
package v2
import (
"github.com/SpectoLabs/hoverfly/core/metrics"
)
type DestinationView struct {
Destination string `json:"destination"`
}
type UsageView struct {
Usage metrics.Stats `json:"usage"`
}
type MiddlewareView struct {
Binary string `json:"binary"`
Script string `json:"script"`
Remote string `json:"remote"`
}
type CORSView struct {
Enabled bool `json:"enabled"`
AllowOrigin string `json:"allowOrigin,omitempty"`
AllowMethods string `json:"allowMethods,omitempty"`
AllowHeaders string `json:"allowHeaders,omitempty"`
PreflightMaxAge int64 `json:"preflightMaxAge,omitempty"`
AllowCredentials bool `json:"allowCredentials,omitempty"`
ExposeHeaders string `json:"exposeHeaders,omitempty"`
}
type ModeView struct {
Mode string `json:"mode"`
Arguments ModeArgumentsView `json:"arguments,omitempty"`
}
type ModeArgumentsView struct {
Headers []string `json:"headersWhitelist,omitempty"`
MatchingStrategy *string `json:"matchingStrategy,omitempty"`
Stateful bool `json:"stateful,omitempty"`
OverwriteDuplicate bool `json:"overwriteDuplicate,omitempty"`
}
type IsWebServerView struct {
IsWebServer bool `json:"isWebServer"`
}
type VersionView struct {
Version string `json:"version"`
}
type UpstreamProxyView struct {
UpstreamProxy string `json:"upstreamProxy"`
}
type HoverflyView struct {
CORSView `json:"cors"`
DestinationView
MiddlewareView `json:"middleware"`
ModeView
IsWebServerView
UsageView
VersionView
UpstreamProxyView
}
type LogsView struct {
Logs []map[string]interface{} `json:"logs"`
}
type CacheView struct {
Cache []CachedResponseView `json:"cache"`
}
type CachedResponseView struct {
Key string `json:"key"`
MatchingPair *RequestMatcherResponsePairViewV5 `json:"matchingPair,omitempty"`
HeaderMatch bool `json:"headerMatch"`
ClosestMiss *ClosestMissView `json:"closestMiss"`
}
type ClosestMissView struct {
Response ResponseDetailsViewV5 `json:"response"`
RequestMatcher RequestMatcherViewV5 `json:"requestMatcher"`
MissedFields []string `json:"missedFields"`
}
type JournalView struct {
Journal []JournalEntryView `json:"journal"`
Index []JournalIndexView `json:"indexes"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Total int `json:"total"`
}
type JournalEntryView struct {
Request RequestDetailsView `json:"request"`
Response ResponseDetailsView `json:"response"`
Mode string `json:"mode"`
TimeStarted string `json:"timeStarted"`
Latency float64 `json:"latency"`
Id string `json:"id"`
PostServeActionEntry *PostServeActionEntryView `json:"postServeAction,omitEmpty"`
}
type PostServeActionEntryView struct {
ActionName string `json:"name"`
InvokedTime string `json:"invoked"`
CompletedTime string `json:"completed"`
CorrelationId string `json:"correlationId,omitempty"`
HttpStatus int `json:"status,omitempty"`
}
type JournalEntryFilterView struct {
Request *RequestMatcherViewV5 `json:"request"`
}
type StateView struct {
State map[string]string `json:"state"`
}
type DiffView struct {
Diff []ResponseDiffForRequestView `json:"diff"`
}
type ResponseDiffForRequestView struct {
Request SimpleRequestDefinitionView `json:"request"`
DiffReport []DiffReport `json:"diffReports"`
}
type SimpleRequestDefinitionView struct {
Method string `json:"method"`
Host string `json:"host"`
Path string `json:"path"`
Query string `json:"query"`
}
type DiffReport struct {
Timestamp string `json:"timestamp"`
DiffEntries []DiffReportEntry `json:"diffEntries"`
}
type DiffReportEntry struct {
Field string `json:"field"`
Expected string `json:"expected"`
Actual string `json:"actual"`
}
type DiffFilterView struct {
ExcludedHeaders []string `json:"excludedHeaders"`
ExcludedResponseFields []string `json:"excludedResponseFields"`
}
type JournalIndexView struct {
Name string `json:"name"`
Entries []JournalIndexEntryView `json:"entries,omitempty"`
}
type JournalIndexEntryView struct {
Key string `json:"key"`
JournalEntryId string `json:"journalEntryId"`
}
type JournalIndexRequestView struct {
Name string `json:"name"`
}