Test results
Technical reference of Resultados de pruebas.
This API is used in Results.
Symbols
| Symbol | Class | Description |
|---|---|---|
| ExecuteResult | type | Executed ExecuteResult. |
| StepResult | type | StepResult defines a public type of API. |
| ResponseSnapshot | type | ResponseSnapshot defines a public type of API. |
| BenchmarkResult | type | BenchmarkResult defines a public type of API. |
| BenchmarkStepResult | type | BenchmarkStepResult defines a public type of API. |
| BenchmarkAllocationSite | type | BenchmarkAllocationSite defines a public type of API. |
| MatchValue | type | MatchValue defines a public type of API. |
| HeaderMatchResult | type | HeaderMatchResult defines a public type of API. |
| BodyMatchResult | type | BodyMatchResult defines a public type of API. |
| BodyMatchFinding | type | BodyMatchFinding defines a public type of API. |
| BodyMatchDiff | type | BodyMatchDiff defines a public type of API. |
| JSONMatchFinding | type | JSONMatchFinding defines a public type of API. |
| ActionValueMatchResult | type | ActionValueMatchResult defines a public type of API. |
| ActionMatchResult | type | ActionMatchResult defines a public type of API. |
| StepResult.MarshalJSON | func | Serialize the value as JSON. |
| ExecuteResult.WriteOutput | func | Write WriteOutput. |
| ExecuteResult.Error | func | Returns the textual representation of the error. |
ExecuteResult
Declaration:
type ExecuteResult struct {
File string `json:"file,omitempty"`
Name string `json:"name,omitempty"`
Mode Mode `json:"mode,omitempty"`
Match bool `json:"match"`
Steps []StepResult `json:"steps"`
Output string `json:"output,omitempty"`
Benchmark *BenchmarkResult `json:"benchmark,omitempty"`
} Executed ExecuteResult.
Fields
| Field | Type | Description |
|---|---|---|
File | stringjson: "file, omitempty" " | Associated file. |
Name | stringjson: "name, omitempty" " | Name of the value. |
Mode | Modejson: "mode, omitempty" " | Execution mode. |
Match | booljson: "match" " | Result or expression of coincidence. |
Steps | []StepResultjson: "steps" " | Public data associated with Steps. |
Output | stringjson: "output, omitempty" " | Output produced. |
Benchmark | *BenchmarkResultjson: "Benchmark, omitempty" " | Public data associated with Benchmark. |
StepResult
Declaration:
type StepResult struct {
Index int `json:"index"`
Type string `json:"type"`
Method string `json:"method"`
URL string `json:"url"`
Match bool `json:"match"`
Response ResponseSnapshot `json:"response,omitempty"`
Status MatchValue `json:"status,omitempty"`
Headers HeaderMatchResult `json:"headers,omitempty"`
Cookies HeaderMatchResult `json:"cookies,omitempty"`
Body BodyMatchResult `json:"body,omitempty"`
Action ActionMatchResult `json:"action,omitempty"`
Error string `json:"error,omitempty"`
Benchmark BenchmarkStepResult `json:"benchmark,omitempty"`
} StepResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Index | intjson: "index" " | Public data associated with Index. |
Type | stringjson: "type" " | Declared type. |
Method | stringjson: "method" " | HTTP method or Action name. |
URL | stringjson: "url" " | Structured request URL. |
Match | booljson: "match" " | Result or expression of coincidence. |
Response | ResponseSnapshotjson: "response, omitempty" " | The associated response status. |
Status | MatchValuejson: "status, omitempty" " | Status of the operation. |
Headers | HeaderMatchResultjson: "heads, omitempty" " | Header collection. |
Cookies | HeaderMatchResultjson: "cookies, omitempty" " | Cookie collection. |
Body | BodyMatchResultjson: "body, omitempty" " | request body. |
Action | ActionMatchResultjson: "action, omitempty" " | Public data associated with Action. |
Error | stringjson: "error, omitempty" " | Associated error. |
Benchmark | BenchmarkStepResultjson: "Benchmark, omitempty" " | Public data associated with Benchmark. |
ResponseSnapshot
Declaration:
type ResponseSnapshot struct {
StatusCode int `json:"statusCode,omitempty"`
Status string `json:"status,omitempty"`
Headers map[string][]string `json:"headers,omitempty"`
Cookies map[string]string `json:"cookies,omitempty"`
Body string `json:"body,omitempty"`
} ResponseSnapshot defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
StatusCode | intjson: "statusCode, omitempty" " | HTTP status code. |
Status | stringjson: "status, omitempty" " | Status of the operation. |
Headers | map[string][]stringjson: "heads, omitempty" " | Header collection. |
Cookies | map[string]stringjson: "cookies, omitempty" " | Cookie collection. |
Body | stringjson: "body, omitempty" " | request body. |
BenchmarkResult
Declaration:
type BenchmarkResult struct {
Warmup int `json:"warmup"`
Iterations int `json:"iterations"`
SampleRate float64 `json:"sampleRate"`
AllocationSamples int `json:"allocationSamples"`
DurationNS int64 `json:"durationNs"`
NsPerOp float64 `json:"nsPerOp"`
OpsPerSec float64 `json:"opsPerSec"`
BytesSentPerOp float64 `json:"bytesSentPerOp"`
BytesRecvPerOp float64 `json:"bytesReceivedPerOp"`
HandlerAllocsOp float64 `json:"handler_allocs/op,omitempty"`
HandlerBytesOp float64 `json:"handler_bytes/op,omitempty"`
Status map[int]int `json:"status"`
Errors int `json:"errors"`
AllocationSites []BenchmarkAllocationSite `json:"allocationSites,omitempty"`
Steps []BenchmarkStepResult `json:"steps,omitempty"`
} BenchmarkResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Warmup | intjson: "warmove" " | Public data associated with Warmup. |
Iterations | intjson: "iterations" " | Public data associated with Iterations. |
SampleRate | float64json: "sampleRate" " | Public data associated with SampleRate. |
AllocationSamples | intjson: "allocationSamples" " | Public data associated with AllocationSamples. |
DurationNS | int64json: "durationNs" " | Length recorded. |
NsPerOp | float64json: "nsPerOp" " | Public data associated with NsPerOp. |
OpsPerSec | float64json: "opsPerSec" " | Public data associated with OpsPerSec. |
BytesSentPerOp | float64json: "bytesSentPerOp" " | Number of bytes. |
BytesRecvPerOp | float64json: "bytesReceivedPerOp" " | Number of bytes. |
HandlerAllocsOp | float64json: "handler _ allocs / op, omitempty" " | Associate Handler. |
HandlerBytesOp | float64json: "handler _ bytes / op, omitempty" " | Associate Handler. |
Status | map[int]intjson: "status" | Status of the operation. |
Errors | intjson: "errors" " | Associated error. |
AllocationSites | []BenchmarkAllocationSitejson: "allocationSites, omitempty" " | Public data associated with AllocationSites. |
Steps | []BenchmarkStepResultjson: "steps, omitempty" " | Public data associated with Steps. |
BenchmarkStepResult
Declaration:
type BenchmarkStepResult struct {
Index int `json:"index"`
Type string `json:"type"`
Method string `json:"method,omitempty"`
URL string `json:"url,omitempty"`
Iterations int `json:"iterations"`
AllocationSamples int `json:"allocationSamples"`
DurationNS int64 `json:"durationNs"`
NsPerOp float64 `json:"nsPerOp"`
OpsPerSec float64 `json:"opsPerSec"`
BytesSentPerOp float64 `json:"bytesSentPerOp"`
BytesRecvPerOp float64 `json:"bytesReceivedPerOp"`
HandlerAllocsOp float64 `json:"handler_allocs/op,omitempty"`
HandlerBytesOp float64 `json:"handler_bytes/op,omitempty"`
AllocationSites []BenchmarkAllocationSite `json:"allocationSites,omitempty"`
Status map[int]int `json:"status"`
Errors int `json:"errors"`
Error string `json:"error,omitempty"`
} BenchmarkStepResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Index | intjson: "index" " | Public data associated with Index. |
Type | stringjson: "type" " | Declared type. |
Method | stringjson: "method, omitempty" " | HTTP method or Action name. |
URL | stringjson: "url, omitempty" " | Structured request URL. |
Iterations | intjson: "iterations" " | Public data associated with Iterations. |
AllocationSamples | intjson: "allocationSamples" " | Public data associated with AllocationSamples. |
DurationNS | int64json: "durationNs" " | Length recorded. |
NsPerOp | float64json: "nsPerOp" " | Public data associated with NsPerOp. |
OpsPerSec | float64json: "opsPerSec" " | Public data associated with OpsPerSec. |
BytesSentPerOp | float64json: "bytesSentPerOp" " | Number of bytes. |
BytesRecvPerOp | float64json: "bytesReceivedPerOp" " | Number of bytes. |
HandlerAllocsOp | float64json: "handler _ allocs / op, omitempty" " | Associate Handler. |
HandlerBytesOp | float64json: "handler _ bytes / op, omitempty" " | Associate Handler. |
AllocationSites | []BenchmarkAllocationSitejson: "allocationSites, omitempty" " | Public data associated with AllocationSites. |
Status | map[int]intjson: "status" | Status of the operation. |
Errors | intjson: "errors" " | Associated error. |
Error | stringjson: "error, omitempty" " | Associated error. |
BenchmarkAllocationSite
Declaration:
type BenchmarkAllocationSite struct {
File string `json:"file"`
Line int `json:"line"`
Name string `json:"name,omitempty"`
Allocs uint64 `json:"allocs"`
Bytes uint64 `json:"bytes"`
} BenchmarkAllocationSite defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
File | stringjson: "file" " | Associated file. |
Line | intjson: "line" " | Associated code line. |
Name | stringjson: "name, omitempty" " | Name of the value. |
Allocs | uint64json: "allocs" " | Public data associated with Allocs. |
Bytes | uint64json: "bytes" " | Number of bytes. |
MatchValue
Declaration:
type MatchValue struct {
Expected any `json:"expected"`
Response any `json:"response"`
Match bool `json:"match"`
Rule string `json:"rule,omitempty"`
Message string `json:"message,omitempty"`
} MatchValue defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Expected | anyjson: "expected" " | Expected type or value. |
Response | anyjson: "response" " | The associated response status. |
Match | booljson: "match" " | Result or expression of coincidence. |
Rule | stringjson: "rule, omitempty" " | Public data associated with Rule. |
Message | stringjson: "message, omitempty" " | A descriptive message. |
HeaderMatchResult
Declaration:
type HeaderMatchResult struct {
Rule string `json:"rule,omitempty"`
Match bool `json:"match"`
Fields map[string]MatchValue `json:"fields,omitempty"`
} HeaderMatchResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Rule | stringjson: "rule, omitempty" " | Public data associated with Rule. |
Match | booljson: "match" " | Result or expression of coincidence. |
Fields | map[string]MatchValuejson: "fields, omitempty" " | Text fields. |
BodyMatchResult
Declaration:
type BodyMatchResult struct {
Rule string `json:"rule,omitempty"`
Expected any `json:"expected,omitempty"`
Response any `json:"response,omitempty"`
Match bool `json:"match"`
Message string `json:"message,omitempty"`
Rules []BodyMatchResult `json:"rules,omitempty"`
Findings []BodyMatchFinding `json:"findings,omitempty"`
JSONFindings []JSONMatchFinding `json:"json_findings,omitempty"`
Diff *BodyMatchDiff `json:"diff,omitempty"`
} BodyMatchResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Rule | stringjson: "rule, omitempty" " | Public data associated with Rule. |
Expected | anyjson: "expected, omitempty" " | Expected type or value. |
Response | anyjson: "response, omitempty" " | The associated response status. |
Match | booljson: "match" " | Result or expression of coincidence. |
Message | stringjson: "message, omitempty" " | A descriptive message. |
Rules | []BodyMatchResultjson: "rules, omitempty" " | Rules set. |
Findings | []BodyMatchFindingjson: "findings, omitempty" " | Public data associated with Findings. |
JSONFindings | []JSONMatchFindingjson: "json _ findings, omitempty" " | Public data associated with JSONFindings. |
Diff | *BodyMatchDiffjson: "diff, omitempty" " | Public data associated with Diff. |
BodyMatchFinding
Declaration:
type BodyMatchFinding struct {
Pattern string `json:"pattern,omitempty"`
Found bool `json:"found"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Offset int `json:"offset,omitempty"`
Snippet string `json:"snippet,omitempty"`
} BodyMatchFinding defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Pattern | stringjson: "pattern, omitempty" " | Pattern used for coincidence. |
Found | booljson: "found" " | Public data associated with Found. |
Line | intjson: "line, omitempty" " | Associated code line. |
Column | intjson: "column, omitempty" " | Public data associated with Column. |
Offset | intjson: "offset, omitempty" " | Public data associated with Offset. |
Snippet | stringjson: "snippet, omitempty" " | Public data associated with Snippet. |
BodyMatchDiff
Declaration:
type BodyMatchDiff struct {
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Offset int `json:"offset,omitempty"`
ExpectedSnippet string `json:"expected_snippet,omitempty"`
ResponseSnippet string `json:"response_snippet,omitempty"`
} BodyMatchDiff defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Line | intjson: "line, omitempty" " | Associated code line. |
Column | intjson: "column, omitempty" " | Public data associated with Column. |
Offset | intjson: "offset, omitempty" " | Public data associated with Offset. |
ExpectedSnippet | stringjson: "expected _ snippet, omitempty" " | Public data associated with ExpectedSnippet. |
ResponseSnippet | stringjson: "response _ snippet, omitempty" " | Public data associated with ResponseSnippet. |
JSONMatchFinding
Declaration:
type JSONMatchFinding struct {
Path string `json:"path,omitempty"`
Expected any `json:"expected,omitempty"`
Response any `json:"response,omitempty"`
Found bool `json:"found"`
Match bool `json:"match"`
Message string `json:"message,omitempty"`
} JSONMatchFinding defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Path | stringjson: "path, omitempty" " | Route used. |
Expected | anyjson: "expected, omitempty" " | Expected type or value. |
Response | anyjson: "response, omitempty" " | The associated response status. |
Found | booljson: "found" " | Public data associated with Found. |
Match | booljson: "match" " | Result or expression of coincidence. |
Message | stringjson: "message, omitempty" " | A descriptive message. |
ActionValueMatchResult
Declaration:
type ActionValueMatchResult struct {
Rule string `json:"rule,omitempty"`
Expected any `json:"expected,omitempty"`
Response any `json:"response,omitempty"`
Match bool `json:"match"`
Fields map[string]MatchValue `json:"fields,omitempty"`
JSONFindings []JSONMatchFinding `json:"json_findings,omitempty"`
Message string `json:"message,omitempty"`
} ActionValueMatchResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Rule | stringjson: "rule, omitempty" " | Public data associated with Rule. |
Expected | anyjson: "expected, omitempty" " | Expected type or value. |
Response | anyjson: "response, omitempty" " | The associated response status. |
Match | booljson: "match" " | Result or expression of coincidence. |
Fields | map[string]MatchValuejson: "fields, omitempty" " | Text fields. |
JSONFindings | []JSONMatchFindingjson: "json _ findings, omitempty" " | Public data associated with JSONFindings. |
Message | stringjson: "message, omitempty" " | A descriptive message. |
ActionMatchResult
Declaration:
type ActionMatchResult struct {
Error ActionValueMatchResult `json:"error,omitempty"`
Result ActionValueMatchResult `json:"result,omitempty"`
Match bool `json:"match"`
} ActionMatchResult defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Error | ActionValueMatchResultjson: "error, omitempty" " | Associated error. |
Result | ActionValueMatchResultjson: "result, omitempty" " | Associated outcome. |
Match | booljson: "match" " | Result or expression of coincidence. |
StepResult.MarshalJSON
Declaration:
func (s StepResult) MarshalJSON() ([]byte, error) Serialize the value as JSON.
Returns
| Return | Type | Description |
|---|---|---|
value | []byte | Result collection; can be nil when there are no values. |
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
MarshalJSON returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
Usage syntax
value, err := stepResult.MarshalJSON() ExecuteResult.WriteOutput
Declaration:
func (r ExecuteResult) WriteOutput(path string) error Write WriteOutput.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Type value string required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
WriteOutput returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
Usage syntax
err := executeResult.WriteOutput(value) ExecuteResult.Error
Declaration:
func (r ExecuteResult) Error() string Returns the textual representation of the error.
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := executeResult.Error()