mock

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(reqs ...*http.Request) engine.Request

func NewResponseWriter

func NewResponseWriter(w *http.Response) http.ResponseWriter

Types

type Request

type Request struct {
	*standard.Request
}

type Response

type Response struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(args ...interface{}) *Response

func (*Response) Body

func (r *Response) Body() []byte

func (*Response) Committed

func (r *Response) Committed() bool

func (*Response) Error

func (r *Response) Error(errMsg string, args ...int)

func (*Response) Flush

func (r *Response) Flush()

func (*Response) Header

func (r *Response) Header() engine.Header

func (*Response) Hijack

func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*Response) Hijacker

func (r *Response) Hijacker(fn func(net.Conn)) error

func (*Response) KeepBody

func (r *Response) KeepBody(on bool)

func (*Response) NotFound

func (r *Response) NotFound()

func (*Response) Object

func (r *Response) Object() interface{}

func (*Response) Redirect

func (r *Response) Redirect(url string, code int)

func (*Response) Reset

func (r *Response) Reset(w http.ResponseWriter, req *http.Request)

func (*Response) ServeContent

func (r *Response) ServeContent(content io.ReadSeeker, name string, modtime time.Time)

func (*Response) ServeFile

func (r *Response) ServeFile(file string)

func (*Response) SetCookie

func (r *Response) SetCookie(cookie *http.Cookie)

func (*Response) SetWriter

func (r *Response) SetWriter(w io.Writer)

func (*Response) Size

func (r *Response) Size() int64

func (*Response) Status

func (r *Response) Status() int

func (*Response) StdResponseWriter

func (r *Response) StdResponseWriter() http.ResponseWriter

func (*Response) Stream

func (r *Response) Stream(step func(io.Writer) bool) (err error)

func (*Response) Write

func (r *Response) Write(b []byte) (n int, err error)

func (*Response) WriteHeader

func (r *Response) WriteHeader(code int)

func (*Response) Writer

func (r *Response) Writer() io.Writer

type ResponseWriter

type ResponseWriter struct {
	*http.Response
	// contains filtered or unexported fields
}

func (*ResponseWriter) Bytes

func (w *ResponseWriter) Bytes() []byte

func (*ResponseWriter) Header

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

func (*ResponseWriter) String

func (w *ResponseWriter) String() string

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(b []byte) (int, error)

func (*ResponseWriter) WriteHeader

func (w *ResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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