Documentation
¶
Index ¶
- Variables
- func MustCreateEchoContext(echoLogger *zerolog.Logger, request *http.Request, ...) echo.Context
- func MustCreateEchoContextAndResponseWriter(echoLogger *zerolog.Logger, method string, target string, body interface{}) (echo.Context, *httptest.ResponseRecorder)
- func MustCreateRequestAndResponseWriter(method string, target string, body interface{}) (*http.Request, *httptest.ResponseRecorder)
- func MustMockGorm(gormLogger *zerolog.Logger) (*sql.DB, sqlmock.Sqlmock, *gorm.DB)
- func MustSetupLogging(loglevel zerolog.Level) (*zerolog.Logger, *zerolog.Logger, *zerolog.Logger)
- func Ptr[T any](value T) *T
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTestError = errors.New("test error")
ErrTestError is a test error.
Functions ¶
func MustCreateEchoContext ¶
func MustCreateEchoContext( echoLogger *zerolog.Logger, request *http.Request, responseWriter http.ResponseWriter, ) echo.Context
MustCreateEchoContext creates an echo context with the given logger and request and response writer.
func MustCreateEchoContextAndResponseWriter ¶
func MustCreateEchoContextAndResponseWriter( echoLogger *zerolog.Logger, method string, target string, body interface{}, ) ( echo.Context, *httptest.ResponseRecorder, )
MustCreateEchoContextAndResponseWriter is a convenience function combining MustCreateEchoContext and MustCreateRequestAndResponseWriter when access to the request is not needed.
func MustCreateRequestAndResponseWriter ¶
func MustCreateRequestAndResponseWriter( method string, target string, body interface{}, ) ( *http.Request, *httptest.ResponseRecorder, )
MustCreateRequestAndResponseWriter creates a http request and a response writer in form of a response recorder. Fails matching in tests, when an error occures.
func MustMockGorm ¶
MustMockGorm creates SQL mock and connects gorm to the mock. Fails matching in tests, when an error occures.
func MustSetupLogging ¶
MustSetupLogging creates child loggers for echo, gorm and handlers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.