Documentation
¶
Index ¶
- Constants
- func CORSMiddleware() mux.MiddlewareFunc
- func CloneExistingRequest(request CloneRequest) *http.Request
- func CloneExistingResponse(r *http.Response) *http.Response
- func ExtractHeaders(resp *http.Response) map[string]any
- func MonitorStatic(wiretapConfig *shared.WiretapConfiguration)
- func ReconstructURL(r *http.Request, protocol, host, basepath string, port string) string
- func ReplaceWithVariables(variables map[string]*shared.CompiledVariable, input string) string
- type CloneRequest
- type FormFile
- type FormPart
- type HttpCookie
- type HttpRequest
- type HttpResponse
- type HttpTransaction
- type HttpTransactionConfig
- type WiretapService
Constants ¶
View Source
const ( WiretapServiceChan = "wiretap" WiretapBroadcastChan = "wiretap-broadcast" WiretapStaticChangeChan = "wiretap-static-change" IncomingHttpRequest = "incoming-http-request" )
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware() mux.MiddlewareFunc
func CloneExistingRequest ¶
func CloneExistingRequest(request CloneRequest) *http.Request
func MonitorStatic ¶
func MonitorStatic(wiretapConfig *shared.WiretapConfiguration)
func ReconstructURL ¶
func ReplaceWithVariables ¶
func ReplaceWithVariables(variables map[string]*shared.CompiledVariable, input string) string
Types ¶
type CloneRequest ¶
type FormFile ¶
type FormFile struct {
Name string `json:"name,omitempty"`
Headers textproto.MIMEHeader `json:"headers,omitempty"`
Data string `json:"data,omitempty"`
}
type HttpCookie ¶
type HttpCookie struct {
Value string `json:"value,omitempty"`
Path string `json:"path,omitempty"`
Domain string `json:"domain,omitempty"`
Expires string `json:"expires,omitempty"`
// MaxAge=0 means no 'Max-Age' attribute specified.
// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
// MaxAge>0 means Max-Age attribute present and given in seconds
MaxAge int `json:"maxAge,omitempty"`
Secure bool `json:"secure,omitempty"`
HttpOnly bool `json:"httpOnly,omitempty"`
}
type HttpRequest ¶
type HttpRequest struct {
Timestamp int64 `json:"timestamp,omitempty"`
URL string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
OriginalPath string `json:"originalPath,omitempty"`
DroppedHeaders []string `json:"droppedHeaders,omitempty"`
InjectedHeaders map[string]string `json:"injectedHeaders,omitempty"`
Query string `json:"query,omitempty"`
Headers map[string]any `json:"headers,omitempty"`
Body string `json:"requestBody,omitempty"`
Cookies map[string]*HttpCookie `json:"cookies,omitempty"`
}
type HttpResponse ¶
type HttpTransaction ¶
type HttpTransaction struct {
Request *HttpRequest `json:"httpRequest,omitempty"`
RequestValidation []*errors.ValidationError `json:"requestValidation,omitempty"`
Response *HttpResponse `json:"httpResponse,omitempty"`
ResponseValidation []*errors.ValidationError `json:"responseValidation,omitempty"`
Id string `json:"id,omitempty"`
}
func BuildHttpTransaction ¶
func BuildHttpTransaction(build HttpTransactionConfig) *HttpTransaction
func BuildResponse ¶
func BuildResponse(r *model.Request, response *http.Response) *HttpTransaction
type HttpTransactionConfig ¶
type WiretapService ¶
type WiretapService struct {
// contains filtered or unexported fields
}
func NewWiretapService ¶
func NewWiretapService(document libopenapi.Document, config *shared.WiretapConfiguration) *WiretapService
func (*WiretapService) HandleHttpRequest ¶
func (ws *WiretapService) HandleHttpRequest(request *model.Request)
func (*WiretapService) HandleServiceRequest ¶
func (ws *WiretapService) HandleServiceRequest(request *model.Request, core service.FabricServiceCore)
func (*WiretapService) Init ¶
func (ws *WiretapService) Init(core service.FabricServiceCore) error
Click to show internal directories.
Click to hide internal directories.