req

package
v0.0.0-...-446bf95 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2016 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Distribute scenario to bots for remote execution

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(scen RequestScenario, writer io.Writer) error

Types

type AuthScheme

type AuthScheme string
const (
	AuthSchemeBasic AuthScheme = "Basic"
)

type BotInfo

type BotInfo struct {
	Url    string
	ApiKey string
}

type Options

type Options struct {
	Debug    bool
	Insecure bool
	Pretty   bool
}

type RequestInfo

type RequestInfo struct {
	Idx        uint `json:"idx"`
	Url        string
	Method     string
	Auth       string
	AuthScheme AuthScheme
	Headers    map[string]string
	Body       string
	Captures   []ResponseCapture
}

type RequestScenario

type RequestScenario struct {
	Init     Variables
	Bots     []BotInfo
	Requests []RequestTemplate
	Options  Options
}

type RequestTemplate

type RequestTemplate struct {
	Url         string
	Method      string
	Auth        string
	AuthScheme  AuthScheme
	Headers     map[string]string
	Body        string
	Captures    []ResponseCapture
	Count       uint
	Concurrency uint
	StartIdx    uint
}

type ResponseCapture

type ResponseCapture struct {
	Source     ResponseCaptureSource
	Name       string
	Expression string
}

type ResponseCaptureSource

type ResponseCaptureSource string
const (
	ResponseCaptureHeader ResponseCaptureSource = "header"
	ResponseCaptureBody   ResponseCaptureSource = "body"
)

type ResponseInfo

type ResponseInfo struct {
	Idx        uint      `json:"idx"`
	Url        string    `json:"url"`
	Timestamp  int64     `json:"timestamp"`
	Elapsed    float64   `json:"elapsed"`
	Length     int64     `json:"length"`
	StatusCode int       `json:"statusCode"`
	Error      string    `json:"error,omitempty"`
	Variables  Variables `json:"-"`
}

type Variables

type Variables map[string]interface{}

Jump to

Keyboard shortcuts

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