package status

import "github.com/google/martian/v3/status"

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

Index

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.

Source Files

status_modifier.go status_verifier.go

Version
v3.3.3 (latest)
Published
Aug 16, 2022
Platform
darwin/amd64
Imports
6 packages
Last checked
3 hours ago

Tools for package owners.