v0.0.0-...-ba21fa1 Latest Latest

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

Go to latest
Published: Oct 18, 2016 License: MIT Imports: 17 Imported by: 0




View Source
const (
	UserAgent = "isu6q-benchmarker/1.0.0"


View Source
var RedirectAttemptedError = fmt.Errorf("redirect attempted")


func SetTargetHost

func SetTargetHost(host string) (string, error)


type Action

type Action struct {
	Method string
	Path   string

	PostData           map[string]string
	Headers            map[string]string
	ExpectedStatusCode int
	ExpectedLocation   *regexp.Regexp
	ExpectedHeaders    map[string]string
	ExpectedHTML       map[string]string

	Description string

	CheckFunc func(body io.Reader) error

func NewAction

func NewAction(method, path string) *Action

func (*Action) Play

func (a *Action) Play(s *Session) error

type Asset

type Asset struct {
	Path string
	MD5  string
	Type string

type AssetAction

type AssetAction struct {
	Asset *Asset

func NewAssetAction

func NewAssetAction(path string, asset *Asset) *AssetAction

func (*AssetAction) Play

func (a *AssetAction) Play(s *Session) error

type Session

type Session struct {
	Client    *http.Client
	Transport *http.Transport
	// contains filtered or unexported fields

func NewSession

func NewSession() *Session

func (*Session) Fail

func (s *Session) Fail(point int64, req *http.Request, err error) error

func (*Session) NewFileUploadRequest

func (s *Session) NewFileUploadRequest(uri string, params map[string]string, paramName string, asset *Asset) (*http.Request, error)

func (*Session) NewRequest

func (s *Session) NewRequest(method, uri string, body io.Reader) (*http.Request, error)

func (*Session) RefreshClient

func (s *Session) RefreshClient()

func (*Session) SendRequest

func (s *Session) SendRequest(req *http.Request) (*http.Response, error)

func (*Session) Success

func (s *Session) Success(point int64)

Jump to

Keyboard shortcuts

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