Test requests

Technical reference of Solicitudes de prueba.

This API is used in Test requests.


Symbols

SymbolClassDescription
GETconstGET defines a constant value of the API.
POSTconstPOST defines a constant value of the API.
PUTconstPUT defines a constant value of the API.
PATCHconstPATCH defines a constant value of the API.
DELETEconstDELETE defines a constant value of the API.
HEADconstHEAD defines a constant value of the API.
OPTIONSconstOPTIONS defines a constant value of the API.
MaptypeMap defines a public type of API.
ConfigtypeConfig defines a public type of API.
SessiontypeSession defines a public type of API.
RequestURLParamstypeRequestURLParams defines a public type of API.
RequestHeaderstypeRequestHeaders defines a public type of API.
RequestCookiestypeRequestCookies defines a public type of API.
ActionParamstypeActionParams defines a public type of API.
FormDatatypeBuild a body multipart/form-data.
PipeRequesttypePipeRequest defines a public type of API.
PipeExpectedtypePipeExpected defines a public type of API.
NewRequesttypeBuild NewRequest.
NewActionRequesttypeBuild NewActionRequest.
ExecutePipeLinetypeExecuted ExecutePipeLine.
NewResponseExpectedtypeBuild NewResponseExpected.
NewResponseActionExpectedtypeBuild NewResponseActionExpected.

GET

Declaration:

gox
GET     = "GET"

GET defines a constant value of the API.


POST

Declaration:

gox
POST    = "POST"

POST defines a constant value of the API.


PUT

Declaration:

gox
PUT     = "PUT"

PUT defines a constant value of the API.


PATCH

Declaration:

gox
PATCH   = "PATCH"

PATCH defines a constant value of the API.


DELETE

Declaration:

gox
DELETE  = "DELETE"

DELETE defines a constant value of the API.


Declaration:

gox
HEAD    = "HEAD"

HEAD defines a constant value of the API.


OPTIONS

Declaration:

gox
OPTIONS = "OPTIONS"

OPTIONS defines a constant value of the API.


Map

Declaration:

gox
type Map map[string]any

Map defines a public type of API.


Config

Declaration:

gox
type Config struct {
	Session Session `json:"session,omitempty"`
	OverrideConfig func(*server.Config) `json:"-"`
	Iterations      int     `json:"iterations,omitempty"`
	Warmup          int     `json:"warmup,omitempty"`
	BenchSampleRate float64 `json:"benchSampleRate,omitempty"`
}

Config defines a public type of API.

Fields

FieldTypeDescription
SessionSessionjson: "session, omitempty" "Associated session.
OverrideConfigfunc(*server.Config)json: "-"Associated configuration.
Iterationsintjson: "iterations, omitempty" "Public data associated with Iterations.
Warmupintjson: "warmove, omitempty" "Public data associated with Warmup.
BenchSampleRatefloat64json: "benzSampleRate, omitempty" "Public data associated with BenchSampleRate.

Session

Declaration:

gox
type Session map[string]any

Session defines a public type of API.


RequestURLParams

Declaration:

gox
type RequestURLParams map[string]string

RequestURLParams defines a public type of API.


RequestHeaders

Declaration:

gox
type RequestHeaders map[string]string

RequestHeaders defines a public type of API.


RequestCookies

Declaration:

gox
type RequestCookies map[string]string

RequestCookies defines a public type of API.


ActionParams

Declaration:

gox
type ActionParams []any

ActionParams defines a public type of API.


FormData

Declaration:

gox
type FormData map[string]any

Build a body multipart/form-data.


PipeRequest

Declaration:

gox
type PipeRequest interface {
	isPipeRequest()
}

PipeRequest defines a public type of API.


PipeExpected

Declaration:

gox
type PipeExpected interface {
	isPipeExpected()
}

PipeExpected defines a public type of API.


NewRequest

Declaration:

gox
type NewRequest struct {
	Method string `json:"method"`
	URL    string `json:"url"`
	URLParams RequestURLParams `json:"urlParams,omitempty"`
	Headers   RequestHeaders   `json:"headers,omitempty"`
	Cookies   RequestCookies   `json:"cookies,omitempty"`
	Body      RequestBodyValue `json:"-"`
}

Build NewRequest.

Fields

FieldTypeDescription
Methodstringjson: "method" "HTTP method or Action name.
URLstringjson: "url" "Structured request URL.
URLParamsRequestURLParamsjson: "urlParams, omitempty" "Related URL.
HeadersRequestHeadersjson: "heads, omitempty" "Header collection.
CookiesRequestCookiesjson: "cookies, omitempty" "Cookie collection.
BodyRequestBodyValuejson: "-"request body.

NewActionRequest

Declaration:

gox
type NewActionRequest struct {
	URL    string `json:"url"`
	Method string `json:"method"`
	Params ActionParams `json:"params,omitempty"`
}

Build NewActionRequest.

Fields

FieldTypeDescription
URLstringjson: "url" "Structured request URL.
Methodstringjson: "method" "HTTP method or Action name.
ParamsActionParamsjson: "params, omitempty" "Dynamic parameters of the route.

ExecutePipeLine

Declaration:

gox
type ExecutePipeLine struct {
	Request  PipeRequest  `json:"-"`
	Expected PipeExpected `json:"-"`
}

Executed ExecutePipeLine.

Fields

FieldTypeDescription
RequestPipeRequestjson: "-"request associated with execution.
ExpectedPipeExpectedjson: "-"Expected type or value.

NewResponseExpected

Declaration:

gox
type NewResponseExpected struct {
	Status  int                 `json:"status,omitempty"`
	Headers ExpectedHeadersRule `json:"-"`
	Cookies ExpectedCookiesRule `json:"-"`
	Body    ExpectedBodyRule    `json:"-"`
}

Build NewResponseExpected.

Fields

FieldTypeDescription
Statusintjson: "status, omitempty" "Status of the operation.
HeadersExpectedHeadersRulejson: "-"Header collection.
CookiesExpectedCookiesRulejson: "-"Cookie collection.
BodyExpectedBodyRulejson: "-"request body.

NewResponseActionExpected

Declaration:

gox
type NewResponseActionExpected struct {
	Error  ExpectedActionErrorRule  `json:"-"`
	Result ExpectedActionResultRule `json:"-"`
}

Build NewResponseActionExpected.

Fields

FieldTypeDescription
ErrorExpectedActionErrorRulejson: "-"Associated error.
ResultExpectedActionResultRulejson: "-"Associated outcome.

See also

Next step

Continue with bodies and files used by the tests.

Test bodies and files