httpclient

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderRetayTimes  = "X-Control-Request-Retry-Times"
	HeaderTimeoutSec  = "X-Control-Request-Timeout-Sec"
	HeaderSpecifiedIP = "X-Control-Request-Specified-IP"
)

Variables

View Source
var (
	LogDebug = func(format string, v ...any) { log.Printf(format, v...) }
	LogError = func(format string, v ...any) { log.Printf(format, v...) }
)

Functions

This section is empty.

Types

type Client

type Client struct {
	http.Client
}

func (*Client) Request

func (hc *Client) Request(ctx context.Context, httpMethod string, url string, body []byte, headers map[string]string) ([]byte, int, error)

type Config

type Config struct {
	DNSResolverAddr string `json:"dns"`
	HTTPDNSAdapter  string `json:"httpdns"`
}

type Manager

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

func New

func New(conf *Config) *Manager

func (*Manager) Client

func (m *Manager) Client(timeout time.Duration) *Client

func (*Manager) Transport

func (m *Manager) Transport(timeout time.Duration) *http.Transport

type SpecifiedIP

type SpecifiedIP []netip.Addr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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