Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCookies ¶
Types ¶
type HAR ¶
type HAR struct {
Log struct {
Version string `json:"version"`
Creator struct {
Name string `json:"name"`
Version string `json:"version"`
} `json:"creator"`
Pages []interface{} `json:"pages"`
Entries []struct {
Initiator *struct {
Type string `json:"type"`
Stack struct {
CallFrames []struct {
FunctionName string `json:"functionName"`
ScriptId string `json:"scriptId"`
Url string `json:"url"`
LineNumber int `json:"lineNumber"`
ColumnNumber int `json:"columnNumber"`
} `json:"callFrames"`
} `json:"stack"`
} `json:"_initiator"`
Priority string `json:"_priority"`
ResourceType string `json:"_resourceType"`
Cache *struct {
} `json:"cache"`
Connection string `json:"connection"`
Request *struct {
Method string `json:"method"`
Url string `json:"url"`
HttpVersion string `json:"httpVersion"`
Headers []struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"headers"`
QueryString []interface{} `json:"queryString"`
Cookies []*struct {
Name string `json:"name"`
Value string `json:"value"`
Path string `json:"path"`
Domain string `json:"domain"`
Expires time.Time `json:"expires"`
HttpOnly bool `json:"httpOnly"`
Secure bool `json:"secure"`
SameSite string `json:"sameSite"`
} `json:"cookies"`
HeadersSize int `json:"headersSize"`
BodySize int `json:"bodySize"`
PostData *struct {
MimeType string `json:"mimeType"`
Text string `json:"text"`
} `json:"postData"`
} `json:"request"`
Response *struct {
Status int `json:"status"`
StatusText string `json:"statusText"`
HttpVersion string `json:"httpVersion"`
Headers []struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"headers"`
Cookies []struct {
Name string `json:"name"`
Value string `json:"value"`
Path string `json:"path"`
Domain string `json:"domain"`
Expires time.Time `json:"expires"`
HttpOnly bool `json:"httpOnly"`
Secure bool `json:"secure"`
SameSite string `json:"sameSite"`
} `json:"cookies"`
Content *struct {
Size int `json:"size"`
MimeType string `json:"mimeType"`
Text string `json:"text"`
} `json:"content"`
RedirectURL string `json:"redirectURL"`
HeadersSize int `json:"headersSize"`
BodySize int `json:"bodySize"`
TransferSize int `json:"_transferSize"`
Error interface{} `json:"_error"`
} `json:"response"`
ServerIPAddress string `json:"serverIPAddress"`
StartedDateTime interface{} `json:"startedDateTime"`
Time float32 `json:"time"`
Timings struct {
Blocked float32 `json:"blocked"`
Dns float32 `json:"dns"`
Ssl float32 `json:"ssl"`
Connect float32 `json:"connect"`
Send float32 `json:"send"`
Wait float32 `json:"wait"`
Receive float32 `json:"receive"`
BlockedQueueing float32 `json:"_blocked_queueing"`
} `json:"timings"`
} `json:"entries"`
} `json:"log"`
}
type HAREntry ¶
type HAREntry struct {
HARRequest *HARRequest
HARResponse *HARResponse
}
type HARRequest ¶
type HARResponse ¶
type RequestInfo ¶
type RequestInfo struct {
URL *url.URL
Header http.Header
XHeader http.Header
Cookies []*http.Cookie
UserAgent useragent.UserAgent
ChromeVersion int
}
func ParseCURL ¶
func ParseCURL(data []byte) (*RequestInfo, error)
func ParseCURLFile ¶
func ParseCURLFile(path string) (*RequestInfo, error)
func ParseHARFile ¶
func ParseHARFile(path, requestUrl string) (*RequestInfo, error)
func ParseRequestFromHAR ¶
func ParseRequestFromHAR(data []byte, requestUrl string) (*RequestInfo, error)
ParseRequestFromHAR Parses request given from HAR reader and returns the request by requestUrl info
Click to show internal directories.
Click to hide internal directories.