Documentation ¶
Overview ¶
Package tcp provides tcp option
Package tcp provides tcp option ¶
Package tcp provides tcp option
Index ¶
- Constants
- func Control(network, address string, c syscall.RawConn) (err error)
- type Dialer
- type DialerOption
- func WithCache(c cache.Cache) DialerOption
- func WithDNSCacheExpiration(dur string) DialerOption
- func WithDNSRefreshDuration(dur string) DialerOption
- func WithDialerKeepAlive(dur string) DialerOption
- func WithDialerTimeout(dur string) DialerOption
- func WithDisableDNSCache() DialerOption
- func WithDisableDialerDualStack() DialerOption
- func WithEnableDNSCache() DialerOption
- func WithEnableDialerDualStack() DialerOption
- func WithTLS(cfg *tls.Config) DialerOption
Constants ¶
const TCP_FASTOPEN int = 0x17
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dialer ¶
type Dialer interface { GetDialer() func(ctx context.Context, network, addr string) (net.Conn, error) StartDialerCache(ctx context.Context) DialContext(ctx context.Context, network, address string) (net.Conn, error) }
Dialer is an interface to get the dialer instance to connect to an address.
func NewDialer ¶
func NewDialer(opts ...DialerOption) (der Dialer, err error)
NewDialer initialize and return the dialer instance.
type DialerOption ¶
type DialerOption func(*dialer)
DialerOption represent the functional option for dialer.
func WithCache ¶
func WithCache(c cache.Cache) DialerOption
WithCache returns the functional option to set the cache.
func WithDNSCacheExpiration ¶
func WithDNSCacheExpiration(dur string) DialerOption
WithDNSCacheExpiration returns the functional option to set the DNSCacheExpiration.
func WithDNSRefreshDuration ¶
func WithDNSRefreshDuration(dur string) DialerOption
WithDNSRefreshDuration returns the functional option to set the DNSRefreshDuration.
func WithDialerKeepAlive ¶
func WithDialerKeepAlive(dur string) DialerOption
WithDialerKeepAlive returns the functional option to set the DialerKeepAlive.
func WithDialerTimeout ¶
func WithDialerTimeout(dur string) DialerOption
WithDialerTimeout returns the functional option to set the DialerTimeout.
func WithDisableDNSCache ¶
func WithDisableDNSCache() DialerOption
WithDisableDNSCache returns the functional option to disable DNSCache.
func WithDisableDialerDualStack ¶
func WithDisableDialerDualStack() DialerOption
WithDisableDialerDualStack returns the functional option to disable DialerDualStack.
func WithEnableDNSCache ¶
func WithEnableDNSCache() DialerOption
WithEnableDNSCache returns the functional option to enable DNSCache.
func WithEnableDialerDualStack ¶
func WithEnableDialerDualStack() DialerOption
WithEnableDialerDualStack returns the functional option to enable DialerDualStack.
func WithTLS ¶
func WithTLS(cfg *tls.Config) DialerOption
WithTLS returns the functional option to set the DialerTLS.