tcurlv2

package
v0.0.0-...-36d6306 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MethodGET = "GET"

Variables

This section is empty.

Functions

func BuildCurl

func BuildCurl(resolved *CurlResolvedV2) (string, error)

BuildCurl assembles a curl command string from the resolved HTTP structure. This creates a curl command that represents the HTTP request.

func ExtractURLForTesting

func ExtractURLForTesting(curlStr string) string

ExtractURLForTesting exposes extractURL for testing purposes

func GetFileContent

func GetFileContent(resolved *CurlResolvedV2) (*mfile.File, *mhttp.HTTP)

GetFileContent returns both the file and HTTP content for easy processing

Types

type ConvertCurlOptions

type ConvertCurlOptions struct {
	WorkspaceID  idwrap.IDWrap
	FolderID     *idwrap.IDWrap
	ParentHttpID *idwrap.IDWrap // For delta system support
	IsDelta      bool           // Whether this is a delta variation
	DeltaName    *string        // Optional delta name
	Filename     string         // Optional filename (defaults to URL)
}

ConvertCurlOptions contains options for the curl conversion

type CurlResolvedV2

type CurlResolvedV2 struct {
	// Primary HTTP request
	HTTP mhttp.HTTP

	// Associated data structures
	SearchParams   []mhttp.HTTPSearchParam
	Headers        []mhttp.HTTPHeader
	BodyForms      []mhttp.HTTPBodyForm
	BodyUrlencoded []mhttp.HTTPBodyUrlencoded
	BodyRaw        *mhttp.HTTPBodyRaw

	// File system integration
	File mfile.File
}

CurlResolvedV2 contains the resolved HTTP request data using the new models

func ConvertCurl

func ConvertCurl(curlStr string, opts ConvertCurlOptions) (*CurlResolvedV2, error)

ConvertCurl converts a curl command string to the new HTTP model structures

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL