tcp

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tcp provides tcp option

Package tcp provides tcp option

Package tcp provides tcp option

Index

Constants

View Source
const TCP_FASTOPEN int = 0x17

Variables

This section is empty.

Functions

func Control

func Control(network, address string, c syscall.RawConn) (err error)

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

Jump to

Keyboard shortcuts

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