MCPcopy Create free account

hub / github.com/GoSimplicity/LinkMe / functions

Functions1,482 in github.com/GoSimplicity/LinkMe

↓ 76 callersFunctionErrorWithMessage
ErrorWithMessage 带消息的操作失败返回
pkg/apiresponse/apiresponse.go:150
↓ 44 callersMethodSet
(ctx context.Context, key string, post domain.Post)
internal/repository/cache/post.go:16
↓ 35 callersFunctionError
Error 操作失败的返回
pkg/apiresponse/apiresponse.go:140
↓ 33 callersFunctionSuccessWithData
SuccessWithData 带数据的操作成功返回
pkg/apiresponse/apiresponse.go:130
↓ 30 callersFunctionSuccess
Success 操作成功的返回
pkg/apiresponse/apiresponse.go:120
↓ 29 callersMethodGet
(ctx context.Context, key string)
internal/repository/cache/post.go:15
↓ 25 callersFunctionrequireUser
(ctx *gin.Context)
internal/api/auth.go:9
↓ 24 callersMethodCreate
(ctx context.Context, check Check)
internal/repository/dao/check.go:14
↓ 22 callersMethodDel
(ctx context.Context, key string)
internal/repository/cache/post.go:17
↓ 18 callersMethodLimit
Limit true为触发,false为不触发
pkg/limiterp/limit.go:16
↓ 18 callersFunctionWrapBody
WrapBody 是一个中间件,用于包裹业务逻辑函数,自动绑定请求体、处理响应并集中管理错误处理。
pkg/ginp/wrapper.go:10
↓ 17 callersMethodCount
(ctx context.Context, number string)
internal/repository/cache/sms.go:18
↓ 15 callersMethodRegisterRoutes
(server *gin.Engine)
internal/api/api.go:26
↓ 14 callersFunctionErrorWithData
ErrorWithData 带数据的失败返回
pkg/apiresponse/apiresponse.go:145
↓ 12 callersMethodConsume
Consume 处理Kafka消息,根据不同的表名执行不同的操作
internal/domain/events/es/consumer.go:151
↓ 11 callersMethodClose
关闭服务
internal/service/lotteryDraw.go:30
↓ 9 callersMethodExec
添加redis命令
internal/repository/cache/redis_cmd.go:21
↓ 9 callersMethodSendMessage
SendMessage 包装后的 SendMessage 方法,用于监控消息发送时间
pkg/samarap/prometheus/prometheus.go:37
↓ 8 callersFunctionApiData
(c *gin.Context, code int, data interface{}, message string)
pkg/apiresponse/apiresponse.go:110
↓ 8 callersMethodCreate
(ctx context.Context, post domain.Post)
internal/service/post.go:19
↓ 8 callersMethodRun
()
internal/job/scheduler.go:52
↓ 8 callersMethodrefreshCache
(options ...interface{})
internal/repository/post.go:298
↓ 7 callersMethodDelete
(ctx context.Context, postId uint, uid int64)
internal/repository/dao/post.go:28
↓ 7 callersMethodUpdateStatus
(ctx context.Context, postId uint, uid int64, status uint8)
internal/repository/dao/post.go:23
↓ 6 callersMethodGetPostById
(ctx context.Context, postId uint, uid int64)
internal/service/post.go:23
↓ 6 callersMethodStop
()
internal/job/scheduler.go:56
↓ 6 callersFunctionUnauthorizedErrorWithDetails
UnauthorizedErrorWithDetails 带详细数据和消息的未认证返回
pkg/apiresponse/apiresponse.go:210
↓ 6 callersMethodafterCallback
afterCallback 是数据库操作后的回调,用于记录操作时间并更新 Prometheus 指标
pkg/gormp/prometheus/prometheus.go:84
↓ 6 callersMethodbeforeCallback
beforeCallback 是数据库操作前的回调,用于记录开始时间
pkg/gormp/prometheus/prometheus.go:76
↓ 5 callersMethodDelete
(ctx context.Context, postId uint, uid int64)
internal/service/post.go:27
↓ 5 callersMethodLen
Len 返回队列的长度
pkg/priorityqueue/priority_queue.go:33
↓ 5 callersFunctionNewSearchDAO
NewSearchDAO 创建并返回一个新的 SearchDAO 实例
internal/repository/dao/search.go:95
↓ 5 callersMethodUpdate
(ctx context.Context, post domain.Post)
internal/service/post.go:20
↓ 5 callersMethodemptyKey
(key string)
internal/repository/cache/post.go:472
↓ 5 callersMethodgetCurrentTime
()
internal/repository/dao/interactive.go:85
↓ 5 callersMethodpubKey
(key string)
internal/repository/cache/post.go:468
↓ 5 callersMethodpubListKey
(key string)
internal/repository/cache/post.go:464
↓ 4 callersMethodFindByID
(ctx context.Context, id int64)
internal/repository/dao/user.go:27
↓ 4 callersFunctionGenRandomCode
GenRandomCode 生成随机数
utils/sms.go:9
↓ 4 callersMethodGetById
(ctx context.Context, postId uint, uid int64)
internal/repository/dao/post.go:24
↓ 4 callersMethodGetLotteryDrawByID
(ctx context.Context, id int)
internal/service/lotteryDraw.go:20
↓ 4 callersMethodGetSecondKillEventByID
(ctx context.Context, id int)
internal/service/lotteryDraw.go:26
↓ 4 callersMethodInputUser
(ctx context.Context, user UserSearch)
internal/repository/dao/search.go:44
↓ 4 callersFunctionInternalServerErrorWithDetails
InternalServerErrorWithDetails 带详细数据和消息的服务器内部错误返回
pkg/apiresponse/apiresponse.go:220
↓ 4 callersMethodReleaseLock
(ctx context.Context, number string)
internal/repository/sms.go:31
↓ 4 callersMethodUpdate
查找当前时刻以前,发送失败的logs,后续需要重新发送
internal/repository/dao/sms.go:13
↓ 4 callersMethodUpdateLotteryDrawStatus
(ctx context.Context, id int, status string)
internal/repository/dao/lotteryDraw.go:27
↓ 4 callersMethodUpdateSecondKillEventStatus
(ctx context.Context, id int, status string)
internal/repository/dao/lotteryDraw.go:29
↓ 4 callersFunctionWrapQuery
(bizFn func(ctx *gin.Context, req Req) (Result, error))
pkg/ginp/wrapper.go:53
↓ 4 callersMethodcreateIndex
CreateIndex 创建一个新的index, 可指定mapping属性
internal/repository/dao/search.go:122
↓ 4 callersFunctiondecodeEventDataToPost
decodeEventDataToPosts 解析事件数据为 Post 结构体
internal/domain/events/es/process_util.go:142
↓ 4 callersFunctiondecodeEventDataToUser
decodeEventDataToUser 解析事件数据为 User 结构体
internal/domain/events/es/process_util.go:162
↓ 4 callersMethodflushBuffer
()
internal/domain/events/es/process_util.go:73
↓ 4 callersFunctiongenerateLotteryDrawKey
generateLotteryDrawKey 生成抽奖活动的缓存键
internal/repository/cache/lotteryDraw.go:337
↓ 4 callersFunctiongenerateSecondKillEventKey
generateSecondKillEventKey 生成秒杀活动的缓存键
internal/repository/cache/lotteryDraw.go:342
↓ 4 callersMethodlistKey
(key string)
internal/repository/cache/post.go:460
↓ 4 callersMethodroleFromDAO
roleFromDAO 将DAO模型转换为领域模型
internal/repository/role.go:108
↓ 4 callersMethodtoDomainRelationSlice
(relations []dao.Relation)
internal/repository/relation.go:143
↓ 4 callersFunctiontoDomainUser
toDomainUser 将dao层对象转为领域层对象
internal/repository/user.go:207
↓ 4 callersMethodupdateRelationCount
updateRelationCount 更新关注或粉丝计数器
internal/repository/dao/relation.go:188
↓ 4 callersMethodwithLocalLock
工具函数
internal/repository/cache/history.go:172
↓ 3 callersMethodAssignRoleToUser
(ctx context.Context, userId int, roleIds []int, menuIds []int, apiIds []int)
internal/service/permission.go:12
↓ 3 callersFunctionBadRequestError
BadRequestError 参数错误的失败返回
pkg/apiresponse/apiresponse.go:200
↓ 3 callersMethodEnqueue
Enqueue 添加一个元素
pkg/priorityqueue/priority_queue.go:72
↓ 3 callersMethodFindByUsername
(ctx context.Context, username string)
internal/repository/dao/user.go:28
↓ 3 callersFunctionFromDomainSlicePost
FromDomainSlicePost 将dao层对象转为领域层对象
pkg/change/change.go:60
↓ 3 callersMethodGet
(ctx context.Context, postId uint)
internal/service/interactive.go:20
↓ 3 callersMethodGetCache
(ctx context.Context, key string)
internal/repository/cache/check.go:16
↓ 3 callersMethodGetLotteryDraw
GetLotteryDraw 从缓存中获取指定ID的抽奖活动
internal/repository/cache/lotteryDraw.go:69
↓ 3 callersMethodGetMoreCommentsReply
(ctx context.Context, rootId, maxId, limit int64)
internal/service/comment.go:25
↓ 3 callersMethodGetSecondKillEvent
GetSecondKillEvent 从缓存中获取指定ID的秒杀活动
internal/repository/cache/lotteryDraw.go:186
↓ 3 callersMethodInsert
(ctx context.Context, log VCodeSmsLog)
internal/repository/dao/sms.go:11
↓ 3 callersMethodListPublishPosts
(ctx context.Context, pagination domain.Pagination)
internal/service/post.go:25
↓ 3 callersMethodProducePublishEvent
(evt PublishEvent)
internal/domain/events/publish/producer.go:13
↓ 3 callersMethodRelease
(ctx context.Context, jobId int64)
internal/repository/dao/sql_job.go:21
↓ 3 callersMethodSendCode
(ctx context.Context, number string)
internal/repository/sms.go:32
↓ 3 callersMethodSetCache
(ctx context.Context, key string, check domain.Check, ttl time.Duration)
internal/repository/cache/check.go:17
↓ 3 callersMethodSetNX
(ctx context.Context, number string, value interface{}, expiration time.Duration)
internal/repository/cache/sms.go:16
↓ 3 callersFunctionToDomainPost
ToDomainPost 将dao层转化为领域层
pkg/change/change.go:87
↓ 3 callersMethodVerifyPassword
VerifyPassword 验证密码是否匹配
internal/domain/user.go:87
↓ 3 callersFunctionWithAsyncCancel
(ctx context.Context, cancel context.CancelFunc, fn func() error)
pkg/general/general.go:7
↓ 3 callersMethodassignAPIPermissions
assignAPIPermissions 分配API权限
internal/repository/dao/permission.go:242
↓ 3 callersMethodassignMenuPermissions
assignMenuPermissions 分配菜单权限
internal/repository/dao/permission.go:218
↓ 3 callersFunctionconvertToDAOParticipant
convertToDAOParticipant 将 domain.Participant 转换为 dao.Participant
internal/repository/lotteryDraw.go:334
↓ 3 callersFunctionconvertToDomainLotteryDraws
convertToDomainLotteryDraws 将 dao.LotteryDraw 列表转换为 domain.LotteryDraw 列表
internal/repository/lotteryDraw.go:286
↓ 3 callersFunctionconvertToDomainSecondKillEvents
convertToDomainSecondKillEvents 将 dao.SecondKillEvent 列表转换为 domain.SecondKillEvent 列表
internal/repository/lotteryDraw.go:323
↓ 3 callersFunctioncreateMockElasticsearchClient
辅助函数,用于创建一个模拟的Elasticsearch客户端,便于测试
internal/repository/search_test.go:21
↓ 3 callersFunctioncreateMockLogger
辅助函数,用于创建一个模拟的Zap日志记录器,这里简单返回一个空的实现,根据实际情况可替换为真实日志记录器或更完善的模拟
internal/repository/search_test.go:41
↓ 3 callersMethoddeleteIndex
deleteIndex 根据索引名称和文档 ID 删除 Elasticsearch 中的文档
internal/repository/dao/search.go:492
↓ 3 callersMethodgetCurrentTime
getCurrentTime 获取当前时间戳(毫秒)
internal/repository/dao/relation.go:63
↓ 3 callersFunctiongetLockedKey
(number string)
internal/repository/cache/sms.go:41
↓ 3 callersMethodkey
(key string)
internal/repository/cache/post.go:456
↓ 3 callersMethodmenusFromDAO
menusFromDAO 批量转换菜单列表
internal/repository/menu.go:118
↓ 3 callersFunctionrandomInt
randomInt 生成 min 到 max 之间的随机整数,用于随机化 TTL
internal/repository/cache/check.go:180
↓ 3 callersFunctiontoDomainCheck
toDomainCheck 将 dao.Check 转换为 domain.Check
internal/repository/check.go:92
↓ 3 callersMethodtoDomainComment
toDomainComment 将DAO评论转换为领域模型评论
internal/repository/comment.go:139
↓ 2 callersMethodAddParticipant
(ctx context.Context, model Participant)
internal/repository/dao/lotteryDraw.go:24
↓ 2 callersMethodAddUserOperationLog
AddUserOperationLog 添加用户验证码行为日志
internal/repository/sms.go:66
↓ 2 callersMethodAssignRole
(ctx context.Context, roleId int, menuIds []int, apiIds []int)
internal/service/permission.go:11
↓ 2 callersMethodAssignRoleToUsers
(ctx context.Context, userIds []int, roleIds []int, menuIds []int, apiIds []int)
internal/service/permission.go:13
next →1–100 of 1,482, ranked by callers