writer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseWriter

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

ResponseWriter implements http.ResponseWriter by storing content in memory

func Create

func Create() *ResponseWriter

Create create ResponseWriter

func (*ResponseWriter) Content

func (rw *ResponseWriter) Content() *bytes.Buffer

Content return current contant buffer

func (*ResponseWriter) Header

func (rw *ResponseWriter) Header() http.Header

Header cf. https://golang.org/pkg/net/http/#ResponseWriter

func (*ResponseWriter) SetStatus

func (rw *ResponseWriter) SetStatus(status int)

SetStatus set current writer status

func (*ResponseWriter) Status

func (rw *ResponseWriter) Status() int

Status return current writer status

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(content []byte) (int, error)

Write cf. https://golang.org/pkg/net/http/#ResponseWriter

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(status int)

WriteHeader cf. https://golang.org/pkg/net/http/#ResponseWriter

func (*ResponseWriter) WriteResponse

func (rw *ResponseWriter) WriteResponse(w http.ResponseWriter) (int, error)

WriteResponse write memory content to real http ResponseWriter

Jump to

Keyboard shortcuts

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