fetch

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(opts ...Option) error

Run fetches a URL and displays response details.

Types

type Config

type Config struct {
	Method      string
	Header      string
	Body        string
	Timeout     time.Duration
	ShowHeaders bool
	DumpReq     bool
	Trace       bool
	Output      string
	URL         string
}

Config holds configuration for the fetch command.

type Option

type Option func(*Config)

Option configures a Config.

func WithBody

func WithBody(body string) Option

func WithDumpReq

func WithDumpReq(dump bool) Option

func WithHeader

func WithHeader(header string) Option

func WithMethod

func WithMethod(method string) Option

func WithOutput

func WithOutput(output string) Option

func WithShowHeaders

func WithShowHeaders(show bool) Option

func WithTimeout

func WithTimeout(d time.Duration) Option

func WithTrace

func WithTrace(trace bool) Option

func WithURL

func WithURL(u string) Option

Jump to

Keyboard shortcuts

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