MCPcopy Create free account

hub / github.com/0xdpfly/gin-app-start / functions

Functions97 in github.com/0xdpfly/gin-app-start

↓ 17 callersMethodError
()
pkg/errors/errors.go:11
↓ 12 callersFunctionInfo
(msg string, fields ...zap.Field)
pkg/logger/logger.go:54
↓ 11 callersFunctionError
(msg string, fields ...zap.Field)
pkg/logger/logger.go:66
↓ 9 callersFunctionError
(c *gin.Context, code int, message string)
pkg/response/response.go:43
↓ 9 callersFunctionWrapBusinessError
(code int, message string, cause error)
pkg/errors/errors.go:25
↓ 7 callersFunctionGetLogger
()
pkg/logger/logger.go:46
↓ 7 callersFunctionNewBusinessError
(code int, message string)
pkg/errors/errors.go:18
↓ 5 callersFunctionSuccess
(c *gin.Context, data interface{})
pkg/response/response.go:17
↓ 5 callersFunctionhandleServiceError
(c *gin.Context, err error)
internal/controller/user_controller.go:174
↓ 3 callersFunctionFatal
(msg string, fields ...zap.Field)
pkg/logger/logger.go:70
↓ 2 callersMethodCreate
(ctx context.Context, user *model.User)
internal/repository/user_repository.go:11
↓ 2 callersMethodDelete
(ctx context.Context, id uint)
internal/repository/user_repository.go:17
↓ 2 callersMethodGetByID
(ctx context.Context, id uint)
internal/repository/user_repository.go:12
↓ 2 callersMethodGetByUsername
(ctx context.Context, username string)
internal/repository/user_repository.go:13
↓ 2 callersFunctionhashPassword
(password, salt string)
internal/service/user_service.go:176
↓ 1 callersFunctionCORS
()
internal/middleware/cors.go:10
↓ 1 callersFunctionClose
()
pkg/database/postgres.go:75
↓ 1 callersFunctionCloseRedis
()
pkg/database/redis.go:46
↓ 1 callersMethodCount
(ctx context.Context)
internal/repository/base_repository.go:44
↓ 1 callersMethodCreateUser
(ctx context.Context, req *dto.CreateUserRequest)
internal/service/user_service.go:19
↓ 1 callersMethodDeleteUser
(ctx context.Context, id uint)
internal/service/user_service.go:23
↓ 1 callersMethodGetByEmail
(ctx context.Context, email string)
internal/repository/user_repository.go:14
↓ 1 callersMethodGetUser
(ctx context.Context, id uint)
internal/service/user_service.go:20
↓ 1 callersFunctionHashPassword
(password, salt string)
pkg/utils/crypto.go:20
↓ 1 callersFunctionInit
(env string, logFile string)
pkg/logger/logger.go:13
↓ 1 callersMethodList
(ctx context.Context, offset, limit int)
internal/repository/user_repository.go:18
↓ 1 callersMethodListUsers
(ctx context.Context, page, pageSize int)
internal/service/user_service.go:24
↓ 1 callersFunctionLoad
()
internal/config/config.go:67
↓ 1 callersFunctionLogger
()
internal/middleware/logger.go:11
↓ 1 callersFunctionNewHealthController
()
internal/controller/health_controller.go:11
↓ 1 callersFunctionNewPostgresDB
(config *PostgresConfig)
pkg/database/postgres.go:27
↓ 1 callersFunctionNewRedisClient
(config *RedisConfig)
pkg/database/redis.go:22
↓ 1 callersFunctionNewUserController
(userService service.UserService)
internal/controller/user_controller.go:19
↓ 1 callersFunctionNewUserRepository
(db *gorm.DB)
internal/repository/user_repository.go:25
↓ 1 callersFunctionNewUserService
(userRepo repository.UserRepository)
internal/service/user_service.go:31
↓ 1 callersFunctionRateLimit
(rate int)
internal/middleware/rate_limit.go:81
↓ 1 callersFunctionRecovery
()
internal/middleware/recovery.go:11
↓ 1 callersFunctionSetupRouter
( healthCtrl *controller.HealthController, userCtrl *controller.UserController, cfg *config.Config, )
internal/router/router.go:13
↓ 1 callersFunctionSuccessWithMessage
(c *gin.Context, message string, data interface{})
pkg/response/response.go:60
↓ 1 callersFunctionSuccessWithPage
(c *gin.Context, list interface{}, total int64, page, pageSize int)
pkg/response/response.go:33
↓ 1 callersFunctionSync
()
pkg/logger/logger.go:74
↓ 1 callersMethodUpdate
(ctx context.Context, user *model.User)
internal/repository/user_repository.go:16
↓ 1 callersMethodUpdateUser
(ctx context.Context, id uint, req *dto.UpdateUserRequest)
internal/service/user_service.go:22
↓ 1 callersFunctionWarn
(msg string, fields ...zap.Field)
pkg/logger/logger.go:62
↓ 1 callersMethodallow
(key string)
internal/middleware/rate_limit.go:30
↓ 1 callersMethodcleanup
()
internal/middleware/rate_limit.go:62
↓ 1 callersFunctiongenerateSalt
()
internal/service/user_service.go:170
↓ 1 callersFunctionnewRateLimiter
(rate int)
internal/middleware/rate_limit.go:18
MethodBeforeCreate
(tx *gorm.DB)
internal/model/user.go:28
MethodBeforeUpdate
(tx *gorm.DB)
internal/model/user.go:37
FunctionClose
()
pkg/logger/logger.go:89
FunctionContains
(slice []string, item string)
pkg/utils/utils.go:25
MethodCreate
(ctx context.Context, entity *T)
internal/repository/base_repository.go:17
MethodCreateUser
CreateUser godoc @Summary Create a new user @Description Create a new user with username, email, phone and password @Tags users @Accept json
internal/controller/user_controller.go:37
MethodCreateUser
(ctx context.Context, req *dto.CreateUserRequest)
internal/service/user_service.go:37
FunctionDebug
(msg string, fields ...zap.Field)
pkg/logger/logger.go:58
MethodDelete
(ctx context.Context, id uint)
internal/repository/base_repository.go:34
MethodDeleteUser
DeleteUser godoc @Summary Delete user @Description Delete user by user ID @Tags users @Accept json @Produce json @Param id path int tr
internal/controller/user_controller.go:133
MethodDeleteUser
(ctx context.Context, id uint)
internal/service/user_service.go:139
FunctionErrorWithTrace
(c *gin.Context, code int, message string, traceID string)
pkg/response/response.go:51
FunctionGenerateSalt
(length int)
pkg/utils/crypto.go:9
FunctionGenerateUUID
()
pkg/utils/utils.go:10
MethodGetByEmail
(ctx context.Context, email string)
internal/repository/user_repository.go:40
MethodGetByID
(ctx context.Context, id uint)
internal/repository/base_repository.go:21
MethodGetByPhone
(ctx context.Context, phone string)
internal/repository/user_repository.go:15
MethodGetByPhone
(ctx context.Context, phone string)
internal/repository/user_repository.go:49
MethodGetByUsername
(ctx context.Context, username string)
internal/repository/user_repository.go:31
FunctionGetConfig
()
internal/config/config.go:95
FunctionGetDB
()
pkg/database/postgres.go:86
MethodGetDB
()
internal/repository/base_repository.go:50
MethodGetLimit
()
internal/model/base.go:31
MethodGetOffset
()
internal/model/base.go:21
FunctionGetRedisClient
()
pkg/database/redis.go:53
MethodGetUser
GetUser godoc @Summary Get user by ID @Description Get user information by user ID @Tags users @Accept json @Produce json @Param id pat
internal/controller/user_controller.go:66
MethodGetUser
(ctx context.Context, id uint)
internal/service/user_service.go:84
MethodGetUserByUsername
(ctx context.Context, username string)
internal/service/user_service.go:21
MethodGetUserByUsername
(ctx context.Context, username string)
internal/service/user_service.go:96
MethodHealthCheck
HealthCheck godoc @Summary Health check @Description Check if the service is running @Tags health @Accept json @Produce json @Success 20
internal/controller/health_controller.go:24
FunctionInitDefault
()
pkg/logger/logger.go:95
MethodList
(ctx context.Context, offset, limit int)
internal/repository/base_repository.go:38
MethodList
(ctx context.Context, offset, limit int)
internal/repository/user_repository.go:58
MethodListUsers
ListUsers godoc @Summary List users @Description Get paginated list of users @Tags users @Accept json @Produce json @Param page query
internal/controller/user_controller.go:161
MethodListUsers
(ctx context.Context, page, pageSize int)
internal/service/user_service.go:149
FunctionNewBaseRepository
(db *gorm.DB)
internal/repository/base_repository.go:13
FunctionPointer
(v T)
pkg/utils/utils.go:34
FunctionRandomString
(length int)
pkg/utils/utils.go:14
MethodTableName
()
internal/model/user.go:24
MethodUpdate
(ctx context.Context, entity *T)
internal/repository/base_repository.go:30
MethodUpdateUser
UpdateUser godoc @Summary Update user information @Description Update user information by user ID @Tags users @Accept json @Produce json
internal/controller/user_controller.go:97
MethodUpdateUser
(ctx context.Context, id uint, req *dto.UpdateUserRequest)
internal/service/user_service.go:108
FunctionVerifyPassword
(password, salt, hashedPassword string)
pkg/utils/crypto.go:25
FunctionVerifyPassword
(password, salt, hashedPassword string)
internal/service/user_service.go:181
FunctionWith
(fields ...zap.Field)
pkg/logger/logger.go:81
FunctionWithContext
(fields ...zap.Field)
pkg/logger/logger.go:85
Functioninit
()
pkg/logger/logger.go:102
Functioninit
()
docs/docs.go:405
Functionmain
()
cmd/server/main.go:46