From c47cccf7e953ad34fbdd6cc664f1c7be59f1a63b Mon Sep 17 00:00:00 2001 From: Fabricio Date: Sat, 23 Nov 2019 11:00:26 -0300 Subject: [PATCH] rename struct --- capture.go | 14 +++++++------- main.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/capture.go b/capture.go index a5e2b0a..c4e5a6c 100644 --- a/capture.go +++ b/capture.go @@ -26,13 +26,6 @@ type Capture struct { Elapsed time.Duration } -// CaptureDump is all the dumps shown in the dashboard -type CaptureDump struct { - Request string `json:"request"` - Response string `json:"response"` - Curl string `json:"curl"` -} - type Req struct { Proto string Method string @@ -50,6 +43,13 @@ type Res struct { Body []byte } +// CaptureInfo is the capture info shown in the dashboard +type CaptureInfo struct { + Request string `json:"request"` + Response string `json:"response"` + Curl string `json:"curl"` +} + // DashboardItem is an item in the dashboard's list type DashboardItem struct { ID int `json:"id"` diff --git a/main.go b/main.go index a3371f3..3c79808 100644 --- a/main.go +++ b/main.go @@ -230,10 +230,10 @@ func NewProxyHandler(URL string) http.HandlerFunc { } } -func dump(c *Capture) CaptureDump { +func dump(c *Capture) CaptureInfo { req := c.Req res := c.Res - return CaptureDump{ + return CaptureInfo{ Request: dumpContent(req.Header, req.Body, "%s %s %s\n\n", req.Method, req.Path, req.Proto), Response: dumpContent(res.Header, res.Body, "%s %s\n\n", res.Proto, res.Status), Curl: dumpCurl(req),