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) WithoutHeader(name string) *Invocation
- type StubBuilder
- 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) WithoutHeader ¶ added in v0.1.0
func (call *Invocation) WithoutHeader(name string) *Invocation
type StubBuilder ¶
type StubBuilder struct {
// contains filtered or unexported fields
}
func (*StubBuilder) With ¶
func (stub *StubBuilder) With(handler http.HandlerFunc) *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.