mocks

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 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 CookiesJar added in v0.4.0

type CookiesJar struct {
	OnSetCookies func(u *url.URL, cookies []*http.Cookie)
	OnCookies    func(u *url.URL) []*http.Cookie
}

func (*CookiesJar) Cookies added in v0.4.0

func (j *CookiesJar) Cookies(u *url.URL) []*http.Cookie

func (*CookiesJar) SetCookies added in v0.4.0

func (j *CookiesJar) SetCookies(u *url.URL, cookies []*http.Cookie)

type ResponseWriter added in v0.4.0

type ResponseWriter struct {
	OnHeader      func() http.Header
	OnWrite       func([]byte) (int, error)
	OnWriteHeader func(int)
	OnResponse    func(int, interface{}) error
}

func (*ResponseWriter) Header added in v0.4.0

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

func (*ResponseWriter) Response added in v0.4.0

func (w *ResponseWriter) Response(code int, data interface{}) error

func (*ResponseWriter) Write added in v0.4.0

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

func (*ResponseWriter) WriteHeader added in v0.4.0

func (w *ResponseWriter) WriteHeader(statusCode int)

type RoundTripper added in v0.4.0

type RoundTripper struct {
	OnRoundTrip func(*http.Request) (*http.Response, error)
}

func (*RoundTripper) RoundTrip added in v0.4.0

func (rt *RoundTripper) RoundTrip(r *http.Request) (*http.Response, error)

type Stringer

type Stringer struct {
	Value string
}

func (Stringer) GoString

func (s Stringer) GoString() string

func (Stringer) String

func (s Stringer) String() string

type Writer

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

func NewWriterMock

func NewWriterMock(writeFn func(p []byte) (n int, err error)) *Writer

func (*Writer) Write

func (m *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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