client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

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

func NewHttpClient

func NewHttpClient(opts ...HttpClientOption) *HttpClient

func (*HttpClient) Client

func (c *HttpClient) Client() *http.Client

Client method returns the current `http.Client` used by HttpClient.

func (*HttpClient) Get

func (c *HttpClient) Get(url string, opts ...HttpClientOption) (*http.Response, error)

func (*HttpClient) GetWithContext

func (c *HttpClient) GetWithContext(ctx context.Context, url string, opts ...HttpClientOption) (*http.Response, error)

type HttpClientOption

type HttpClientOption func(opts *HttpClientOptions)

func WithProxyURL

func WithProxyURL(url string) HttpClientOption

func WithTimeout

func WithTimeout(timeout time.Duration) HttpClientOption

func WithUserAgent

func WithUserAgent(userAgent string) HttpClientOption

type HttpClientOptions

type HttpClientOptions struct {
	UserAgent string
	Timeout   time.Duration
	ProxyURL  string
}

func NewHttpClientOptions

func NewHttpClientOptions() *HttpClientOptions

Jump to

Keyboard shortcuts

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