Documentation
¶
Index ¶
- Constants
- func DBMocks() (*gorm.DB, *sql.DB, sqlmock.Sqlmock)
- func EngineMock() *gin.Engine
- func HTTPMocks() (*httptest.ResponseRecorder, *gin.Context, *gin.Engine)
- func PerformRequest(r http.Handler, method, path string, body io.Reader) *httptest.ResponseRecorder
- func PerformRequestBasic(r http.Handler, req *http.Request) *httptest.ResponseRecorder
- func PerformRequestWithHeaders(r http.Handler, method, path string, body io.Reader, headers map[string]string) *httptest.ResponseRecorder
- type AnyTime
Constants ¶
View Source
const ( Query_GetUserByID = `SELECT * FROM "users" WHERE id = $1 AND "users"."deleted_at" IS NULL ORDER BY "users"."id" LIMIT 1` Query_GetUserByUsername = `SELECT * FROM "users" WHERE username = $1 AND "users"."deleted_at" IS NULL ORDER BY "users"."id" LIMIT 1` Query_GetTodos = `SELECT * FROM "todos" WHERE "todos"."deleted_at" IS NULL` Query_GetTodoByID = `SELECT * FROM "todos" WHERE id = $1 AND "todos"."deleted_at" IS NULL ORDER BY "todos"."id" LIMIT 1` Query_GetTodosByOwnerID = `SELECT * FROM "todos" WHERE owner_id = $1 AND "todos"."deleted_at" IS NULL` Query_CreateTodo = `` /* 136-byte string literal not displayed */ Query_DeleteTodo = `UPDATE "todos" SET "deleted_at"=$1 WHERE "todos"."id" = $2 AND "todos"."deleted_at" IS NULL` Query_UpdateTodo = `` /* 158-byte string literal not displayed */ )
These are queries executed by GORM for the corresponding actions. They are useful for unit testing with sqlmock.
Variables ¶
This section is empty.
Functions ¶
func EngineMock ¶
func PerformRequest ¶
func PerformRequestBasic ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.