Documentation ¶
Index ¶
- type CheckCbkFuc
- type CheckTarget
- func (r *CheckTarget) AddCheck(fnCbk CheckCbkFuc, aN ...int) *CheckTarget
- func (r *CheckTarget) Close()
- func (r *CheckTarget) ConnTarget() (*CheckTarget, error)
- func (r *CheckTarget) GetBufReader() *bufio.Reader
- func (r *CheckTarget) GetBufWriter() *bufio.Writer
- func (r *CheckTarget) Log(s string)
- func (r *CheckTarget) ReadAll2Bytes() *[]byte
- func (r *CheckTarget) ReadAll2Str() *string
- func (r *CheckTarget) SendOnePayload(str, szPath, szHost string, nTimes int) string
- func (r *CheckTarget) WriteWithFlush(s string) (nn int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckCbkFuc ¶
type CheckTarget ¶
type CheckTarget struct { Target string `json:"target"` // 目标 Port int `json:"port"` // 端口 ConnState bool `json:"connState"` // 连接状态 ConnType string `json:"connType"` // 连接类型:tcp ReadTimeout int `json:"readTimeout"` // 读数据超市 CheckCbkLists []*CheckCbkFuc `json:"checkCbkLists"` // 回调接口 Conn net.Conn `json:"conn"` // 连接对象 //ConnTLS *tls.Conn `json:"conn"` // ssl 连接对象 MacReadSize uint32 `json:"macReadSize"` // 最大允许读取调数据,避免被反制内存攻击,default:200k HostName string `json:"hostName"` // http header host UrlPath string `json:"urlPath"` // http中url path UrlRaw string `json:"urlRaw"` // full url IsTLS bool `json:"isTLS"` // https CustomHeadersRaw string `json:"customHeadersRaw"` }
func NewCheckTarget ¶
func NewCheckTarget(szUrl, SzType string, readWriteTimeout int) *CheckTarget
准备要检测、链接带目标 需要考虑 ssl的情况
func (*CheckTarget) AddCheck ¶
func (r *CheckTarget) AddCheck(fnCbk CheckCbkFuc, aN ...int) *CheckTarget
添加检测函数 如果检测函数返回true,就不关闭链接,继续发送后续带数据包
func (*CheckTarget) ConnTarget ¶
func (r *CheckTarget) ConnTarget() (*CheckTarget, error)
连接目标 sysctl -w net.ipv4.tcp_keepalive_time=300 sysctl -w net.ipv4.tcp_keepalive_intvl=30 sysctl -w net.ipv4.tcp_keepalive_probes=5
func (*CheckTarget) GetBufWriter ¶
func (r *CheckTarget) GetBufWriter() *bufio.Writer
func (*CheckTarget) Log ¶
func (r *CheckTarget) Log(s string)
func (*CheckTarget) ReadAll2Bytes ¶
func (r *CheckTarget) ReadAll2Bytes() *[]byte
func (*CheckTarget) SendOnePayload ¶
func (r *CheckTarget) SendOnePayload(str, szPath, szHost string, nTimes int) string
send one payload and close
func (*CheckTarget) WriteWithFlush ¶
func (r *CheckTarget) WriteWithFlush(s string) (nn int, err error)
获取操作io
Click to show internal directories.
Click to hide internal directories.