-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
47 lines (40 loc) · 995 Bytes
/
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
package apiusage
import (
"bytes"
"github.com/gin-gonic/gin"
)
type RespWriter struct {
gin.ResponseWriter
body *bytes.Buffer
r *ReplayData
}
func (r RespWriter) Write(b []byte) (int, error) {
r.body.Write(b)
return r.ResponseWriter.Write(b)
}
type ResponseError struct {
Code int `json:"code"`
Message string `json:"message"`
}
type HeadersProfiling map[string][]string
type ReplayData struct {
Time int64
Host, Path, Method, URL string
Status_code int
Error bool
Error_msg string
Client struct {
Referer, Authorization, Origin, Remote_address, User_agent, Platform, Browser string
}
Request struct {
Process_time, Content_length int64
Mimetype, Body string
Headers map[string]string
Args HeadersProfiling
}
Response struct {
Content_length int
Mimetype, Body string
Headers HeadersProfiling
}
}