check

package
v1.0.0-rc2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alpn

func Alpn(expected string) echo.Checker

func And

func And(checkers ...echo.Checker) echo.Checker

And is an aggregate Checker that requires all Checkers succeed. Any nil Checkers are ignored.

func BodyContains

func BodyContains(expected string) echo.Checker

BodyContains checks that the response body contains the given string.

func Cluster

func Cluster(expected string) echo.Checker

func Each

func Each(c func(r echoClient.Response) error) echo.Checker

Each applies the given per-response function across all responses.

func Error

func Error() echo.Checker

Error provides a checker that returns an error if the call succeeds.

func ErrorContains

func ErrorContains(expected string) echo.Checker

ErrorContains is similar to Error, but checks that the error message contains the given string.

func ErrorOrStatus

func ErrorOrStatus(expected int) echo.Checker

func Forbidden

func Forbidden(p protocol.Instance) echo.Checker

Forbidden checks that the response indicates that the request was rejected by RBAC.

func Host

func Host(expected string) echo.Checker

func MTLSForHTTP

func MTLSForHTTP() echo.Checker

func NoError

func NoError() echo.Checker

NoError is similar to echo.NoChecker, but provides additional context information.

func NoErrorAndStatus

func NoErrorAndStatus(expected int) echo.Checker

NoErrorAndStatus is checks that no error occurred and htat the returned status code matches the expected value.

func OK

func OK() echo.Checker

OK is a shorthand for NoErrorAndStatus(200).

func Or

func Or(checkers ...echo.Checker) echo.Checker

Or is an aggregate Checker that requires at least one Checker succeeds.

func Port

func Port(expected int) echo.Checker

func Protocol

func Protocol(expected string) echo.Checker

func ReachedClusters

func ReachedClusters(allClusters cluster.Clusters, expectedClusters cluster.Clusters) echo.Checker

ReachedClusters returns an error if requests did not load balance as expected.

For cases where all clusters are on the same network, verifies that each of the expected clusters was reached.

For multi-network configurations, verifies the current (limited) Istio load balancing behavior when going through a gateway. Ensures that all expected networks were reached, and that all clusters on the same network as the client were reached.

func ReachedTargetClusters

func ReachedTargetClusters(allClusters cluster.Clusters) echo.Checker

ReachedTargetClusters is similar to ReachedClusters, except that the set of expected clusters is retrieved from the Target of the request.

func RequestHeader

func RequestHeader(key, expected string) echo.Checker

func RequestHeaders

func RequestHeaders(expected map[string]string) echo.Checker

func ResponseHeader

func ResponseHeader(key, expected string) echo.Checker

func ResponseHeaders

func ResponseHeaders(expected map[string]string) echo.Checker

func Status

func Status(expected int) echo.Checker

Status checks that the response status code matches the expected value. If the expected value is zero, checks that the response code is unset.

func TooManyRequests

func TooManyRequests() echo.Checker

TooManyRequests checks that at least one message receives a StatusTooManyRequests status code.

func URL

func URL(expected string) echo.Checker

Types

This section is empty.

Jump to

Keyboard shortcuts

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