Documentation
¶
Index ¶
- Variables
- func BodyFileUpload(fileUpload FileParam, Params ...ParamInUploadFile) (*bytes.Buffer, string)
- func ConnectWS(urlStr string, ft func(input string) string, f func(conn *websocket.Conn))
- func ParseReqFile(filename string, url string) *http.Request
- func Sends(req []*Request, proxy string, worker int, f func(c DataHandler))
- func SetCookie(req *http.Request, cookies []*http.Cookie) *http.Request
- func UnzipResp(resp *http.Response) string
- type CustomTransport
- func (tr *CustomTransport) ConnDuration() time.Duration
- func (tr *CustomTransport) Dial(network, addr string) (net.Conn, error)
- func (tr *CustomTransport) Duration() time.Duration
- func (tr *CustomTransport) ReqDuration() time.Duration
- func (tr *CustomTransport) RoundTrip(r *http.Request) (*http.Response, error)
- type DataHandler
- type FileParam
- type ParamInUploadFile
- type Request
Constants ¶
This section is empty.
Variables ¶
View Source
var Check bool
Check = True to stop workerpool
Functions ¶
func BodyFileUpload ¶
func BodyFileUpload(fileUpload FileParam, Params ...ParamInUploadFile) (*bytes.Buffer, string)
Process Upload file body in Post request
func ConnectWS ¶
Create connection WS
for use ft -> template func to create request with input and format data return string
f -> function to handle response
Example
sreq.ConnectWS(url, func(input string) string {
sreq.ConnectWS(url, func(input string) string {
req := //somethings
return string(req)
}, func(conn *websocket.Conn) {
for {
_, message, err := conn.ReadMessage()
if err != nil {
log.Println("read:", err)
return
}
//worksomething
}
})
func Sends ¶
func Sends(req []*Request, proxy string, worker int, f func(c DataHandler))
Multi worker to send request
Types ¶
type CustomTransport ¶
type CustomTransport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(proxy string) *CustomTransport
NewTransport return CustomTransport
func (*CustomTransport) ConnDuration ¶
func (tr *CustomTransport) ConnDuration() time.Duration
func (*CustomTransport) Dial ¶
func (tr *CustomTransport) Dial(network, addr string) (net.Conn, error)
func (*CustomTransport) Duration ¶
func (tr *CustomTransport) Duration() time.Duration
func (*CustomTransport) ReqDuration ¶
func (tr *CustomTransport) ReqDuration() time.Duration
type DataHandler ¶
type DataHandler struct {
Resp *http.Response
Req *http.Request
Time time.Duration
DataRet []rune
// contains filtered or unexported fields
}
Data of response store
func Append ¶
func Append(data []DataHandler, temp DataHandler) []DataHandler
Insert new node to array and sort by Index
type ParamInUploadFile ¶
Process Upload File with more param
Click to show internal directories.
Click to hide internal directories.