MCPcopy Create free account

hub / github.com/aa12gq/goxenith / functions

Functions337 in github.com/aa12gq/goxenith

↓ 1 callersMethodFields
Fields of the Article.
app/models/schema/article.go:31
↓ 1 callersFunctionFirstElement
FirstElement 安全地获取 args[0],避免 panic: runtime error: index out of range
pkg/helpers/helpers.go:58
↓ 1 callersFunctionFlush
()
pkg/cache/cache.go:129
↓ 1 callersMethodFlush
()
pkg/cache/store_interface.go:11
↓ 1 callersMethodFlushDB
FlushDB 清空当前 redis db 里的所有数据
pkg/redis/redis.go:102
↓ 1 callersFunctionForceUA
ForceUA 中间件,强制请求必须附带 User-Agent 标头
app/http/middlewares/force_ua.go:11
↓ 1 callersMethodForget
(key string)
pkg/cache/store_interface.go:9
↓ 1 callersMethodGenerateCaptcha
GenerateCaptcha 生成图片验证码
pkg/captcha/captcha.go:50
↓ 1 callersMethodGet
Get 实现 base64Captcha.Store interface 的 Get 方法
pkg/captcha/store_redis.go:33
↓ 1 callersMethodGet
Get 实现 verifycode.Store interface 的 Get 方法
pkg/verifycode/store_redis.go:29
↓ 1 callersFunctionGetFloat64
GetFloat64 获取 float64 类型的配置信息
pkg/config/config.go:111
↓ 1 callersFunctionGetInt
(key string)
pkg/cache/cache.go:65
↓ 1 callersFunctionGetKeyIP
GetKeyIP 获取 Limitor 的 Key,IP
pkg/limiter/limiter.go:15
↓ 1 callersFunctionGetKeyRouteWithIP
GetKeyRouteWithIP Limitor 的 Key,路由+IP,针对单个路由做限流
pkg/limiter/limiter.go:20
↓ 1 callersFunctionGetObject
GetObject 应该传地址,用法如下: model := user.User{} cache.GetObject("key", &model)
pkg/cache/cache.go:49
↓ 1 callersFunctionGetPageOffset
(pageNum, pageSize uint32)
pkg/paginator/paging.go:3
↓ 1 callersFunctionGetStringSlice
(key string)
pkg/cache/cache.go:105
↓ 1 callersFunctionInitLogger
InitLogger 日志初始化
pkg/logger/logger.go:19
↓ 1 callersFunctionInitWithCacheStore
(store Store)
pkg/cache/cache.go:19
↓ 1 callersMethodIsAlive
()
pkg/cache/store_interface.go:13
↓ 1 callersFunctionLimitIP
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 callersFunctionLogger
()
app/http/middlewares/logger.go:24
↓ 1 callersFunctionMicrosecondsStr
MicrosecondsStr 将 time.Duration 类型(nano seconds 为单位) 输出为小数点后 3 位的 ms (microsecond 毫秒,千分之一秒)
pkg/helpers/helpers.go:39
↓ 1 callersFunctionMigrate
(ctx context.Context, daoIn *dao.DAO, opt *MigrateOptions)
app/models/migrate.go:18
↓ 1 callersFunctionNewDAO
()
dao/dao.go:19
↓ 1 callersFunctionNewMailer
NewMailer 单例模式获取
pkg/mail/mail.go:31
↓ 1 callersFunctionNewOssService
(cfg *OssConfig)
pkg/oss/oss.go:18
↓ 1 callersFunctionNewRedisStore
(address string, username string, password string, db int)
pkg/cache/store_redis.go:15
↓ 1 callersFunctionNewSMS
NewSMS 单例模式获取
pkg/sms/sms.go:28
↓ 1 callersFunctionPlural
Plural 转为复数 user -> users
pkg/str/str.go:9
↓ 1 callersFunctionPut
Put 将数据存入文件
pkg/file/file.go:13
↓ 1 callersFunctionRandomNumber
RandomNumber 生成长度为 length 随机数字字符串
pkg/helpers/helpers.go:44
↓ 1 callersFunctionRecovery
Recovery 使用 zap.Error() 来记录 Panic 和 call stack
app/http/middlewares/recovery.go:16
↓ 1 callersFunctionRegisterAPIRoutes
(r *gin.Engine)
routes/api.go:10
↓ 1 callersFunctionRegisterDefaultCmd
(rootCmd *cobra.Command, subCmd *cobra.Command)
app/cmd/cmd.go:16
↓ 1 callersFunctionRegisterGlobalFlags
(rootCmd *cobra.Command)
app/cmd/cmd.go:12
↓ 1 callersFunctionRemoveMarkdown
RemoveMarkdown 使用正则表达式去除 Markdown 语法
pkg/helpers/helpers.go:66
↓ 1 callersFunctionSaveUploadImage
(c *gin.Context, file *multipart.FileHeader)
pkg/file/file.go:33
↓ 1 callersMethodSendEmail
SendEmail 发送邮件验证码,调用示例: verifycode.NewVerifyCode().SendEmail(request.Email)
pkg/verifycode/verifycode.go:94
↓ 1 callersMethodSendSMS
SendSMS 发送短信验证码,调用示例: verifycode.NewVerifyCode().SendSMS(request.Phone)
pkg/verifycode/verifycode.go:41
↓ 1 callersFunctionSetupCache
()
bootstrap/cache.go:9
↓ 1 callersFunctionSetupDB
()
bootstrap/database.go:13
↓ 1 callersFunctionSetupOss
()
bootstrap/oss.go:9
↓ 1 callersFunctionSetupRedis
()
bootstrap/redis.go:9
↓ 1 callersFunctionSetupRoute
SetupRoute 路由初始化
bootstrap/route.go:12
↓ 1 callersFunctionSingular
Singular 转为单数 users -> user
pkg/str/str.go:14
↓ 1 callersFunctionSyncArticleViewsFromRedis
SyncArticleViewsFromRedis 定时从Redis更新数据库
app/http/controllers/api/v1/article_controller.go:358
↓ 1 callersFunctionValidateCaptcha
ValidateCaptcha 自定义规则,验证『图片验证码』
app/requests/validators/custom_validators.go:25
↓ 1 callersMethodValidateMaterialCategory
(ctx *gin.Context, mc *pb.Category)
app/http/controllers/api/v1/category_controller.go:46
↓ 1 callersFunctionWarning
Warning 打印一条提示消息,黄色输出
pkg/console/console.go:21
↓ 1 callersMethodconvertToPbCategoryChildren
(parent *CategoryTreeNode, nodes []*CategoryTreeNode)
app/http/controllers/api/v1/category_controller.go:189
↓ 1 callersFunctioncopyByJson
(dst interface{}, src interface{})
pkg/xcopy/xcopy.go:18
↓ 1 callersMethodcreateUserByEmail
(c *gin.Context, request *pb.SignupUsingEmailRequest)
app/http/controllers/api/v1/auth/signup_controller.go:155
↓ 1 callersMethodcreateUserByPhone
(c *gin.Context, request *pb.SignupUserUsingPhoneRequest)
app/http/controllers/api/v1/auth/signup_controller.go:144
↓ 1 callersMethodemailExists
(c *gin.Context, phone string)
app/http/controllers/api/v1/auth/signup_controller.go:166
↓ 1 callersFunctionfetchNestedComments
(ctx *gin.Context, cmt *ent.Comment)
app/http/controllers/api/v1/comment_controller.go:62
↓ 1 callersFunctionfileNameWithoutExtension
fileNameWithoutExtension 从给定的文件名中获取不带扩展名的文件名
pkg/file/file.go:57
↓ 1 callersMethodfindCategoryChildren
(cats []*ent.Category)
app/http/controllers/api/v1/category_controller.go:166
↓ 1 callersFunctiongetAllArticleViewsFromRedis
()
app/http/controllers/api/v1/article_controller.go:383
↓ 1 callersMethodgetChildren
(parentId uint64, catMap map[uint64][]*ent.Category)
app/http/controllers/api/v1/category_controller.go:175
↓ 1 callersFunctiongetEncoder
getEncoder 设置日志存储格式
pkg/logger/logger.go:46
↓ 1 callersFunctiongetLogWriter
getLogWriter 日志记录介质。Goxenith 中使用了两种介质,os.Stdout 和文件
pkg/logger/logger.go:82
↓ 1 callersFunctionloadConfig
()
pkg/config/config.go:42
↓ 1 callersFunctionloadEnv
(envSuffix string)
pkg/config/config.go:48
↓ 1 callersMethodphoneExists
(c *gin.Context, phone string)
app/http/controllers/api/v1/auth/signup_controller.go:118
↓ 1 callersFunctionregisterGlobalMiddleWare
(router *gin.Engine)
bootstrap/route.go:22
↓ 1 callersFunctionresetRedisCounters
(articleIDs []int)
app/http/controllers/api/v1/article_controller.go:428
↓ 1 callersFunctionrouteToKeyString
routeToKeyString 辅助方法,将 URL 中的 / 格式为 -
pkg/limiter/limiter.go:63
↓ 1 callersFunctionsetup404Handler
(router *gin.Engine)
bootstrap/route.go:30
↓ 1 callersFunctionupdateArticleViewsToDB
(articleIDs []int, views []int)
app/http/controllers/api/v1/article_controller.go:403
↓ 1 callersFunctionvalidateFile
(c *gin.Context, data interface{}, rules govalidator.MapData, messages govalidator.MapData)
app/requests/requests.go:49
MethodAddComment
(ctx *gin.Context)
app/http/controllers/api/v1/comment_controller.go:26
FunctionArticleSave
(data interface{}, c *gin.Context)
app/requests/article_request.go:8
FunctionBcryptIsHashed
BcryptIsHashed 判断字符串是否是哈希过的数据
pkg/password/password.go:31
FunctionCamel
Camel 转为 CamelCase,如 topic_comment -> TopicComment
pkg/str/str.go:24
MethodCheckLikeStatus
(ctx *gin.Context)
app/http/controllers/api/v1/article_controller.go:321
FunctionCopy
Copy 复制简单的数据类型和结构体, 注意含有枚举字段的结构体不要使用,需手动处理
pkg/xcopy/xcopy.go:10
MethodCreateArticle
(ctx *gin.Context)
app/http/controllers/api/v1/article_controller.go:34
FunctionCreateCategory
CreateCategory 创建分类表单
app/requests/category_request.go:9
MethodCreateCategory
(ctx *gin.Context)
app/http/controllers/api/v1/category_controller.go:76
FunctionCreated
Created 响应 201 和带 data 键的 JSON 数据 执行『更新操作』成功后调用,例如更新话题,成功后返回已更新的话题
pkg/response/response.go:35
MethodCurrentUser
CurrentUser 当前登录用户信息
app/http/controllers/api/v1/users_controller.go:27
FunctionDecrement
(parameters ...interface{})
pkg/cache/cache.go:137
MethodDecrement
(parameters ...interface{})
pkg/cache/store_redis.go:50
MethodDecrement
Decrement 当参数只有 1 个时,为 key,其值减去 1。 当参数有 2 个时,第一个参数为 key ,第二个参数为要减去的值 int64 类型。
pkg/redis/redis.go:136
MethodDeleteArticle
(ctx *gin.Context)
app/http/controllers/api/v1/article_controller.go:211
MethodDeleteComment
(ctx *gin.Context)
app/http/controllers/api/v1/comment_controller.go:179
FunctionDump
Dump 调试专用,不会中断程序,会在终端打印出 warning 消息。 第一个参数会使用 json.Marshal 进行渲染,第二个参数消息(可选) logger.Dump(user.User{Name:"test"}) logger.Dump(user.User{Name:"test"},
pkg/logger/logger.go:113
MethodEdges
Edges of the LikeRecord.
app/models/schema/like_record.go:51
MethodEdges
Edges of the Comment.
app/models/schema/comment.go:43
MethodEdges
Edges of the Category.
app/models/schema/category.go:42
MethodEdges
Edges of the Article.
app/models/schema/article.go:45
MethodEdges
Edges of the Link.
app/models/schema/link.go:30
MethodEdges
Edges of the User.
app/models/schema/user.go:41
FunctionEncryptPassword
(password string)
pkg/password/password.go:9
FunctionErrorJSON
(moduleName, name string, value interface{})
pkg/logger/logger.go:210
FunctionExitIf
ExitIf 语法糖,自带 err != nil 判断
pkg/console/console.go:32
FunctionFatal
Fatal 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序
pkg/logger/logger.go:168
FunctionFatalJSON
(moduleName, name string, value interface{})
pkg/logger/logger.go:214
FunctionFatalString
(moduleName, name, msg string)
pkg/logger/logger.go:191
← previousnext →101–200 of 337, ranked by callers