body

package
v0.0.0-...-c724f24 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package body allows for the replacement of message body on responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Modifier

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

Modifier substitutes the body on an HTTP response.

func NewModifier

func NewModifier(b []byte, contentType string) (*Modifier, error)

NewModifier constructs and returns a body.Modifier.

func (*Modifier) ModifyRequest

func (m *Modifier) ModifyRequest(ctx *martian.Context, req *http.Request) error

ModifyRequest signals to the proxy to skip the roundtrip.

func (*Modifier) ModifyResponse

func (m *Modifier) ModifyResponse(ctx *martian.Context, res *http.Response) error

ModifyResponse sets the Content-Type header and overrides the response body.

Jump to

Keyboard shortcuts

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