...
Source file
src/net/hook.go
Documentation: net
1
2
3
4
5 package net
6
7 import (
8 "context"
9 "time"
10 )
11
12 var (
13
14 testHookDialTCP func(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn, error)
15
16 testHookLookupIP = func(
17 ctx context.Context,
18 fn func(context.Context, string, string) ([]IPAddr, error),
19 network string,
20 host string,
21 ) ([]IPAddr, error) {
22 return fn(ctx, network, host)
23 }
24 testHookSetKeepAlive = func(time.Duration) {}
25
26
27
28
29
30 testHookStepTime = func() {}
31 )
32
View as plain text