ghttp

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const ADD_LINE = 1 << 30
View Source
const (
	DefaultConnections = 10000
)

Variables

This section is empty.

Functions

func CmdErr

func CmdErr(err error)

func Main

func Main(message core.Message, argv0 string, argv []string)

func ParseBody

func ParseBody(Body *[]byte)

Types

type FormVal

type FormVal struct {
	Tag   string
	Fname string
	Body  []byte
}

type Gurl

type Gurl struct {
	*http.Client `json:"-"`

	GurlCore
}

func (*Gurl) Send

func (g *Gurl) Send() (*Response, error)

type GurlCmd

type GurlCmd struct {
	task.Task

	*Gurl
	// contains filtered or unexported fields
}

func (*GurlCmd) Init

func (cmd *GurlCmd) Init()

func (*GurlCmd) SubProcess

func (cmd *GurlCmd) SubProcess(work chan string)

func (*GurlCmd) WaitAll

func (cmd *GurlCmd) WaitAll()

type GurlCore

type GurlCore struct {
	Method string `json:"method,omitempty"`

	Json     []string `json:"Json,omitempty"`
	FormData []string `json:"FormData,omitempty"`
	Header   []string `json:"Header,omitempty"` // http header
	Url      string   `json:"url,omitempty"`
	Output   string   `json:"o,omitempty"`

	Jfa []string `json:"Jfa,omitempty"`

	FormCache []FormVal `json:"-"`

	Body       []byte `json:"body,omitempty"`
	Flag       int
	Verbose    bool `json:"-"`
	UserAgent  string
	Color      bool
	Query      []string
	NotParseAt map[string]struct{}
}

func CopyAndNew

func CopyAndNew(g *GurlCore) *GurlCore

func (*GurlCore) AddFormStr

func (g *GurlCore) AddFormStr(FormData []string)

func (*GurlCore) AddJsonFormStr

func (g *GurlCore) AddJsonFormStr(Jfa []string)

func (*GurlCore) GetOrBodyExec

func (g *GurlCore) GetOrBodyExec(client *http.Client) (*Response, error)

func (*GurlCore) HeadersAdd

func (g *GurlCore) HeadersAdd(req *http.Request)

func (*GurlCore) MultipartExec

func (g *GurlCore) MultipartExec(client *http.Client) (*Response, error)

func (*GurlCore) MultipartNew

func (g *GurlCore) MultipartNew() (*http.Request, chan error, error)

func (*GurlCore) ParseInit

func (g *GurlCore) ParseInit()

func (*GurlCore) SendExec

func (g *GurlCore) SendExec(client *http.Client) (*Response, error)

type Report

type Report struct {
	// contains filtered or unexported fields
}

func NewReport

func NewReport(c, n int, url string) *Report

func (*Report) AddErrNum

func (r *Report) AddErrNum()

func (*Report) Cal

func (r *Report) Cal(now time.Time, resp *Response)

func (*Report) SetDuration

func (r *Report) SetDuration(t time.Duration)

func (*Report) StartReport

func (r *Report) StartReport()

func (*Report) Wait

func (r *Report) Wait()

type Response

type Response struct {
	StatusCode int         `json:"status_code"`
	Err        string      `json:"err"`
	Body       []byte      `json:"body"`
	Status     string      `json:"status"`
	Proto      string      `json:"proto"`
	Header     http.Header `json:"header"`
	Req        *http.Request
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL