httptest

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCollection

func CreateCollection(uid uint, req view.CreateHttpTestCollection) (collection view.HttpTestCollection, err error)

func CreateUseCase

func CreateUseCase(uid uint, req view.CreateHttpTestCase) (useCase view.HttpTestCase, err error)

func DeleteCollection

func DeleteCollection(uid, id uint) (err error)

func DeleteUseCase

func DeleteUseCase(uid uint, useCaseID uint) (err error)

func GetUseCase

func GetUseCase(id uint) (useCase view.HttpTestCase, err error)

func Init

func Init(opt Option)

func ListCollection

func ListCollection(uid uint, req view.ListHttpCollection) (resp view.RespListHttpTestCollection, err error)

func RequestHistory

func RequestHistory(uid uint, param view.ReqListHttpTestHistory) (resp view.RespListHttpTestHistory, err error)

func RequestHistoryDetail

func RequestHistoryDetail(historyID uint) (detail view.HttpTestLog, err error)

func SendRequest

func SendRequest(uid uint, param view.ReqSendHttpRequest) (res view.HttpTestResponse, err error)

func UpdateUseCase

func UpdateUseCase(uid uint, useCase view.HttpTestCase) (err error)

Types

type HttpResponse added in v0.4.0

type HttpResponse struct {
	Body    string      `json:"body"`
	Status  int         `json:"status"`
	Headers http.Header `json:"headers"`
	Size    int64       `json:"size"`
}

type Option

type Option struct {
	DB     *gorm.DB
	Client *resty.Client
}

type Request added in v0.4.0

type Request struct {
	*resty.Request
	// contains filtered or unexported fields
}

func NewRequest added in v0.4.0

func NewRequest(client *resty.Client, script string, param view.ReqSendHttpRequest, tester *xtest.XTest) *Request

func (*Request) Send added in v0.4.0

func (r *Request) Send(c context.Context) (result xtest.TestResult, err error)

Jump to

Keyboard shortcuts

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