Documentation ¶
Index ¶
- Constants
- func Dial(addr string, opts ...DialOption) (c net.Conn, err error)
- func DialContext(ctx context.Context, addr string, opts ...DialOption) (c net.Conn, err error)
- type AfterHook
- type AfterHookFunc
- type BeforeHook
- type BeforeHookFunc
- type DialMetas
- type DialOption
- func WithAfterHook(hook AfterHook) DialOption
- func WithKeepAlive(keepAlive time.Duration) DialOption
- func WithLocalAddr(laddr string) DialOption
- func WithProtocol(protocol string) DialOption
- func WithProxy(proxyType string, address string) DialOption
- func WithProxyAuth(auth *ProxyAuth) DialOption
- func WithTLSConfig(tlsConfig *tls.Config) DialOption
- func WithTLSConfigAndPriority(priority uint64, tlsConfig *tls.Config) DialOption
- func WithTimeout(timeout time.Duration) DialOption
- type ProxyAuth
- type SharedConn
Constants ¶
View Source
const (
DefaultAfterHookPriority = 10
)
Variables ¶
This section is empty.
Functions ¶
func DialContext ¶ added in v0.5.0
Types ¶
type AfterHook ¶ added in v0.5.0
type AfterHook struct { // smaller value will be called first, 0 is reserved for private use. // If caller set this 0, use DefaultAfterHookPriority instead. Priority uint64 Hook AfterHookFunc }
type AfterHookFunc ¶ added in v0.5.0
type BeforeHook ¶ added in v0.5.0
type BeforeHook struct {
Hook BeforeHookFunc
}
type BeforeHookFunc ¶ added in v0.5.0
type DialMetas ¶ added in v0.5.0
type DialMetas map[interface{}]interface{}
func GetDialMetasFromContext ¶ added in v0.5.0
type DialOption ¶ added in v0.5.0
type DialOption interface {
// contains filtered or unexported methods
}
func WithAfterHook ¶ added in v0.5.0
func WithAfterHook(hook AfterHook) DialOption
func WithKeepAlive ¶ added in v0.5.0
func WithKeepAlive(keepAlive time.Duration) DialOption
func WithLocalAddr ¶ added in v0.5.0
func WithLocalAddr(laddr string) DialOption
func WithProtocol ¶ added in v0.5.0
func WithProtocol(protocol string) DialOption
func WithProxy ¶ added in v0.5.0
func WithProxy(proxyType string, address string) DialOption
func WithProxyAuth ¶ added in v0.5.0
func WithProxyAuth(auth *ProxyAuth) DialOption
func WithTLSConfig ¶ added in v0.5.0
func WithTLSConfig(tlsConfig *tls.Config) DialOption
func WithTLSConfigAndPriority ¶ added in v0.5.0
func WithTLSConfigAndPriority(priority uint64, tlsConfig *tls.Config) DialOption
func WithTimeout ¶ added in v0.5.0
func WithTimeout(timeout time.Duration) DialOption
type SharedConn ¶
type SharedConn struct { // contains filtered or unexported fields }
func NewSharedConn ¶
func NewSharedConn(conn net.Conn) (*SharedConn, io.Reader)
the bytes you read in io.Reader, will be reserved in SharedConn
func NewSharedConnSize ¶
func (*SharedConn) Read ¶
func (sc *SharedConn) Read(p []byte) (n int, err error)
Not thread safety.
func (*SharedConn) ResetBuf ¶
func (sc *SharedConn) ResetBuf(buffer []byte) (err error)
Click to show internal directories.
Click to hide internal directories.