Documentation ¶
Index ¶
- func AdaptRequest(r HttpRequestComponents) http.Request
- func JsonStr[T any](obj *T) string
- func JsonStrFromIoReadCloser(readCloser io.ReadCloser) string
- func Make200Response[T any](body *T) *http.Response
- func MakeResponse(status int, body interface{}) *http.Response
- func MakeResponseWithStatus[T any](status int, body *T) *http.Response
- func MockDoRequestNoBody(httpRequester *mocks.HttpClientRequester, expectedRequest http.Request, ...)
- func MockDoRequestWithBody[T any](mockRequest *MockRequestWithBodyParams[T])
- func ParseReaderToStruct[T any](v io.Reader, t *T) error
- func ParseStructToIoReadCloser[T any](v *T) io.ReadCloser
- func Pointer[T any](v T) *T
- func RunGlideExternalApiTestCases[ResponseStructT any](t *testing.T, testCases []GlideExternalApiTestCase[ResponseStructT])
- type GlideExternalApiTestCase
- type HttpRequestComponents
- type MockRequestWithBodyParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptRequest ¶
func AdaptRequest(r HttpRequestComponents) http.Request
func JsonStrFromIoReadCloser ¶
func JsonStrFromIoReadCloser(readCloser io.ReadCloser) string
func Make200Response ¶
func MakeResponse ¶
func MakeResponseWithStatus ¶
func MockDoRequestNoBody ¶
func MockDoRequestWithBody ¶
func MockDoRequestWithBody[T any](mockRequest *MockRequestWithBodyParams[T])
func ParseStructToIoReadCloser ¶
func ParseStructToIoReadCloser[T any](v *T) io.ReadCloser
func RunGlideExternalApiTestCases ¶
func RunGlideExternalApiTestCases[ResponseStructT any]( t *testing.T, testCases []GlideExternalApiTestCase[ResponseStructT], )
Types ¶
type HttpRequestComponents ¶
this type is mainly to keep the body an un-modified original struct
func MakeGetRequest ¶
func MakeGetRequest(url string) HttpRequestComponents
func MakeRequest ¶
func MakeRequest[T any](method string, url string, body *T) HttpRequestComponents
func MakeRequestWithNoBody ¶
func MakeRequestWithNoBody(method string, url string) HttpRequestComponents
type MockRequestWithBodyParams ¶
type MockRequestWithBodyParams[T any] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.