MCPcopy Create free account

hub / github.com/ProgrammerZamanNow/belajar-golang-restful-api / functions

Functions62 in github.com/ProgrammerZamanNow/belajar-golang-restful-api

↓ 25 callersFunctionPanicIfError
(err error)
helper/error.go:3
↓ 10 callersMethodServeHTTP
(writer http.ResponseWriter, request *http.Request)
middleware/auth_middleware.go:17
↓ 10 callersFunctionsetupRouter
(db *sql.DB)
test/category_controller_test.go:39
↓ 10 callersFunctionsetupTestDB
()
test/category_controller_test.go:27
↓ 10 callersFunctiontruncateCategory
(db *sql.DB)
test/category_controller_test.go:49
↓ 9 callersFunctionWriteToResponseBody
(writer http.ResponseWriter, response interface{})
helper/json.go:14
↓ 7 callersFunctionNewCategoryRepository
()
repository/category_repository_impl.go:14
↓ 7 callersMethodSave
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository.go:10
↓ 5 callersFunctionCommitOrRollback
(tx *sql.Tx)
helper/tx.go:5
↓ 4 callersFunctionToCategoryResponse
(category domain.Category)
helper/model.go:8
↓ 3 callersMethodFindById
(ctx context.Context, categoryId int)
service/category_service.go:12
↓ 3 callersFunctionNewNotFoundError
(error string)
exception/not_found_error.go:7
↓ 2 callersFunctionNewAuthMiddleware
(handler http.Handler)
middleware/auth_middleware.go:13
↓ 2 callersFunctionNewCategoryController
(categoryService service.CategoryService)
controller/category_controller_impl.go:16
↓ 2 callersFunctionNewCategoryService
(categoryRepository repository.CategoryRepository, DB *sql.DB, validate *validator.Validate)
service/category_service_impl.go:20
↓ 2 callersFunctionNewRouter
(categoryController controller.CategoryController)
app/router.go:9
↓ 2 callersFunctionReadFromRequestBody
(request *http.Request, result interface{})
helper/json.go:8
↓ 1 callersMethodCreate
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:9
↓ 1 callersMethodDelete
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:11
↓ 1 callersMethodDelete
(ctx context.Context, categoryId int)
service/category_service.go:11
↓ 1 callersMethodFindAll
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:13
↓ 1 callersMethodFindAll
(ctx context.Context)
service/category_service.go:13
↓ 1 callersMethodFindById
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:12
↓ 1 callersFunctionNewDB
()
app/database.go:9
↓ 1 callersFunctionToCategoryResponses
(categories []domain.Category)
helper/model.go:15
↓ 1 callersMethodUpdate
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:10
↓ 1 callersMethodUpdate
(ctx context.Context, request web.CategoryUpdateRequest)
service/category_service.go:10
↓ 1 callersFunctioninternalServerError
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:61
↓ 1 callersFunctionnotFoundError
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:42
↓ 1 callersFunctionvalidationErrors
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:23
MethodCreate
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:22
MethodCreate
(ctx context.Context, request web.CategoryCreateRequest)
service/category_service_impl.go:28
MethodCreate
(ctx context.Context, request web.CategoryCreateRequest)
service/category_service.go:9
MethodDelete
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:56
MethodDelete
(ctx context.Context, categoryId int)
service/category_service_impl.go:65
MethodDelete
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository_impl.go:38
MethodDelete
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository.go:12
FunctionErrorHandler
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:10
MethodFindAll
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:85
MethodFindAll
(ctx context.Context)
service/category_service_impl.go:91
MethodFindAll
(ctx context.Context, tx *sql.Tx)
repository/category_repository_impl.go:60
MethodFindAll
(ctx context.Context, tx *sql.Tx)
repository/category_repository.go:14
MethodFindById
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:70
MethodFindById
(ctx context.Context, categoryId int)
service/category_service_impl.go:78
MethodFindById
(ctx context.Context, tx *sql.Tx, categoryId int)
repository/category_repository_impl.go:44
MethodFindById
(ctx context.Context, tx *sql.Tx, categoryId int)
repository/category_repository.go:13
MethodSave
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository_impl.go:18
FunctionTestCreateCategoryFailed
(t *testing.T)
test/category_controller_test.go:79
FunctionTestCreateCategorySuccess
(t *testing.T)
test/category_controller_test.go:53
FunctionTestDeleteCategoryFailed
(t *testing.T)
test/category_controller_test.go:260
FunctionTestDeleteCategorySuccess
(t *testing.T)
test/category_controller_test.go:228
FunctionTestGetCategoryFailed
(t *testing.T)
test/category_controller_test.go:205
FunctionTestGetCategorySuccess
(t *testing.T)
test/category_controller_test.go:172
FunctionTestListCategoriesSuccess
(t *testing.T)
test/category_controller_test.go:284
FunctionTestUnauthorized
(t *testing.T)
test/category_controller_test.go:331
FunctionTestUpdateCategoryFailed
(t *testing.T)
test/category_controller_test.go:139
FunctionTestUpdateCategorySuccess
(t *testing.T)
test/category_controller_test.go:104
MethodUpdate
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:36
MethodUpdate
(ctx context.Context, request web.CategoryUpdateRequest)
service/category_service_impl.go:45
MethodUpdate
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository_impl.go:30
MethodUpdate
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository.go:11
Functionmain
()
main.go:15