Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/0xdpfly/gin-app-start
/ functions
Functions
97 in github.com/0xdpfly/gin-app-start
⨍
Functions
97
◇
Types & classes
24
↓ 17 callers
Method
Error
()
pkg/errors/errors.go:11
↓ 12 callers
Function
Info
(msg string, fields ...zap.Field)
pkg/logger/logger.go:54
↓ 11 callers
Function
Error
(msg string, fields ...zap.Field)
pkg/logger/logger.go:66
↓ 9 callers
Function
Error
(c *gin.Context, code int, message string)
pkg/response/response.go:43
↓ 9 callers
Function
WrapBusinessError
(code int, message string, cause error)
pkg/errors/errors.go:25
↓ 7 callers
Function
GetLogger
()
pkg/logger/logger.go:46
↓ 7 callers
Function
NewBusinessError
(code int, message string)
pkg/errors/errors.go:18
↓ 5 callers
Function
Success
(c *gin.Context, data interface{})
pkg/response/response.go:17
↓ 5 callers
Function
handleServiceError
(c *gin.Context, err error)
internal/controller/user_controller.go:174
↓ 3 callers
Function
Fatal
(msg string, fields ...zap.Field)
pkg/logger/logger.go:70
↓ 2 callers
Method
Create
(ctx context.Context, user *model.User)
internal/repository/user_repository.go:11
↓ 2 callers
Method
Delete
(ctx context.Context, id uint)
internal/repository/user_repository.go:17
↓ 2 callers
Method
GetByID
(ctx context.Context, id uint)
internal/repository/user_repository.go:12
↓ 2 callers
Method
GetByUsername
(ctx context.Context, username string)
internal/repository/user_repository.go:13
↓ 2 callers
Function
hashPassword
(password, salt string)
internal/service/user_service.go:176
↓ 1 callers
Function
CORS
()
internal/middleware/cors.go:10
↓ 1 callers
Function
Close
()
pkg/database/postgres.go:75
↓ 1 callers
Function
CloseRedis
()
pkg/database/redis.go:46
↓ 1 callers
Method
Count
(ctx context.Context)
internal/repository/base_repository.go:44
↓ 1 callers
Method
CreateUser
(ctx context.Context, req *dto.CreateUserRequest)
internal/service/user_service.go:19
↓ 1 callers
Method
DeleteUser
(ctx context.Context, id uint)
internal/service/user_service.go:23
↓ 1 callers
Method
GetByEmail
(ctx context.Context, email string)
internal/repository/user_repository.go:14
↓ 1 callers
Method
GetUser
(ctx context.Context, id uint)
internal/service/user_service.go:20
↓ 1 callers
Function
HashPassword
(password, salt string)
pkg/utils/crypto.go:20
↓ 1 callers
Function
Init
(env string, logFile string)
pkg/logger/logger.go:13
↓ 1 callers
Method
List
(ctx context.Context, offset, limit int)
internal/repository/user_repository.go:18
↓ 1 callers
Method
ListUsers
(ctx context.Context, page, pageSize int)
internal/service/user_service.go:24
↓ 1 callers
Function
Load
()
internal/config/config.go:67
↓ 1 callers
Function
Logger
()
internal/middleware/logger.go:11
↓ 1 callers
Function
NewHealthController
()
internal/controller/health_controller.go:11
↓ 1 callers
Function
NewPostgresDB
(config *PostgresConfig)
pkg/database/postgres.go:27
↓ 1 callers
Function
NewRedisClient
(config *RedisConfig)
pkg/database/redis.go:22
↓ 1 callers
Function
NewUserController
(userService service.UserService)
internal/controller/user_controller.go:19
↓ 1 callers
Function
NewUserRepository
(db *gorm.DB)
internal/repository/user_repository.go:25
↓ 1 callers
Function
NewUserService
(userRepo repository.UserRepository)
internal/service/user_service.go:31
↓ 1 callers
Function
RateLimit
(rate int)
internal/middleware/rate_limit.go:81
↓ 1 callers
Function
Recovery
()
internal/middleware/recovery.go:11
↓ 1 callers
Function
SetupRouter
( healthCtrl *controller.HealthController, userCtrl *controller.UserController, cfg *config.Config, )
internal/router/router.go:13
↓ 1 callers
Function
SuccessWithMessage
(c *gin.Context, message string, data interface{})
pkg/response/response.go:60
↓ 1 callers
Function
SuccessWithPage
(c *gin.Context, list interface{}, total int64, page, pageSize int)
pkg/response/response.go:33
↓ 1 callers
Function
Sync
()
pkg/logger/logger.go:74
↓ 1 callers
Method
Update
(ctx context.Context, user *model.User)
internal/repository/user_repository.go:16
↓ 1 callers
Method
UpdateUser
(ctx context.Context, id uint, req *dto.UpdateUserRequest)
internal/service/user_service.go:22
↓ 1 callers
Function
Warn
(msg string, fields ...zap.Field)
pkg/logger/logger.go:62
↓ 1 callers
Method
allow
(key string)
internal/middleware/rate_limit.go:30
↓ 1 callers
Method
cleanup
()
internal/middleware/rate_limit.go:62
↓ 1 callers
Function
generateSalt
()
internal/service/user_service.go:170
↓ 1 callers
Function
newRateLimiter
(rate int)
internal/middleware/rate_limit.go:18
Method
BeforeCreate
(tx *gorm.DB)
internal/model/user.go:28
Method
BeforeUpdate
(tx *gorm.DB)
internal/model/user.go:37
Function
Close
()
pkg/logger/logger.go:89
Function
Contains
(slice []string, item string)
pkg/utils/utils.go:25
Method
Create
(ctx context.Context, entity *T)
internal/repository/base_repository.go:17
Method
CreateUser
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
Method
CreateUser
(ctx context.Context, req *dto.CreateUserRequest)
internal/service/user_service.go:37
Function
Debug
(msg string, fields ...zap.Field)
pkg/logger/logger.go:58
Method
Delete
(ctx context.Context, id uint)
internal/repository/base_repository.go:34
Method
DeleteUser
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
Method
DeleteUser
(ctx context.Context, id uint)
internal/service/user_service.go:139
Function
ErrorWithTrace
(c *gin.Context, code int, message string, traceID string)
pkg/response/response.go:51
Function
GenerateSalt
(length int)
pkg/utils/crypto.go:9
Function
GenerateUUID
()
pkg/utils/utils.go:10
Method
GetByEmail
(ctx context.Context, email string)
internal/repository/user_repository.go:40
Method
GetByID
(ctx context.Context, id uint)
internal/repository/base_repository.go:21
Method
GetByPhone
(ctx context.Context, phone string)
internal/repository/user_repository.go:15
Method
GetByPhone
(ctx context.Context, phone string)
internal/repository/user_repository.go:49
Method
GetByUsername
(ctx context.Context, username string)
internal/repository/user_repository.go:31
Function
GetConfig
()
internal/config/config.go:95
Function
GetDB
()
pkg/database/postgres.go:86
Method
GetDB
()
internal/repository/base_repository.go:50
Method
GetLimit
()
internal/model/base.go:31
Method
GetOffset
()
internal/model/base.go:21
Function
GetRedisClient
()
pkg/database/redis.go:53
Method
GetUser
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
Method
GetUser
(ctx context.Context, id uint)
internal/service/user_service.go:84
Method
GetUserByUsername
(ctx context.Context, username string)
internal/service/user_service.go:21
Method
GetUserByUsername
(ctx context.Context, username string)
internal/service/user_service.go:96
Method
HealthCheck
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
Function
InitDefault
()
pkg/logger/logger.go:95
Method
List
(ctx context.Context, offset, limit int)
internal/repository/base_repository.go:38
Method
List
(ctx context.Context, offset, limit int)
internal/repository/user_repository.go:58
Method
ListUsers
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
Method
ListUsers
(ctx context.Context, page, pageSize int)
internal/service/user_service.go:149
Function
NewBaseRepository
(db *gorm.DB)
internal/repository/base_repository.go:13
Function
Pointer
(v T)
pkg/utils/utils.go:34
Function
RandomString
(length int)
pkg/utils/utils.go:14
Method
TableName
()
internal/model/user.go:24
Method
Update
(ctx context.Context, entity *T)
internal/repository/base_repository.go:30
Method
UpdateUser
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
Method
UpdateUser
(ctx context.Context, id uint, req *dto.UpdateUserRequest)
internal/service/user_service.go:108
Function
VerifyPassword
(password, salt, hashedPassword string)
pkg/utils/crypto.go:25
Function
VerifyPassword
(password, salt, hashedPassword string)
internal/service/user_service.go:181
Function
With
(fields ...zap.Field)
pkg/logger/logger.go:81
Function
WithContext
(fields ...zap.Field)
pkg/logger/logger.go:85
Function
init
()
pkg/logger/logger.go:102
Function
init
()
docs/docs.go:405
Function
main
()
cmd/server/main.go:46