Documentation ¶
Index ¶
- Constants
- func CacheDNS(domain string)
- func CreateHTTPClient() *http.Client
- func CreateHttpTrace(req *http.Request, client *http.Client) (time.Duration, time.Duration, error, []*http.Cookie)
- func GetHttpRespBody(initResp *http.Response, err error) ([]byte, error)
- func ReadSetCookies(h http.Header) []*http.Cookie
- type ConnectManager
- func (cm ConnectManager) CreateWaitRealTimeNano(StartSoldTimeNano int64) (int64, int64)
- func (cm ConnectManager) CreateWaitTimeNano(StartSoldTimeNano int64) (int64, int64)
- func (cm *ConnectManager) GetCookieString() string
- func (cm *ConnectManager) GetCookieStringForNewTime() string
- func (cm ConnectManager) GetCookieValue(name string) string
- func (cm *ConnectManager) GetTcpTime(url string) int64
- func (cm *ConnectManager) HttpSendAndRecv(req *http.Request) ([]byte, time.Duration, string)
- func (cm *ConnectManager) HttpSendAndRecvNewTcp(req *http.Request) ([]byte, time.Duration)
- func (cm *ConnectManager) InitTcpSocket(urlstr string, num int)
- type GetCookie
Constants ¶
View Source
const ( MaxIdleConns int = 300 MaxIdleConnsPerHost int = 300 IdleConnTimeout int = 90 )
计算理论距离时间
Variables ¶
This section is empty.
Functions ¶
func CreateHTTPClient ¶
创建特定的 HTTP Client var testClient *http.Client
func CreateHttpTrace ¶
Types ¶
type ConnectManager ¶
type ConnectManager struct { PreConnect int //15s 开始生成密钥 TcpConnectTimeTotal int64 //15ms 计算常规往返时间 = meth not find 5次 TcpGatewayTimeTotal int64 TcpConnectTimeAvg int64 TcpGatewayTimeAvg int64 KeyAry []string //密钥 ClientNum int CodeRunTime int64 CodeRunTimeSuccess int64 CodeRunTimeAvg int64 ClientAry []*http.Client //for bill ClientTcp []*http.Client Cookies map[string]http.Cookie TlsCon []*tls.Conn TlsMux *sync.Mutex TlsUsed int Ip string Yz_log_seqn int ConnectIp map[string]int // Client2 *http.Client // Client3 *http.Client // Client4 *http.Client // Client5 *http.Client // PreCalcTimeTotal int //5s 计算未开售时间1次 同时产生预处理连接 // PreCalcCodeTimes int //计算成功次数 // Cookie 目前待定 Mux *sync.Mutex }
func GetConnectManager ¶
func GetConnectManager(PreNum int) ConnectManager
func (ConnectManager) CreateWaitRealTimeNano ¶
func (cm ConnectManager) CreateWaitRealTimeNano(StartSoldTimeNano int64) (int64, int64)
func (ConnectManager) CreateWaitTimeNano ¶
func (cm ConnectManager) CreateWaitTimeNano(StartSoldTimeNano int64) (int64, int64)
func (*ConnectManager) GetCookieString ¶
func (cm *ConnectManager) GetCookieString() string
func (*ConnectManager) GetCookieStringForNewTime ¶
func (cm *ConnectManager) GetCookieStringForNewTime() string
func (ConnectManager) GetCookieValue ¶
func (cm ConnectManager) GetCookieValue(name string) string
func (*ConnectManager) GetTcpTime ¶
func (cm *ConnectManager) GetTcpTime(url string) int64
计算出TCP连接耗时 nana
func (*ConnectManager) HttpSendAndRecv ¶
func (*ConnectManager) HttpSendAndRecvNewTcp ¶
func (*ConnectManager) InitTcpSocket ¶
func (cm *ConnectManager) InitTcpSocket(urlstr string, num int)
type GetCookie ¶
type GetCookie struct { Name string `json:"name"` Value string `json:"value"` Domain string `json:"domain"` Path string `json:"path"` Expires int `json:"expires"` Size int `json:"size"` HTTPOnly bool `json:"httpOnly"` Secure bool `json:"secure"` Session bool `json:"session"` SameParty bool `json:"sameParty"` SourceScheme string `json:"sourceScheme"` SourcePort int `json:"sourcePort"` }
To system Cookie?
func (GetCookie) GetCookieToCookie ¶
Click to show internal directories.
Click to hide internal directories.