Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ProgrammerZamanNow/belajar-golang-restful-api
/ functions
Functions
62 in github.com/ProgrammerZamanNow/belajar-golang-restful-api
⨍
Functions
62
◇
Types & classes
13
↓ 25 callers
Function
PanicIfError
(err error)
helper/error.go:3
↓ 10 callers
Method
ServeHTTP
(writer http.ResponseWriter, request *http.Request)
middleware/auth_middleware.go:17
↓ 10 callers
Function
setupRouter
(db *sql.DB)
test/category_controller_test.go:39
↓ 10 callers
Function
setupTestDB
()
test/category_controller_test.go:27
↓ 10 callers
Function
truncateCategory
(db *sql.DB)
test/category_controller_test.go:49
↓ 9 callers
Function
WriteToResponseBody
(writer http.ResponseWriter, response interface{})
helper/json.go:14
↓ 7 callers
Function
NewCategoryRepository
()
repository/category_repository_impl.go:14
↓ 7 callers
Method
Save
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository.go:10
↓ 5 callers
Function
CommitOrRollback
(tx *sql.Tx)
helper/tx.go:5
↓ 4 callers
Function
ToCategoryResponse
(category domain.Category)
helper/model.go:8
↓ 3 callers
Method
FindById
(ctx context.Context, categoryId int)
service/category_service.go:12
↓ 3 callers
Function
NewNotFoundError
(error string)
exception/not_found_error.go:7
↓ 2 callers
Function
NewAuthMiddleware
(handler http.Handler)
middleware/auth_middleware.go:13
↓ 2 callers
Function
NewCategoryController
(categoryService service.CategoryService)
controller/category_controller_impl.go:16
↓ 2 callers
Function
NewCategoryService
(categoryRepository repository.CategoryRepository, DB *sql.DB, validate *validator.Validate)
service/category_service_impl.go:20
↓ 2 callers
Function
NewRouter
(categoryController controller.CategoryController)
app/router.go:9
↓ 2 callers
Function
ReadFromRequestBody
(request *http.Request, result interface{})
helper/json.go:8
↓ 1 callers
Method
Create
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:9
↓ 1 callers
Method
Delete
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:11
↓ 1 callers
Method
Delete
(ctx context.Context, categoryId int)
service/category_service.go:11
↓ 1 callers
Method
FindAll
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:13
↓ 1 callers
Method
FindAll
(ctx context.Context)
service/category_service.go:13
↓ 1 callers
Method
FindById
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:12
↓ 1 callers
Function
NewDB
()
app/database.go:9
↓ 1 callers
Function
ToCategoryResponses
(categories []domain.Category)
helper/model.go:15
↓ 1 callers
Method
Update
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller.go:10
↓ 1 callers
Method
Update
(ctx context.Context, request web.CategoryUpdateRequest)
service/category_service.go:10
↓ 1 callers
Function
internalServerError
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:61
↓ 1 callers
Function
notFoundError
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:42
↓ 1 callers
Function
validationErrors
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:23
Method
Create
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:22
Method
Create
(ctx context.Context, request web.CategoryCreateRequest)
service/category_service_impl.go:28
Method
Create
(ctx context.Context, request web.CategoryCreateRequest)
service/category_service.go:9
Method
Delete
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:56
Method
Delete
(ctx context.Context, categoryId int)
service/category_service_impl.go:65
Method
Delete
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository_impl.go:38
Method
Delete
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository.go:12
Function
ErrorHandler
(writer http.ResponseWriter, request *http.Request, err interface{})
exception/error_handler.go:10
Method
FindAll
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:85
Method
FindAll
(ctx context.Context)
service/category_service_impl.go:91
Method
FindAll
(ctx context.Context, tx *sql.Tx)
repository/category_repository_impl.go:60
Method
FindAll
(ctx context.Context, tx *sql.Tx)
repository/category_repository.go:14
Method
FindById
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:70
Method
FindById
(ctx context.Context, categoryId int)
service/category_service_impl.go:78
Method
FindById
(ctx context.Context, tx *sql.Tx, categoryId int)
repository/category_repository_impl.go:44
Method
FindById
(ctx context.Context, tx *sql.Tx, categoryId int)
repository/category_repository.go:13
Method
Save
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository_impl.go:18
Function
TestCreateCategoryFailed
(t *testing.T)
test/category_controller_test.go:79
Function
TestCreateCategorySuccess
(t *testing.T)
test/category_controller_test.go:53
Function
TestDeleteCategoryFailed
(t *testing.T)
test/category_controller_test.go:260
Function
TestDeleteCategorySuccess
(t *testing.T)
test/category_controller_test.go:228
Function
TestGetCategoryFailed
(t *testing.T)
test/category_controller_test.go:205
Function
TestGetCategorySuccess
(t *testing.T)
test/category_controller_test.go:172
Function
TestListCategoriesSuccess
(t *testing.T)
test/category_controller_test.go:284
Function
TestUnauthorized
(t *testing.T)
test/category_controller_test.go:331
Function
TestUpdateCategoryFailed
(t *testing.T)
test/category_controller_test.go:139
Function
TestUpdateCategorySuccess
(t *testing.T)
test/category_controller_test.go:104
Method
Update
(writer http.ResponseWriter, request *http.Request, params httprouter.Params)
controller/category_controller_impl.go:36
Method
Update
(ctx context.Context, request web.CategoryUpdateRequest)
service/category_service_impl.go:45
Method
Update
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository_impl.go:30
Method
Update
(ctx context.Context, tx *sql.Tx, category domain.Category)
repository/category_repository.go:11
Function
main
()
main.go:15