requests

package
v0.0.0-...-a8af4e8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	METHOD_POST = "POST"
	METHOD_GET  = "GET"
)

Variables

View Source
var HttpClient *http.Client

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	Args        *service.Flags
	Jobs        map[string]*Job
	Urls        []string
	PostData    []string
	ScannerPost *bufio.Reader
	ScannerUrls *bufio.Scanner
	FilePtrPost *os.File
	FilePtrUrls *os.File
	Headers     []string
	Completed   []string
	Failed      []string
	Timeout     int
	Start       time.Time
	Result      *Result
	PostLines   chan string
}
var DispatcherService *Dispatcher

func CreateDispatcher

func CreateDispatcher() *Dispatcher

func (*Dispatcher) ReadPostData

func (d *Dispatcher) ReadPostData() string

reads postdata form file specified in -p param or string from -d flag

func (*Dispatcher) ReadUrl

func (d *Dispatcher) ReadUrl() string

reads urls form file specified in -u param or from argument

func (*Dispatcher) Run

func (d *Dispatcher) Run()

run all processes

type Job

type Job struct {
	Id        string
	TimeStart time.Time
	Duration  float64
	Request   *Request
	Response  *Response
	Completed bool
}

func (*Job) Run

func (j *Job) Run(resp chan *Job)

type Request

type Request struct {
	Url      string
	Method   string
	Headers  []string
	PostData string
}

func (*Request) Run

func (r *Request) Run(jobId string) *Response

type Response

type Response struct {
	JobId       string
	Code        int
	RawResponse string
}

type Result

type Result struct {
	Duration   string
	Requests   int
	Failed     int
	Rps        string
	Min        string
	Max        string
	Avg        string
	LastResult string
}

Jump to

Keyboard shortcuts

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