status

package
v3.3.31 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package status contains a modifier to rewrite the status code on a response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModifier

func NewModifier(statusCode int) martian.ResponseModifier

NewModifier constructs a statusModifier that overrides response status codes with the HTTP status code provided.

func NewVerifier

func NewVerifier(statusCode int) verify.ResponseVerifier

NewVerifier returns a new status.Verifier for statusCode.

Types

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

Verifier verifies the status codes of all responses.

func (*Verifier) ModifyResponse

func (v *Verifier) ModifyResponse(res *http.Response) error

ModifyResponse verifies that the status code for all requests matches statusCode.

func (*Verifier) ResetResponseVerifications

func (v *Verifier) ResetResponseVerifications()

ResetResponseVerifications clears all failed response verifications.

func (*Verifier) VerifyResponses

func (v *Verifier) VerifyResponses() error

VerifyResponses returns an error if verification for any request failed. If an error is returned it will be of type *martian.MultiError.

Jump to

Keyboard shortcuts

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