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 ¶ added in v3.0.26
func AdaptRequest(r HttpRequestComponents) http.Request
func JsonStrFromIoReadCloser ¶ added in v3.0.26
func JsonStrFromIoReadCloser(readCloser io.ReadCloser) string
func Make200Response ¶ added in v3.1.1
func MakeResponse ¶ added in v3.0.26
func MakeResponseWithStatus ¶ added in v3.1.1
func MockDoRequestNoBody ¶ added in v3.0.26
func MockDoRequestWithBody ¶ added in v3.0.26
func MockDoRequestWithBody[T any](mockRequest *MockRequestWithBodyParams[T])
func ParseStructToIoReadCloser ¶
func ParseStructToIoReadCloser[T any](v *T) io.ReadCloser
func RunGlideExternalApiTestCases ¶ added in v3.0.26
func RunGlideExternalApiTestCases[ResponseStructT any]( t *testing.T, testCases []GlideExternalApiTestCase[ResponseStructT], )
Types ¶
type GlideExternalApiTestCase ¶ added in v3.0.26
type HttpRequestComponents ¶ added in v3.0.26
this type is mainly to keep the body an un-modified original struct
func MakeGetRequest ¶ added in v3.1.1
func MakeGetRequest(url string) HttpRequestComponents
func MakeRequest ¶ added in v3.0.26
func MakeRequest[T any](method string, url string, body *T) HttpRequestComponents
func MakeRequestWithNoBody ¶ added in v3.1.1
func MakeRequestWithNoBody(method string, url string) HttpRequestComponents
type MockRequestWithBodyParams ¶ added in v3.0.26
type MockRequestWithBodyParams[T any] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.