Documentation
¶
Index ¶
- type Command
- func (c *Command) Name() string
- func (c *Command) QuickReference() string
- func (c *Command) Run(ctx context.Context, execution *commands.Execution) (_ any, err error)
- func (c *Command) Usage() string
- func (c *Command) WithEvents(events aop.EventEmitter) *Command
- func (c *Command) WithLogger(logger telemetry.Logger) *Command
- func (c *Command) WithProxy(proxy string) *Command
- type DataPart
- type FormPart
- type Header
- type Request
- type ResolveEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
Command is a pure-Go, evidence-first reimplementation of curl. It exposes a curl-shaped flag surface so the agent uses it exactly as it would use system curl (this command shadows the system binary), while every request routes through the runner's MITM hub — attributed by tool-call id and captured as http.exchange evidence — and carries a browser-shaped header set by default instead of announcing itself as a scanner.
func (*Command) QuickReference ¶
func (*Command) Run ¶
Run parses the curl-shaped argument vector and performs one exchange. The proxy and CA that route/trust the MITM hub arrive in execution.Env (the builtin runs in-process and does not inherit them from os.Environ).
func (*Command) WithEvents ¶
func (c *Command) WithEvents(events aop.EventEmitter) *Command
type DataPart ¶
DataPart is one -d/--data family value. File means the value is a path to read (@file); Binary keeps the bytes verbatim (--data-binary) while the default -d strips CR/LF from file contents; Raw disables @file handling (--data-raw); URLEncode percent-encodes the content (--data-urlencode).
type FormPart ¶
FormPart is one -F/--form value. File means Value is a path whose bytes become a file part (name=@path, optional ;type= MIME override); Content means Value is a path whose text becomes the field value (name=<path).
type Header ¶
Header is one -H value. Value is empty for a "Name;" send-empty form; Remove is set for a "Name:" form that suppresses a default header.
type Request ¶
type Request struct {
URL string
Method string
MethodExplicit bool // -X/--request was supplied; prevents -I changing it
Headers []Header
Data []DataPart
Form []FormPart
Get bool // -G: send data as query string
Follow bool // -L
MaxRedirs int // --max-redirs (default 50 when following)
UserAgent string // -A
Referer string // -e
User string // -u user[:password]
CookieIn string // -b: cookie string or @file
CookieJar string // -c: write jar here after the exchange
Output string // -o
DumpHeader string // -D: write response headers to a file (or - for stdout)
TraceASCII string // --trace-ascii: write an ASCII wire trace to a file
Include bool // -i
Head bool // -I/--head: issue a HEAD request and include headers
Silent bool // -s
ShowError bool // -S
Fail bool // -f/--fail: fail on HTTP 4xx/5xx
WriteOut string // -w
Verbose bool // -v
NoBuffer bool // -N/--no-buffer: stream response writes without buffering
Insecure bool // -k
Proxy string // -x: override the egress proxy for this invocation
HTTP2 bool // --http2: prefer/require HTTP/2 where available
HTTP11 bool // --http1.1: disable HTTP/2 negotiation
PathAsIs bool // --path-as-is: preserve dot segments in the URL path
Version bool // --version/-V: print the curl compatibility version
Resolve []ResolveEntry // --resolve host:port:address, repeatable
ConnectTimeout time.Duration // --connect-timeout
MaxTime time.Duration // --max-time
}
Request is the parsed, transport-agnostic shape of one curl invocation.
type ResolveEntry ¶
type ResolveEntry struct {
Host string
Port string
Addresses []string
Temporary bool // --resolve +host:... uses curl's temporary DNS lifetime
}
ResolveEntry describes one --resolve mapping. Addresses are tried in order when a target is dialed; the URL host (and therefore the HTTP Host and TLS SNI name) remains unchanged.