config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UseProxy                = false
	Scheme                  = "socks5"
	Proxy                   = "127.0.0.1:7890"
	DefaultHttpClientConfig = &HttpClientConfig{
		Proxy:        nil,
		HttpTimeout:  2 * time.Second,
		MaxIdleConns: 20,
	}
)

Functions

func GetProxy

func GetProxy(withScheme ...bool) string

func IsWindows

func IsWindows() bool

func SetProxy

func SetProxy()

Types

type HttpClientConfig

type HttpClientConfig struct {
	HttpTimeout  time.Duration
	Proxy        *url.URL
	MaxIdleConns int
}

func (*HttpClientConfig) SetHttpTimeout

func (c *HttpClientConfig) SetHttpTimeout(timeout time.Duration) *HttpClientConfig

func (*HttpClientConfig) SetMaxIdleConns

func (c *HttpClientConfig) SetMaxIdleConns(max int) *HttpClientConfig

func (*HttpClientConfig) SetProxyUrl

func (c *HttpClientConfig) SetProxyUrl(proxyUrl string) *HttpClientConfig

func (*HttpClientConfig) String

func (c *HttpClientConfig) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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