recorders

package
v0.0.0-...-b94c5f0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package recorders providers request/response recorders for Gophers tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIB

type APIB struct{}

APIB records request and response to writers in API Blueprint format.

func (*APIB) RecordRequest

func (r *APIB) RecordRequest(req *http.Request, status, headers, body []byte, wc io.WriteCloser) (err error)

RecordRequest writes request's status, headers and body.

func (*APIB) RecordResponse

func (r *APIB) RecordResponse(resp *http.Response, status, headers, body []byte, wc io.WriteCloser) (err error)

RecordResponse writes response's status, headers and body.

type Interface

type Interface interface {
	// RecordRequest writes request's status, headers and body.
	RecordRequest(req *http.Request, status, headers, body []byte, wc io.WriteCloser) (err error)

	// RecordResponse writes response's status, headers and body.
	RecordResponse(resp *http.Response, status, headers, body []byte, wc io.WriteCloser) (err error)
}

Interface is a common interface of all request/response recorders.

type Plain

type Plain struct{}

Plain records request and response to writers in plain text format.

func (*Plain) RecordRequest

func (r *Plain) RecordRequest(req *http.Request, status, headers, body []byte, wc io.WriteCloser) (err error)

RecordRequest writes request's status, headers and body.

func (*Plain) RecordResponse

func (r *Plain) RecordResponse(resp *http.Response, status, headers, body []byte, wc io.WriteCloser) (err error)

RecordResponse writes response's status, headers and body.

Jump to

Keyboard shortcuts

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