client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHeaders

func ParseHeaders(raw []string) map[string]string

ParseHeaders splits raw "Key: Value" strings into a map. Values containing colons are handled correctly (split on first ": " only).

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config) *Client

func (*Client) ExecuteRequest

func (c *Client) ExecuteRequest(ctx context.Context, params RequestParams) (*Response, error)

type Config

type Config struct {
	BaseURL         string
	DefaultHeaders  map[string]string
	Timeout         time.Duration
	MaxResponseSize int64
	ProxyURL        string
	RetryCount      int
	RetryDelay      time.Duration
	InsecureTLS     bool
}

type RequestParams

type RequestParams struct {
	Method          string
	URL             string
	Headers         map[string]string
	Body            string
	QueryParams     map[string]string
	Timeout         time.Duration
	FollowRedirects bool
	IncludeHeaders  bool
}

type Response

type Response struct {
	StatusCode   int
	StatusText   string
	Headers      http.Header
	Body         []byte
	Duration     time.Duration
	Truncated    bool
	OriginalSize int64
}

Jump to

Keyboard shortcuts

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