Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aa12gq/goxenith
/ functions
Functions
337 in github.com/aa12gq/goxenith
⨍
Functions
337
◇
Types & classes
56
↓ 1 callers
Method
Fields
Fields of the Article.
app/models/schema/article.go:31
↓ 1 callers
Function
FirstElement
FirstElement 安全地获取 args[0],避免 panic: runtime error: index out of range
pkg/helpers/helpers.go:58
↓ 1 callers
Function
Flush
()
pkg/cache/cache.go:129
↓ 1 callers
Method
Flush
()
pkg/cache/store_interface.go:11
↓ 1 callers
Method
FlushDB
FlushDB 清空当前 redis db 里的所有数据
pkg/redis/redis.go:102
↓ 1 callers
Function
ForceUA
ForceUA 中间件,强制请求必须附带 User-Agent 标头
app/http/middlewares/force_ua.go:11
↓ 1 callers
Method
Forget
(key string)
pkg/cache/store_interface.go:9
↓ 1 callers
Method
GenerateCaptcha
GenerateCaptcha 生成图片验证码
pkg/captcha/captcha.go:50
↓ 1 callers
Method
Get
Get 实现 base64Captcha.Store interface 的 Get 方法
pkg/captcha/store_redis.go:33
↓ 1 callers
Method
Get
Get 实现 verifycode.Store interface 的 Get 方法
pkg/verifycode/store_redis.go:29
↓ 1 callers
Function
GetFloat64
GetFloat64 获取 float64 类型的配置信息
pkg/config/config.go:111
↓ 1 callers
Function
GetInt
(key string)
pkg/cache/cache.go:65
↓ 1 callers
Function
GetKeyIP
GetKeyIP 获取 Limitor 的 Key,IP
pkg/limiter/limiter.go:15
↓ 1 callers
Function
GetKeyRouteWithIP
GetKeyRouteWithIP Limitor 的 Key,路由+IP,针对单个路由做限流
pkg/limiter/limiter.go:20
↓ 1 callers
Function
GetObject
GetObject 应该传地址,用法如下: model := user.User{} cache.GetObject("key", &model)
pkg/cache/cache.go:49
↓ 1 callers
Function
GetPageOffset
(pageNum, pageSize uint32)
pkg/paginator/paging.go:3
↓ 1 callers
Function
GetStringSlice
(key string)
pkg/cache/cache.go:105
↓ 1 callers
Function
InitLogger
InitLogger 日志初始化
pkg/logger/logger.go:19
↓ 1 callers
Function
InitWithCacheStore
(store Store)
pkg/cache/cache.go:19
↓ 1 callers
Method
IsAlive
()
pkg/cache/store_interface.go:13
↓ 1 callers
Function
LimitIP
LimitIP 全局限流中间件,针对 IP 进行限流 limit 为格式化字符串,如 "5-S" ,示例: * 5 reqs/second: "5-S" * 10 reqs/minute: "10-M" * 1000 reqs/hour: "1000-H" * 2000 reqs/day: "20
app/http/middlewares/limit.go:21
↓ 1 callers
Function
Logger
()
app/http/middlewares/logger.go:24
↓ 1 callers
Function
MicrosecondsStr
MicrosecondsStr 将 time.Duration 类型(nano seconds 为单位) 输出为小数点后 3 位的 ms (microsecond 毫秒,千分之一秒)
pkg/helpers/helpers.go:39
↓ 1 callers
Function
Migrate
(ctx context.Context, daoIn *dao.DAO, opt *MigrateOptions)
app/models/migrate.go:18
↓ 1 callers
Function
NewDAO
()
dao/dao.go:19
↓ 1 callers
Function
NewMailer
NewMailer 单例模式获取
pkg/mail/mail.go:31
↓ 1 callers
Function
NewOssService
(cfg *OssConfig)
pkg/oss/oss.go:18
↓ 1 callers
Function
NewRedisStore
(address string, username string, password string, db int)
pkg/cache/store_redis.go:15
↓ 1 callers
Function
NewSMS
NewSMS 单例模式获取
pkg/sms/sms.go:28
↓ 1 callers
Function
Plural
Plural 转为复数 user -> users
pkg/str/str.go:9
↓ 1 callers
Function
Put
Put 将数据存入文件
pkg/file/file.go:13
↓ 1 callers
Function
RandomNumber
RandomNumber 生成长度为 length 随机数字字符串
pkg/helpers/helpers.go:44
↓ 1 callers
Function
Recovery
Recovery 使用 zap.Error() 来记录 Panic 和 call stack
app/http/middlewares/recovery.go:16
↓ 1 callers
Function
RegisterAPIRoutes
(r *gin.Engine)
routes/api.go:10
↓ 1 callers
Function
RegisterDefaultCmd
(rootCmd *cobra.Command, subCmd *cobra.Command)
app/cmd/cmd.go:16
↓ 1 callers
Function
RegisterGlobalFlags
(rootCmd *cobra.Command)
app/cmd/cmd.go:12
↓ 1 callers
Function
RemoveMarkdown
RemoveMarkdown 使用正则表达式去除 Markdown 语法
pkg/helpers/helpers.go:66
↓ 1 callers
Function
SaveUploadImage
(c *gin.Context, file *multipart.FileHeader)
pkg/file/file.go:33
↓ 1 callers
Method
SendEmail
SendEmail 发送邮件验证码,调用示例: verifycode.NewVerifyCode().SendEmail(request.Email)
pkg/verifycode/verifycode.go:94
↓ 1 callers
Method
SendSMS
SendSMS 发送短信验证码,调用示例: verifycode.NewVerifyCode().SendSMS(request.Phone)
pkg/verifycode/verifycode.go:41
↓ 1 callers
Function
SetupCache
()
bootstrap/cache.go:9
↓ 1 callers
Function
SetupDB
()
bootstrap/database.go:13
↓ 1 callers
Function
SetupOss
()
bootstrap/oss.go:9
↓ 1 callers
Function
SetupRedis
()
bootstrap/redis.go:9
↓ 1 callers
Function
SetupRoute
SetupRoute 路由初始化
bootstrap/route.go:12
↓ 1 callers
Function
Singular
Singular 转为单数 users -> user
pkg/str/str.go:14
↓ 1 callers
Function
SyncArticleViewsFromRedis
SyncArticleViewsFromRedis 定时从Redis更新数据库
app/http/controllers/api/v1/article_controller.go:358
↓ 1 callers
Function
ValidateCaptcha
ValidateCaptcha 自定义规则,验证『图片验证码』
app/requests/validators/custom_validators.go:25
↓ 1 callers
Method
ValidateMaterialCategory
(ctx *gin.Context, mc *pb.Category)
app/http/controllers/api/v1/category_controller.go:46
↓ 1 callers
Function
Warning
Warning 打印一条提示消息,黄色输出
pkg/console/console.go:21
↓ 1 callers
Method
convertToPbCategoryChildren
(parent *CategoryTreeNode, nodes []*CategoryTreeNode)
app/http/controllers/api/v1/category_controller.go:189
↓ 1 callers
Function
copyByJson
(dst interface{}, src interface{})
pkg/xcopy/xcopy.go:18
↓ 1 callers
Method
createUserByEmail
(c *gin.Context, request *pb.SignupUsingEmailRequest)
app/http/controllers/api/v1/auth/signup_controller.go:155
↓ 1 callers
Method
createUserByPhone
(c *gin.Context, request *pb.SignupUserUsingPhoneRequest)
app/http/controllers/api/v1/auth/signup_controller.go:144
↓ 1 callers
Method
emailExists
(c *gin.Context, phone string)
app/http/controllers/api/v1/auth/signup_controller.go:166
↓ 1 callers
Function
fetchNestedComments
(ctx *gin.Context, cmt *ent.Comment)
app/http/controllers/api/v1/comment_controller.go:62
↓ 1 callers
Function
fileNameWithoutExtension
fileNameWithoutExtension 从给定的文件名中获取不带扩展名的文件名
pkg/file/file.go:57
↓ 1 callers
Method
findCategoryChildren
(cats []*ent.Category)
app/http/controllers/api/v1/category_controller.go:166
↓ 1 callers
Function
getAllArticleViewsFromRedis
()
app/http/controllers/api/v1/article_controller.go:383
↓ 1 callers
Method
getChildren
(parentId uint64, catMap map[uint64][]*ent.Category)
app/http/controllers/api/v1/category_controller.go:175
↓ 1 callers
Function
getEncoder
getEncoder 设置日志存储格式
pkg/logger/logger.go:46
↓ 1 callers
Function
getLogWriter
getLogWriter 日志记录介质。Goxenith 中使用了两种介质,os.Stdout 和文件
pkg/logger/logger.go:82
↓ 1 callers
Function
loadConfig
()
pkg/config/config.go:42
↓ 1 callers
Function
loadEnv
(envSuffix string)
pkg/config/config.go:48
↓ 1 callers
Method
phoneExists
(c *gin.Context, phone string)
app/http/controllers/api/v1/auth/signup_controller.go:118
↓ 1 callers
Function
registerGlobalMiddleWare
(router *gin.Engine)
bootstrap/route.go:22
↓ 1 callers
Function
resetRedisCounters
(articleIDs []int)
app/http/controllers/api/v1/article_controller.go:428
↓ 1 callers
Function
routeToKeyString
routeToKeyString 辅助方法,将 URL 中的 / 格式为 -
pkg/limiter/limiter.go:63
↓ 1 callers
Function
setup404Handler
(router *gin.Engine)
bootstrap/route.go:30
↓ 1 callers
Function
updateArticleViewsToDB
(articleIDs []int, views []int)
app/http/controllers/api/v1/article_controller.go:403
↓ 1 callers
Function
validateFile
(c *gin.Context, data interface{}, rules govalidator.MapData, messages govalidator.MapData)
app/requests/requests.go:49
Method
AddComment
(ctx *gin.Context)
app/http/controllers/api/v1/comment_controller.go:26
Function
ArticleSave
(data interface{}, c *gin.Context)
app/requests/article_request.go:8
Function
BcryptIsHashed
BcryptIsHashed 判断字符串是否是哈希过的数据
pkg/password/password.go:31
Function
Camel
Camel 转为 CamelCase,如 topic_comment -> TopicComment
pkg/str/str.go:24
Method
CheckLikeStatus
(ctx *gin.Context)
app/http/controllers/api/v1/article_controller.go:321
Function
Copy
Copy 复制简单的数据类型和结构体, 注意含有枚举字段的结构体不要使用,需手动处理
pkg/xcopy/xcopy.go:10
Method
CreateArticle
(ctx *gin.Context)
app/http/controllers/api/v1/article_controller.go:34
Function
CreateCategory
CreateCategory 创建分类表单
app/requests/category_request.go:9
Method
CreateCategory
(ctx *gin.Context)
app/http/controllers/api/v1/category_controller.go:76
Function
Created
Created 响应 201 和带 data 键的 JSON 数据 执行『更新操作』成功后调用,例如更新话题,成功后返回已更新的话题
pkg/response/response.go:35
Method
CurrentUser
CurrentUser 当前登录用户信息
app/http/controllers/api/v1/users_controller.go:27
Function
Decrement
(parameters ...interface{})
pkg/cache/cache.go:137
Method
Decrement
(parameters ...interface{})
pkg/cache/store_redis.go:50
Method
Decrement
Decrement 当参数只有 1 个时,为 key,其值减去 1。 当参数有 2 个时,第一个参数为 key ,第二个参数为要减去的值 int64 类型。
pkg/redis/redis.go:136
Method
DeleteArticle
(ctx *gin.Context)
app/http/controllers/api/v1/article_controller.go:211
Method
DeleteComment
(ctx *gin.Context)
app/http/controllers/api/v1/comment_controller.go:179
Function
Dump
Dump 调试专用,不会中断程序,会在终端打印出 warning 消息。 第一个参数会使用 json.Marshal 进行渲染,第二个参数消息(可选) logger.Dump(user.User{Name:"test"}) logger.Dump(user.User{Name:"test"},
pkg/logger/logger.go:113
Method
Edges
Edges of the LikeRecord.
app/models/schema/like_record.go:51
Method
Edges
Edges of the Comment.
app/models/schema/comment.go:43
Method
Edges
Edges of the Category.
app/models/schema/category.go:42
Method
Edges
Edges of the Article.
app/models/schema/article.go:45
Method
Edges
Edges of the Link.
app/models/schema/link.go:30
Method
Edges
Edges of the User.
app/models/schema/user.go:41
Function
EncryptPassword
(password string)
pkg/password/password.go:9
Function
ErrorJSON
(moduleName, name string, value interface{})
pkg/logger/logger.go:210
Function
ExitIf
ExitIf 语法糖,自带 err != nil 判断
pkg/console/console.go:32
Function
Fatal
Fatal 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序
pkg/logger/logger.go:168
Function
FatalJSON
(moduleName, name string, value interface{})
pkg/logger/logger.go:214
Function
FatalString
(moduleName, name, msg string)
pkg/logger/logger.go:191
← previous
next →
101–200 of 337, ranked by callers