v0.0.0-...-05c3f6a Latest Latest

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

Go to latest
Published: May 29, 2016 License: MIT Imports: 18 Imported by: 0




View Source
const (
	UserAgent = "benchmarker"


This section is empty.


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   string
	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)

type UploadAction

type UploadAction struct {
	UploadParamName string
	Asset           *Asset

func NewUploadAction

func NewUploadAction(method, path, uploadParamname string) *UploadAction

func (*UploadAction) Play

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

Jump to

Keyboard shortcuts

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