Documentation
¶
Index ¶
- type APIMock
- type CallVerifier
- type HTTPCall
- type Invocation
- func (call *Invocation) GetPayload() []byte
- func (call *Invocation) GetRequest() *http.Request
- func (call *Invocation) ReadJSONPayload(obj any)
- func (call *Invocation) WithHeader(name string, expectedValues ...string) *Invocation
- func (call *Invocation) WithPayload(expected []byte) *Invocation
- func (call *Invocation) WithStringPayload(expected string) *Invocation
- func (call *Invocation) WithUrlEncodedFormPayload() *InvocationRequestForm
- func (call *Invocation) WithoutHeader(name string) *Invocation
- type InvocationRequestForm
- type StubBuilder
- func (stub *StubBuilder) With(handler http.HandlerFunc) *APIMock
- func (stub *StubBuilder) WithBody(statusCode int, body []byte, contentType string) *APIMock
- func (stub *StubBuilder) WithJSON(statusCode int, content interface{}) *APIMock
- func (stub *StubBuilder) WithStatusCode(statusCode int) *APIMock
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIMock ¶ added in v0.1.1
type APIMock struct {
// contains filtered or unexported fields
}
type CallVerifier ¶ added in v0.1.0
type CallVerifier struct {
// contains filtered or unexported fields
}
func (*CallVerifier) HasBeenCalled ¶ added in v0.1.0
func (verifier *CallVerifier) HasBeenCalled(expectedCallsCount int) []*Invocation
func (*CallVerifier) HasBeenCalledOnce ¶ added in v0.1.0
func (verifier *CallVerifier) HasBeenCalledOnce() *Invocation
type Invocation ¶
type Invocation struct {
// contains filtered or unexported fields
}
func (*Invocation) GetPayload ¶ added in v0.1.0
func (call *Invocation) GetPayload() []byte
func (*Invocation) GetRequest ¶ added in v0.1.0
func (call *Invocation) GetRequest() *http.Request
func (*Invocation) ReadJSONPayload ¶ added in v0.1.1
func (call *Invocation) ReadJSONPayload(obj any)
func (*Invocation) WithHeader ¶ added in v0.1.0
func (call *Invocation) WithHeader(name string, expectedValues ...string) *Invocation
func (*Invocation) WithPayload ¶ added in v0.1.0
func (call *Invocation) WithPayload(expected []byte) *Invocation
func (*Invocation) WithStringPayload ¶ added in v0.1.0
func (call *Invocation) WithStringPayload(expected string) *Invocation
func (*Invocation) WithUrlEncodedFormPayload ¶ added in v0.3.0
func (call *Invocation) WithUrlEncodedFormPayload() *InvocationRequestForm
func (*Invocation) WithoutHeader ¶ added in v0.1.0
func (call *Invocation) WithoutHeader(name string) *Invocation
type InvocationRequestForm ¶ added in v0.3.0
type InvocationRequestForm struct {
// contains filtered or unexported fields
}
func (InvocationRequestForm) WithValues ¶ added in v0.3.0
func (form InvocationRequestForm) WithValues(expectedValues map[string]string)
func (InvocationRequestForm) WithValuesExactly ¶ added in v0.3.0
func (form InvocationRequestForm) WithValuesExactly(expectedValues map[string]string)
type StubBuilder ¶
type StubBuilder struct {
// contains filtered or unexported fields
}
func (*StubBuilder) With ¶
func (stub *StubBuilder) With(handler http.HandlerFunc) *APIMock
func (*StubBuilder) WithBody ¶ added in v0.2.0
func (stub *StubBuilder) WithBody(statusCode int, body []byte, contentType string) *APIMock
func (*StubBuilder) WithJSON ¶ added in v0.1.1
func (stub *StubBuilder) WithJSON(statusCode int, content interface{}) *APIMock
func (*StubBuilder) WithStatusCode ¶ added in v0.1.0
func (stub *StubBuilder) WithStatusCode(statusCode int) *APIMock
Click to show internal directories.
Click to hide internal directories.