app

package
v0.0.0-...-3d2851a Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2016 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERROR_NOT_IN_WHITELIST int = 1001
)
View Source
var StatisticsMap = &HostMap{hostmap: make(map[string]*URLMap)}
View Source
var (
	UserHeader = []string{
		"Content-Type",
		"Accept",
		"Accept-Language",
		"User-Agent",
		"Referer",
		"Cache-Control",
		"Cookie",
		"If-Modified-Since",
		"Etag",
		"Accept-Encoding",
	}
)

Functions

func AddStat

func AddStat(URL *url.URL)

func BuildHttpRequest

func BuildHttpRequest(tr *TextRequest) (*http.Request, error)

func BuildTextResponse

func BuildTextResponse(response http.Response)

func InitTextRequest

func InitTextRequest(tr *TextRequest, hr *http.Request)

func Run

func Run()

Run function

Types

type AdminHandle

type AdminHandle struct{}

func (*AdminHandle) ServeHTTP

func (*AdminHandle) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HostMap

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

func (*HostMap) AddStatistic

func (this *HostMap) AddStatistic(URL *url.URL)

type Statistics

type Statistics struct {
	Path       string
	RequestNum int64
	MinTime    time.Duration
	MaxTime    time.Duration
	TotalTime  time.Duration
}

type TextRequest

type TextRequest struct {
	Header      map[string]string `json:"header"`
	Method      string            `json:"method"`
	Cookies     map[string]string `json:"cookies"`
	Data        string            `json:"data"`
	URL         string            `json:"url"`
	Status      string            `json:-`
	Retry       int               `json:"retry"`
	Timeout     int               `json:"timeout"`
	UserRequset *http.Request     `json:-`
	Tag         string            `json:tag`
}

type TextResponse

type TextResponse struct {
	Body       string `json:"body"`
	HttpStatus int    `json:"status"`
}

func SendRequest

func SendRequest(hr *http.Request) (*TextResponse, error)

type URLMap

type URLMap struct {
	Host       string
	RequsetNum int64
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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