Documentation
¶
Index ¶
- Constants
- func CreateDeltaBodyForms(originalForms []mhttp.HTTPBodyForm, newForms []mhttp.HTTPBodyForm, ...) []mhttp.HTTPBodyForm
- func CreateDeltaBodyRaw(originalRaw *mhttp.HTTPBodyRaw, newRaw *mhttp.HTTPBodyRaw, ...) *mhttp.HTTPBodyRaw
- func CreateDeltaBodyUrlEncoded(originalEncoded []mhttp.HTTPBodyUrlencoded, ...) []mhttp.HTTPBodyUrlencoded
- func CreateDeltaHeaders(originalHeaders []mhttp.HTTPHeader, newHeaders []mhttp.HTTPHeader, ...) []mhttp.HTTPHeader
- func CreateDeltaSearchParams(originalParams []mhttp.HTTPSearchParam, newParams []mhttp.HTTPSearchParam, ...) []mhttp.HTTPSearchParam
- func ReorganizeNodePositions(result *HarResolved) error
- type Content
- type Entry
- type HAR
- type HarResolved
- func ConvertHAR(har *HAR, workspaceID idwrap.IDWrap) (*HarResolved, error)
- func ConvertHARWithDepFinder(har *HAR, workspaceID idwrap.IDWrap, depFinder *depfinder.DepFinder) (*HarResolved, error)
- func ConvertHARWithDepFinderAndService(ctx context.Context, har *HAR, workspaceID idwrap.IDWrap, ...) (*HarResolved, error)
- func ConvertHARWithService(ctx context.Context, har *HAR, workspaceID idwrap.IDWrap, ...) (*HarResolved, error)
- type Header
- type Log
- type Param
- type PostData
- type Query
- type Request
- type Response
Constants ¶
const ( RawBodyCheck = "application/json" FormBodyCheck = "multipart/form-data" UrlEncodedBodyCheck = "application/x-www-form-urlencoded" TimestampSequencingThreshold = 50 * time.Millisecond // Connect requests within 50ms for better sequencing )
Constants for processing behavior
const DescriptionImportedFromHAR = "Imported from HAR"
Variables ¶
This section is empty.
Functions ¶
func CreateDeltaBodyForms ¶
func CreateDeltaBodyForms(originalForms []mhttp.HTTPBodyForm, newForms []mhttp.HTTPBodyForm, deltaHttpID idwrap.IDWrap) []mhttp.HTTPBodyForm
CreateDeltaBodyForms creates delta body forms when HAR forms differ from base request
func CreateDeltaBodyRaw ¶
func CreateDeltaBodyRaw(originalRaw *mhttp.HTTPBodyRaw, newRaw *mhttp.HTTPBodyRaw, deltaHttpID idwrap.IDWrap) *mhttp.HTTPBodyRaw
CreateDeltaBodyRaw creates delta raw body when HAR differs from base request
func CreateDeltaBodyUrlEncoded ¶
func CreateDeltaBodyUrlEncoded(originalEncoded []mhttp.HTTPBodyUrlencoded, newEncoded []mhttp.HTTPBodyUrlencoded, deltaHttpID idwrap.IDWrap) []mhttp.HTTPBodyUrlencoded
CreateDeltaBodyUrlEncoded creates delta URL-encoded body when HAR differs from base request
func CreateDeltaHeaders ¶
func CreateDeltaHeaders(originalHeaders []mhttp.HTTPHeader, newHeaders []mhttp.HTTPHeader, deltaHttpID idwrap.IDWrap) []mhttp.HTTPHeader
CreateDeltaHeaders creates delta headers when HAR headers differ from base request
func CreateDeltaSearchParams ¶
func CreateDeltaSearchParams(originalParams []mhttp.HTTPSearchParam, newParams []mhttp.HTTPSearchParam, deltaHttpID idwrap.IDWrap) []mhttp.HTTPSearchParam
CreateDeltaSearchParams creates delta search params when HAR params differ from base request
func ReorganizeNodePositions ¶
func ReorganizeNodePositions(result *HarResolved) error
ReorganizeNodePositions positions flow nodes using a level-based horizontal layout. Sequential nodes flow left-to-right, parallel nodes are stacked vertically. Uses the shared flowgraph package for layout calculation.
Types ¶
type Content ¶
type Content struct {
Size int `json:"size"`
MimeType string `json:"mimeType"`
Text string `json:"text"`
}
Content represents the response body content
type Entry ¶
type Entry struct {
StartedDateTime time.Time `json:"startedDateTime"`
ResourceType string `json:"_resourceType"`
Request Request `json:"request"`
Response Response `json:"response"`
}
Entry represents a single HTTP request/response pair
type HAR ¶
type HAR struct {
Log Log `json:"log"`
}
HAR represents the structure of a HAR (HTTP Archive) file
func ConvertRaw ¶
ConvertRaw parses raw HAR data into our HAR structure
type HarResolved ¶
type HarResolved struct {
// HTTP Requests (modern mhttp.HTTP model)
HTTPRequests []mhttp.HTTP `json:"http_requests"`
// Child Entities
HTTPHeaders []mhttp.HTTPHeader `json:"http_headers"`
HTTPSearchParams []mhttp.HTTPSearchParam `json:"http_search_params"`
HTTPBodyForms []mhttp.HTTPBodyForm `json:"http_body_forms"`
HTTPBodyUrlEncoded []mhttp.HTTPBodyUrlencoded `json:"http_body_urlencoded"`
HTTPBodyRaws []mhttp.HTTPBodyRaw `json:"http_body_raws"`
HTTPAsserts []mhttp.HTTPAssert `json:"http_asserts"`
// File System (modern mfile.File model)
Files []mfile.File `json:"files"`
// Flow Items (preserving existing flow generation)
Flow mflow.Flow `json:"flow"`
Nodes []mflow.Node `json:"nodes"`
RequestNodes []mflow.NodeRequest `json:"request_nodes"`
Edges []mflow.Edge `json:"edges"`
}
HarResolved represents the complete translated result using modern models
func ConvertHAR ¶
func ConvertHAR(har *HAR, workspaceID idwrap.IDWrap) (*HarResolved, error)
ConvertHAR is the main entry point for HAR conversion using modern architecture This is the primary function that replaces the legacy ConvertHAR from thar package
func ConvertHARWithDepFinder ¶
func ConvertHARWithDepFinder(har *HAR, workspaceID idwrap.IDWrap, depFinder *depfinder.DepFinder) (*HarResolved, error)
ConvertHARWithDepFinder converts HAR with dependency finding support
func ConvertHARWithDepFinderAndService ¶
func ConvertHARWithDepFinderAndService(ctx context.Context, har *HAR, workspaceID idwrap.IDWrap, depFinder *depfinder.DepFinder, httpService *shttp.HTTPService) (*HarResolved, error)
ConvertHARWithDepFinderAndService converts HAR with dependency finding and overwrite detection
func ConvertHARWithService ¶
func ConvertHARWithService(ctx context.Context, har *HAR, workspaceID idwrap.IDWrap, httpService *shttp.HTTPService) (*HarResolved, error)
ConvertHARWithService converts HAR with overwrite detection using HTTP service This is the enhanced function that prevents duplicates and creates proper deltas
type Log ¶
type Log struct {
Entries []Entry `json:"entries"`
}
Log contains the entries of a HAR file
type PostData ¶
type PostData struct {
MimeType string `json:"mimeType"`
Text string `json:"text"`
Params []Param `json:"params,omitempty"`
}
PostData represents the request body data
type Request ¶
type Request struct {
Method string `json:"method"`
URL string `json:"url"`
HTTPVersion string `json:"httpVersion"`
Headers []Header `json:"headers"`
PostData *PostData `json:"postData,omitempty"`
QueryString []Query `json:"queryString"`
}
Request represents the HTTP request information