Documentation ¶
Overview ¶
Package apitest Usage:
NewAT(xxx). SetParam(xxx). Debug(). Run(). EqualCode(xxx). Result(xxx). Equal(...). WriteFile(xxx). Err()
Index ¶
- Variables
- func CookieMapToSlice(cm map[string]string) []*http.Cookie
- func JSONIndent(w io.Writer, v interface{})
- func OpenFile(file, title string) (*os.File, error)
- type AT
- func (at *AT) Debug() *AT
- func (at *AT) Equal(args ...interface{}) *AT
- func (at *AT) EqualCode(wantCode int) *AT
- func (at *AT) EqualThen(f func(*AT) error, args ...interface{}) *AT
- func (at *AT) Err() error
- func (at *AT) FakeRun() *AT
- func (at *AT) MarkAuthHeader(authHeaderKey, authHeaderValue string) *AT
- func (at *AT) MonkeyRun() *AT
- func (at *AT) New() *AT
- func (at *AT) PressureRun(n, c int) *AT
- func (at *AT) PressureRunBatch(param []PressureParam) *AT
- func (at *AT) Result(r interface{}) *AT
- func (at *AT) Run() *AT
- func (at *AT) SetCookies(cookies []*http.Cookie) *AT
- func (at *AT) SetHeader(header http.Header) *AT
- func (at *AT) SetParam(param interface{}) *AT
- func (at *AT) SetPort(port string) *AT
- func (at *AT) WriteFile(w io.Writer) *AT
- type ATMock
- func (mockRecv *ATMock) Debug() *AT
- func (mockRecv *ATMock) Equal(args ...interface{}) *AT
- func (mockRecv *ATMock) EqualCode(wantCode int) *AT
- func (mockRecv *ATMock) EqualThen(f func(*AT) error, args ...interface{}) *AT
- func (mockRecv *ATMock) Err() error
- func (mockRecv *ATMock) MonkeyRun() *AT
- func (mockRecv *ATMock) New() *AT
- func (mockRecv *ATMock) PressureRun(n int, c int) *AT
- func (mockRecv *ATMock) PressureRunBatch(param []PressureParam) *AT
- func (mockRecv *ATMock) Result(r interface{}) *AT
- func (mockRecv *ATMock) Run() *AT
- func (mockRecv *ATMock) SetCookies(cookies []*http.Cookie) *AT
- func (mockRecv *ATMock) SetHeader(header http.Header) *AT
- func (mockRecv *ATMock) SetParam(param interface{}) *AT
- func (mockRecv *ATMock) SetPort(port string) *AT
- func (mockRecv *ATMock) WriteFile(w io.Writer) *AT
- type ATMockMock
- func (mockRecv *ATMockMock) Debug() *AT
- func (mockRecv *ATMockMock) Equal(args ...interface{}) *AT
- func (mockRecv *ATMockMock) EqualCode(wantCode int) *AT
- func (mockRecv *ATMockMock) EqualThen(f func(*AT) error, args ...interface{}) *AT
- func (mockRecv *ATMockMock) Err() error
- func (mockRecv *ATMockMock) MonkeyRun() *AT
- func (mockRecv *ATMockMock) New() *AT
- func (mockRecv *ATMockMock) PressureRun(n int, c int) *AT
- func (mockRecv *ATMockMock) PressureRunBatch(param []PressureParam) *AT
- func (mockRecv *ATMockMock) Result(r interface{}) *AT
- func (mockRecv *ATMockMock) Run() *AT
- func (mockRecv *ATMockMock) SetCookies(cookies []*http.Cookie) *AT
- func (mockRecv *ATMockMock) SetHeader(header http.Header) *AT
- func (mockRecv *ATMockMock) SetParam(param interface{}) *AT
- func (mockRecv *ATMockMock) SetPort(port string) *AT
- func (mockRecv *ATMockMock) WriteFile(w io.Writer) *AT
- type IAT
- type IATMock
- type PressureParam
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNilParam 参数为nil ErrNilParam = errors.New("Please input param, param is nil now") )
Predefined error
Functions ¶
func CookieMapToSlice ¶
CookieMapToSlice map转为slice
Types ¶
type AT ¶
type AT struct {
// contains filtered or unexported fields
}
AT api test
func (*AT) MarkAuthHeader ¶ added in v0.8.2
func (*AT) PressureRunBatch ¶
func (at *AT) PressureRunBatch(param []PressureParam) *AT
PressureRunBatch 批量压力运行
type ATMock ¶ added in v0.5.0
type ATMock struct { DebugFunc func() *AT EqualFunc func(args ...interface{}) *AT EqualCodeFunc func(wantCode int) *AT EqualThenFunc func(f func(*AT) error, args ...interface{}) *AT ErrFunc func() error MonkeyRunFunc func() *AT NewFunc func() *AT PressureRunFunc func(n int, c int) *AT PressureRunBatchFunc func(param []PressureParam) *AT ResultFunc func(r interface{}) *AT RunFunc func() *AT SetCookiesFunc func(cookies []*http.Cookie) *AT SetHeaderFunc func(header http.Header) *AT SetParamFunc func(param interface{}) *AT SetPortFunc func(port string) *AT WriteFileFunc func(w io.Writer) *AT }
func (*ATMock) PressureRunBatch ¶ added in v0.5.0
func (mockRecv *ATMock) PressureRunBatch(param []PressureParam) *AT
func (*ATMock) SetCookies ¶ added in v0.5.0
type ATMockMock ¶ added in v0.5.0
type ATMockMock struct { DebugFunc func() *AT EqualFunc func(args ...interface{}) *AT EqualCodeFunc func(wantCode int) *AT EqualThenFunc func(f func(*AT) error, args ...interface{}) *AT ErrFunc func() error MonkeyRunFunc func() *AT NewFunc func() *AT PressureRunFunc func(n int, c int) *AT PressureRunBatchFunc func(param []PressureParam) *AT ResultFunc func(r interface{}) *AT RunFunc func() *AT SetCookiesFunc func(cookies []*http.Cookie) *AT SetHeaderFunc func(header http.Header) *AT SetParamFunc func(param interface{}) *AT SetPortFunc func(port string) *AT WriteFileFunc func(w io.Writer) *AT }
func (*ATMockMock) Debug ¶ added in v0.5.0
func (mockRecv *ATMockMock) Debug() *AT
func (*ATMockMock) Equal ¶ added in v0.5.0
func (mockRecv *ATMockMock) Equal(args ...interface{}) *AT
func (*ATMockMock) EqualCode ¶ added in v0.5.0
func (mockRecv *ATMockMock) EqualCode(wantCode int) *AT
func (*ATMockMock) EqualThen ¶ added in v0.5.0
func (mockRecv *ATMockMock) EqualThen(f func(*AT) error, args ...interface{}) *AT
func (*ATMockMock) Err ¶ added in v0.5.0
func (mockRecv *ATMockMock) Err() error
func (*ATMockMock) MonkeyRun ¶ added in v0.5.0
func (mockRecv *ATMockMock) MonkeyRun() *AT
func (*ATMockMock) New ¶ added in v0.5.0
func (mockRecv *ATMockMock) New() *AT
func (*ATMockMock) PressureRun ¶ added in v0.5.0
func (mockRecv *ATMockMock) PressureRun(n int, c int) *AT
func (*ATMockMock) PressureRunBatch ¶ added in v0.5.0
func (mockRecv *ATMockMock) PressureRunBatch(param []PressureParam) *AT
func (*ATMockMock) Result ¶ added in v0.5.0
func (mockRecv *ATMockMock) Result(r interface{}) *AT
func (*ATMockMock) Run ¶ added in v0.5.0
func (mockRecv *ATMockMock) Run() *AT
func (*ATMockMock) SetCookies ¶ added in v0.5.0
func (mockRecv *ATMockMock) SetCookies(cookies []*http.Cookie) *AT
func (*ATMockMock) SetHeader ¶ added in v0.5.0
func (mockRecv *ATMockMock) SetHeader(header http.Header) *AT
func (*ATMockMock) SetParam ¶ added in v0.5.0
func (mockRecv *ATMockMock) SetParam(param interface{}) *AT
func (*ATMockMock) SetPort ¶ added in v0.5.0
func (mockRecv *ATMockMock) SetPort(port string) *AT
type IAT ¶ added in v0.5.0
type IAT interface { Debug() *AT Equal(args ...interface{}) *AT EqualCode(wantCode int) *AT EqualThen(f func(*AT) error, args ...interface{}) *AT Err() error MonkeyRun() *AT New() *AT PressureRun(n int, c int) *AT PressureRunBatch(param []PressureParam) *AT Result(r interface{}) *AT Run() *AT SetCookies(cookies []*http.Cookie) *AT SetHeader(header http.Header) *AT SetParam(param interface{}) *AT SetPort(port string) *AT WriteFile(w io.Writer) *AT }
type IATMock ¶ added in v0.5.0
type IATMock interface { Debug() *AT Equal(args ...interface{}) *AT EqualCode(wantCode int) *AT EqualThen(f func(*AT) error, args ...interface{}) *AT Err() error MonkeyRun() *AT New() *AT PressureRun(n int, c int) *AT PressureRunBatch(param []PressureParam) *AT Result(r interface{}) *AT Run() *AT SetCookies(cookies []*http.Cookie) *AT SetHeader(header http.Header) *AT SetParam(param interface{}) *AT SetPort(port string) *AT WriteFile(w io.Writer) *AT }
Click to show internal directories.
Click to hide internal directories.