Documentation ¶
Index ¶
- func GoBegin[TResult any](action func() TResult) chan TResult
- func GoBegin2[TResult1 any, TResult2 any](action func() (TResult1, TResult2)) chan Pair[TResult1, TResult2]
- func ReceivePair[T1 any, T2 any](receiver chan Pair[T1, T2]) (T1, T2)
- type MockHttpServer
- func (m *MockHttpServer) Do(req *http.Request) (*http.Response, error)
- func (m *MockHttpServer) ExpectRequest(t *testing.T, method string, pathAndQuery string) *RequestWrapper
- func (m *MockHttpServer) GetPendingMessageCount() int
- func (m *MockHttpServer) ReceiveRequest() *http.Request
- func (m *MockHttpServer) Respond(response *http.Response, err error)
- func (m *MockHttpServer) Sling() *sling.Sling
- type Pair
- type RequestWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReceivePair ¶
Types ¶
type MockHttpServer ¶
type MockHttpServer struct { // when the client issues a request, we receive it here Request chan *http.Request // when we want to respond back to the client, we send it here Response chan responseOrError // contains filtered or unexported fields }
func NewMockHttpServer ¶
func NewMockHttpServer() *MockHttpServer
func (*MockHttpServer) ExpectRequest ¶
func (m *MockHttpServer) ExpectRequest(t *testing.T, method string, pathAndQuery string) *RequestWrapper
func (*MockHttpServer) GetPendingMessageCount ¶
func (m *MockHttpServer) GetPendingMessageCount() int
func (*MockHttpServer) ReceiveRequest ¶
func (m *MockHttpServer) ReceiveRequest() *http.Request
func (*MockHttpServer) Respond ¶
func (m *MockHttpServer) Respond(response *http.Response, err error)
func (*MockHttpServer) Sling ¶
func (m *MockHttpServer) Sling() *sling.Sling
type RequestWrapper ¶
type RequestWrapper struct { // in case you need it Request *http.Request Server *MockHttpServer }
func (*RequestWrapper) RespondWith ¶
func (r *RequestWrapper) RespondWith(responseObject any)
func (*RequestWrapper) RespondWithText ¶
func (r *RequestWrapper) RespondWithText(body string)
Click to show internal directories.
Click to hide internal directories.