Documentation
¶
Overview ¶
Package har provides an adapter for converting HAR (HTTP Archive) files to IR format.
HAR is a standard format for recording HTTP transactions, supported by:
- Browser DevTools (Chrome, Firefox, Safari)
- Playwright and Puppeteer
- Charles Proxy, Fiddler, mitmproxy
- Postman
Index ¶
- func EntryCount(path string) (int, error)
- func FilterByContentType(h *har.HAR, contentType string) []*har.Entry
- func FilterByHost(h *har.HAR, host string) []*har.Entry
- func FilterByMethod(h *har.HAR, method string) []*har.Entry
- func FilterByStatus(h *har.HAR, status int) []*har.Entry
- func FilterEntries(h *har.HAR, predicate func(*har.Entry) bool) []*har.Entry
- func Parse(data []byte) (*har.HAR, error)
- func ParseFile(path string) (*har.HAR, error)
- type Converter
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntryCount ¶
EntryCount returns the number of entries in a HAR file without fully parsing.
func FilterByContentType ¶
FilterByContentType returns entries with responses matching the content type.
func FilterByHost ¶
FilterByHost returns entries matching the given host.
func FilterByMethod ¶
FilterByMethod returns entries matching the given HTTP method.
func FilterByStatus ¶
FilterByStatus returns entries matching the given status code.
func FilterEntries ¶
FilterEntries filters HAR entries based on a predicate function.
Types ¶
type Converter ¶
type Converter struct {
// IncludeHeaders controls whether to include HTTP headers in output.
IncludeHeaders bool
// FilterHeaders is a list of header names to exclude (case-insensitive).
FilterHeaders []string
// IncludeCookies controls whether to include cookies in headers.
IncludeCookies bool
}
Converter converts HAR entries to IR records.
func NewConverter ¶
func NewConverter() *Converter
NewConverter creates a new HAR to IR converter with default settings.
func (*Converter) ConvertBatch ¶
ConvertBatch converts multiple HAR entries to IR records.