request

package
v0.0.0-...-b7db0ac Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//RandomSource ...
	RandomSource = rand.NewSource(time.Now().UnixNano())
	//Random ...
	Random = rand.New(RandomSource)
)
View Source
var (
	//TestServer ...
	TestServer *rizo.RequestRecordingServer
)

Functions

func AfterTest

func AfterTest()

func BeforeTest

func BeforeTest()

func HandlerForData

func HandlerForData(options []string, index int, req *http.Request) (outReq *http.Request, err error)

HandlerForData ...

func HandlerForHeader

func HandlerForHeader(options []string, index int, req *http.Request) (*http.Request, error)

HandlerForHeader ...

func HandlerForMethod

func HandlerForMethod(options []string, index int, req *http.Request) (*http.Request, error)

HandlerForMethod ...

func HandlerForUserAgent

func HandlerForUserAgent(options []string, index int, req *http.Request) (*http.Request, error)

HandlerForUserAgent ...

Types

type Adapter

type Adapter struct {
	Handlers map[string]ConfigHandler
}

Adapter ...

func NewRequestAdapter

func NewRequestAdapter() Adapter

NewRequestAdapter ...

func (Adapter) Create

func (instance Adapter) Create(line string) Func

Create ...

type CommandLineLexer

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

CommandLineLexer ...

func NewCommandLineLexer

func NewCommandLineLexer() *CommandLineLexer

NewCommandLineLexer ...

func (*CommandLineLexer) Lex

func (instance *CommandLineLexer) Lex(args string) []string

Lex ...

func (*CommandLineLexer) RecordFlag

func (instance *CommandLineLexer) RecordFlag(char rune)

RecordFlag ...

func (*CommandLineLexer) RecordFlagValue

func (instance *CommandLineLexer) RecordFlagValue(char rune)

RecordFlagValue ...

func (*CommandLineLexer) RecordValue

func (instance *CommandLineLexer) RecordValue(char rune)

RecordValue ...

func (*CommandLineLexer) Start

func (instance *CommandLineLexer) Start(char rune)

Start ...

type ConfigHandler

type ConfigHandler func(options []string, index int, req *http.Request) (*http.Request, error)

ConfigHandler ...

type Func

type Func func() (*http.Request, error)

Func ...

type Lexer

type Lexer interface {
	Lex(args string) []string
}

Lexer ...

type RandomRequestStream

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

RandomRequestStream ...

func (*RandomRequestStream) HasNext

func (instance *RandomRequestStream) HasNext() bool

HasNext ...

func (*RandomRequestStream) Next

func (instance *RandomRequestStream) Next() (*http.Request, error)

Next ...

func (*RandomRequestStream) Progress

func (instance *RandomRequestStream) Progress() int

Progress ...

func (*RandomRequestStream) Reset

func (instance *RandomRequestStream) Reset()

Reset ...

func (*RandomRequestStream) Size

func (instance *RandomRequestStream) Size() int

Size ...

type Reader

type Reader struct {
	Requests []Func
}

Reader ...

func NewRequestReader

func NewRequestReader(filePath string) *Reader

NewRequestReader ...

func (*Reader) Read

func (instance *Reader) Read(index int) Func

Read ...

func (*Reader) Size

func (instance *Reader) Size() int

Size ...

type RequestStream

type RequestStream interface {
	HasNext() bool
	Next() (*http.Request, error)
	Reset()
	Progress() int
	Size() int
}

RequestStream ...

func NewRandomRequestStream

func NewRandomRequestStream(reader *Reader) RequestStream

NewRandomRequestStream ...

func NewSequentialRequestStream

func NewSequentialRequestStream(reader *Reader) RequestStream

NewSequentialRequestStream ...

func NewTimeBasedRequestStream

func NewTimeBasedRequestStream(stream RequestStream, duration time.Duration) RequestStream

NewTimeBasedRequestStream ...

type SequentialRequestStream

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

SequentialRequestStream ...

func (*SequentialRequestStream) HasNext

func (instance *SequentialRequestStream) HasNext() bool

HasNext ...

func (*SequentialRequestStream) Next

func (instance *SequentialRequestStream) Next() (*http.Request, error)

Next ...

func (*SequentialRequestStream) Progress

func (instance *SequentialRequestStream) Progress() int

Progress ...

func (*SequentialRequestStream) Reset

func (instance *SequentialRequestStream) Reset()

Reset ...

func (*SequentialRequestStream) Size

func (instance *SequentialRequestStream) Size() int

Size ...

type StateDelegate

type StateDelegate func(char rune)

StateDelegate ...

type TimeBasedRequestStream

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

TimeBasedRequestStream ...

func (*TimeBasedRequestStream) HasNext

func (instance *TimeBasedRequestStream) HasNext() bool

HasNext ...

func (*TimeBasedRequestStream) Next

func (instance *TimeBasedRequestStream) Next() (*http.Request, error)

Next ...

func (*TimeBasedRequestStream) Progress

func (instance *TimeBasedRequestStream) Progress() int

Progress ...

func (*TimeBasedRequestStream) Reset

func (instance *TimeBasedRequestStream) Reset()

Reset ...

func (*TimeBasedRequestStream) Size

func (instance *TimeBasedRequestStream) Size() int

Size ...

Jump to

Keyboard shortcuts

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