module

package
v0.0.0-...-b2c1117 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransAllResponseToPb

func TransAllResponseToPb(response *AllResponse) *protobuf.SingleResponse

func TransAllResponsesToPb

func TransAllResponsesToPb(response []*AllResponse) []*protobuf.SingleResponse

func TransCookieFromPb

func TransCookieFromPb(cookie []*protobuf.Cookie) []*http.Cookie

func TransCookieToPb

func TransCookieToPb(cookie []*http.Cookie) []*protobuf.Cookie

func TransHttpResponseContentToPb

func TransHttpResponseContentToPb(response *HttpResponseContent) *protobuf.HttpResponse

func TransHttpsResponseContentToPb

func TransHttpsResponseContentToPb(response *HttpsResponseContent) *protobuf.HttpsResponse

func TransMapFromListOfString

func TransMapFromListOfString(ofString map[string]*protobuf.ListOfString) map[string][]string

func TransMapToListOfString

func TransMapToListOfString(ofString map[string][]string) map[string]*protobuf.ListOfString

func TransResponseToPb

func TransResponseToPb(response *Response) *protobuf.Response

Types

type AllResponse

type AllResponse struct {
	HttpResponse  *HttpResponseContent
	HttpsResponse *HttpsResponseContent
}

type HttpRequestContent

type HttpRequestContent struct {
	Method  string
	Url     string
	Headers map[string][]string
	// fixme: params: map[string][]string ???
	Params map[string]string
	Body   []byte
}

func TransHttpRequestContentFromPb

func TransHttpRequestContentFromPb(request *protobuf.HttpRequest) *HttpRequestContent

type HttpResponseContent

type HttpResponseContent struct {
	Body    []byte
	Cookies []*http.Cookie
	Headers map[string][]string
	Status  int

	StartTime    time.Time
	FistByteTime time.Duration
	CompleteTime time.Duration

	Error error
}

type HttpsRequestContent

type HttpsRequestContent struct {
	Method             string              `json:"Method,omitempty"`
	Url                string              `json:"Url,omitempty"`
	Headers            map[string][]string `json:"Headers,omitempty"`
	Params             map[string]string   `json:"Params,omitempty"`
	Body               []byte              `json:"Body,omitempty"`
	SkipInsecureVerify bool                `json:"SkipInsecureVerify,omitempty"`
	CaCert             []byte              `json:"CaCert,omitempty"`
	Cert               []byte              `json:"Cert,omitempty"`
	Key                []byte              `json:"Key,omitempty"`
}

func TransHttpsRequestContentFromPb

func TransHttpsRequestContentFromPb(request *protobuf.HttpsRequest) *HttpsRequestContent

type HttpsResponseContent

type HttpsResponseContent struct {
	Body    []byte
	Cookies []*http.Cookie
	Headers map[string][]string
	Status  int

	StartTime    time.Time
	FistByteTime time.Duration
	CompleteTime time.Duration

	Error error
}

type Request

type Request struct {
	RequestSchema SchemaType
	Times         int
	Concurrency   int

	HttpRequest  *HttpRequestContent
	HttpsRequest *HttpsRequestContent
}

func TransRequestFromPb

func TransRequestFromPb(request *protobuf.Request) *Request

type Response

type Response struct {
	ResponseSchema  SchemaType
	TotalTime       time.Duration
	TotalRequests   int
	SuccessRequests int
	ResponseContent []*AllResponse
}

type SchemaType

type SchemaType int32

SchemaType is type of request schema. Such as HTTP, HTTPS. And GRPC, TCP, UDP, etc. will support soon too.

const (
	HTTP SchemaType = iota
	HTTPS
)

Jump to

Keyboard shortcuts

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