Documentation ¶
Index ¶
- type Scenario
- func (s *Scenario) AssertMethod(method string) error
- func (s *Scenario) AssertRequestHeader(headerKey string, headerValue string) error
- func (s *Scenario) AssertRequestHost(host string) error
- func (s *Scenario) AssertRequestPath(path string) error
- func (s *Scenario) AssertRequestProto(proto string) error
- func (s *Scenario) AssertResponseCertificate(hostname string) error
- func (s *Scenario) AssertResponseHeader(headerKey string, headerValue string) error
- func (s *Scenario) AssertResponseProto(proto string) error
- func (s *Scenario) AssertServedBy(service string) error
- func (s *Scenario) AssertStatusCode(statusCode int) error
- func (s *Scenario) AssertTLSHostname(hostname string) error
- func (s *Scenario) CaptureRoundTrip(method, scheme, hostname, path string, query net_url.Values, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scenario ¶
type Scenario struct { Namespace string IngressName string SecretName string CapturedRequest *http.CapturedRequest CapturedResponse *http.CapturedResponse IPOrFQDN map[string]string NodeIPPort map[string]int32 }
Scenario holds state for a test scenario
func (*Scenario) AssertMethod ¶
AssertMethod returns an error if the captured request method does not match the expected value
func (*Scenario) AssertRequestHeader ¶
AssertRequestHeader returns an error if the captured request headers do not contain the expected headerKey, or if the matching request header value does not match the expected headerValue. If the headerValue string equals `*`, the header value check is ignored.
func (*Scenario) AssertRequestHost ¶
AssertRequestHost returns an error if the captured request host does not match the expected value
func (*Scenario) AssertRequestPath ¶
AssertRequestPath returns an error if the captured request path does not match the expected value
func (*Scenario) AssertRequestProto ¶
AssertRequestProto returns an error if the captured request proto does not match the expected value
func (*Scenario) AssertResponseCertificate ¶
AssertResponseCertificate returns nil if the captured certificate for the named host is valid. Otherwise it returns an error describing the mismatch.
func (*Scenario) AssertResponseHeader ¶
AssertResponseHeader returns an error if the captured response headers do not contain the expected headerKey, or if the matching response header value does not match the expected headerValue. If the headerValue string equals `*`, the header value check is ignored.
func (*Scenario) AssertResponseProto ¶
AssertResponseProto returns an error if the captured response proto does not match the expected value
func (*Scenario) AssertServedBy ¶
AssertServedBy returns an error if the captured request was not served by the expected service
func (*Scenario) AssertStatusCode ¶
AssertStatusCode returns an error if the captured response status code does not match the expected value
func (*Scenario) AssertTLSHostname ¶
AssertTLSHostname returns an error if the captured TLS response hostname does not match the expected value