MCPcopy Create free account

hub / github.com/Prejudice-Studio/Twilight / functions

Functions2,686 in github.com/Prejudice-Studio/Twilight

↓ 2 callersFunctionuniqueInt64s
(values []int64)
internal/api/batch_helpers.go:23
↓ 2 callersFunctionupdate
(props: ToasterToast)
webui/src/hooks/use-toast.ts:166
↓ 2 callersFunctionupdateRow
(idx: number, patch: Partial<{ command: string; reply: string }>)
webui/src/app/(main)/admin/config/page.tsx:416
↓ 2 callersFunctionuploadRefKey
(kind, filename string)
internal/api/admin_jobs.go:383
↓ 2 callersFunctionuploadedTicketImageFilename
uploadedTicketImageFilename 上传一张图片并从响应里取回服务端落盘后的文件名。
internal/api/ticket_handlers_test.go:271
↓ 2 callersFunctionupstreamIsTrustedProxy
upstreamIsTrustedProxy 判断 r.RemoteAddr 的对端是否落在 cfg.TrustedProxyCIDRs 列表里。返回 true 时,clientIP 才会消费 X-Forwarded-For / X-Real-IP / CF-* 这 些可被任意调用方伪造的代理头;否
internal/api/app.go:1173
↓ 2 callersFunctionuseBindCodeStatus
(options: UseBindCodeStatusOptions)
webui/src/hooks/use-bind-code-status.ts:60
↓ 2 callersMethoduseCode
(regCode: string, options?: { embyUsername?: string; embyPassword?: string; checkOnly?: boolean })
webui/src/lib/api.ts:675
↓ 2 callersFunctionuserHaystack
(u: EmbyAuditUser)
webui/src/components/admin/emby-device-audit-panel.tsx:100
↓ 2 callersFunctionuserMatchesCategory
(u: EmbyAuditUser, category: CategoryKey)
webui/src/components/admin/emby-device-audit-panel.tsx:125
↓ 2 callersFunctionusersBatchFilterParams
(state: UsersListState)
webui/src/app/(main)/admin/users/admin-users-helpers.ts:54
↓ 2 callersFunctionvalidTicketPriority
(priority string)
internal/api/ticket_handlers.go:618
↓ 2 callersFunctionvalidTicketType
(types []string, input string)
internal/api/ticket_handlers.go:626
↓ 2 callersFunctionvalidateAccount
()
webui/src/app/(auth)/setup/page.tsx:142
↓ 2 callersFunctionvalidateCORSOriginsStartup
validateCORSOriginsStartup 在启动 / reload 时对 CORS 配置做静态体检: - 显式 `*` 与 Allow-Credentials: true 是浏览器规范禁止的组合, applyCORS 已运行期跳过 `*`,但管理员看不到任何反馈, 因此这里强制 zap.
internal/api/app.go:940
↓ 2 callersFunctionvalidateDeveloperJSPresetCode
(w http.ResponseWriter, code string)
internal/api/developer_handlers.go:214
↓ 2 callersFunctionvalidateEmailOptional
(email: string)
webui/src/lib/validators.ts:72
↓ 2 callersFunctionvalidateEmbyURL
validateEmbyURL 拆出来便于单测;返回 trim 右斜杠的 base URL。 现在转调通用 validateOutboundBaseURL,与 Bangumi/Telegram/TMDB 共享同一套 scheme / host / link-local / 元数据 IP / que
internal/api/emby_client.go:70
↓ 2 callersFunctionvalidateSetupHTTPURL
(value, label string)
internal/api/setup_handlers.go:294
↓ 2 callersFunctionvalidateTrustedProxyStartup
validateTrustedProxyStartup 在启动 / reload 时核验"信任代理头 + 上游 CIDR" 这对配置: - TrustProxyHeaders=true 但 TrustedProxyCIDRs 为空:打 Error 提醒—— upstreamIsTrustedProx
internal/api/app.go:1002
↓ 2 callersFunctionvalidateUpdateBranch
(branch string)
internal/api/system_update.go:41
↓ 2 callersMethodverifyEmailCode
(data: { verification_id: string; code: string })
webui/src/lib/api.ts:542
↓ 2 callersFunctionverifyPasswordThrottled
verifyPasswordThrottled 在并发上限信号量下执行 security.VerifyPassword。 信号量满时阻塞等待槽位(而非拒绝),配合上游限流把 PBKDF2 的总 CPU 占用约束住。
internal/api/password_verify.go:34
↓ 2 callersFunctionwebSocketOriginFromHTTPOrigin
(origin: string)
webui/src/middleware.ts:50
↓ 2 callersFunctionwithTimeoutSignal
* 把"调用方 signal"与"超时 signal"合并成一个:任一触发都 abort。 * 走 AbortSignal.timeout + AbortSignal.any 优先(现代浏览器/Node 18+), * 退化路径手写同样语义,保证 SSR / 老浏览器也能跑。 * * tim
webui/src/lib/api-request.ts:118
↓ 2 callersFunctionwriteCommand
(w io.Writer, args ...string)
internal/redis/redis.go:246
↓ 2 callersFunctionwriteTelegramBindCodeState
(w http.ResponseWriter, state telegramBindCodeState)
internal/api/telegram_bind_status.go:99
↓ 2 callersFunctionwriteWebSocketText
(conn net.Conn, payload []byte)
internal/api/websocket.go:45
↓ 1 callersMethodActiveMediaRequestCount
(uid int64)
internal/store/store.go:2659
↓ 1 callersMethodActiveMediaRequestCountTotal
ActiveMediaRequestCountTotal 统计全站正在处理(未完成 / 未拒绝)的求片数。 用于配置里 max_concurrent_requests_global 全局并发上限的判定。 不区分用户 / Telegram ID,单纯按 Status 是否仍是活跃流程内(pending
internal/store/store.go:2676
↓ 1 callersMethodAddTicketAttachment
AddTicketAttachment 给工单追加一张图片元数据。返回更新后的工单。
internal/store/store.go:3130
↓ 1 callersMethodAddTicketType
AddTicketType 添加工单类型,已存在则返回 ErrConflict。
internal/store/store.go:3243
↓ 1 callersMethodApplyTelegramRosterUpdates
(updates []TelegramRosterUpdate)
internal/store/store.go:4021
↓ 1 callersFunctionCheckPostgresTarget
(ctx context.Context, dsn string)
internal/store/store.go:739
↓ 1 callersMethodCleanupExpired
CleanupExpired removes expired sessions from all layers. 接受 caller ctx:scheduler 已提供 runCtx,被 admin 终止时能立刻取消。 不接 ctx 的旧版本若 PG DELETE 卡住,scheduler 永远等
internal/api/session.go:270
↓ 1 callersMethodCleanupExpiredBindCodes
(now int64)
internal/store/store.go:2839
↓ 1 callersMethodCleanupUnverifiedEmailsByAge
CleanupUnverifiedEmailsByAge 清除所有未验证邮箱中,用户账号创建时间早于 cutoff 的记录。 避免 ClearUnverifiedEmails 那种"注册不到 5 分钟就清掉邮箱"的激进行为, 给用户留足验证时间(默认 cutoff=24h)。
internal/store/email_verification.go:215
↓ 1 callersMethodClearAuditLogs
ClearAuditLogs 清空全部审计日志。
internal/store/store.go:4268
↓ 1 callersMethodClearUnverifiedEmails
ClearUnverifiedEmails 清空所有 EmailVerified=false 的用户的 Email 字段。
internal/store/email_verification.go:195
↓ 1 callersMethodClearUserEmails
()
internal/store/store.go:1908
↓ 1 callersMethodClearViolationLogs
ClearViolationLogs removes all violation logs.
internal/store/store.go:4208
↓ 1 callersMethodCountOpenTickets
CountOpenTickets 统计全局处于待处理 / 处理中的工单数量。
internal/store/store.go:3117
↓ 1 callersMethodCountUserOpenTickets
CountUserOpenTickets 统计某用户当前处于待处理 / 处理中的工单数量。
internal/store/store.go:3104
↓ 1 callersFunctionCreatePostgresDatabase
(ctx context.Context, dsn string)
internal/store/store.go:571
↓ 1 callersMethodCreateUserForRegistration
(u User, regCode, telegramBindCode string, now int64, fn func(*User, RegCode, BindCode) error)
internal/store/store.go:1743
↓ 1 callersMethodDeleteAPIKey
(uid, id int64)
internal/store/store.go:2587
↓ 1 callersMethodDeleteAnnouncement
(id int64)
internal/store/store.go:2911
↓ 1 callersMethodDeleteAuditLog
DeleteAuditLog 按 ID 删除单条审计日志。
internal/store/store.go:4253
↓ 1 callersMethodDeleteDeveloperJSPreset
(id int64)
internal/store/store.go:2975
↓ 1 callersMethodDeleteInviteCode
(uid int64, code string)
internal/store/store.go:3388
↓ 1 callersMethodDeleteTicket
(id int64)
internal/store/store.go:3081
↓ 1 callersMethodDeleteTicketType
DeleteTicketType 删除工单类型,不允许删除最后一个。
internal/store/store.go:3258
↓ 1 callersMethodDeleteUser
DeleteUser 删除用户并级联清理所有 UID-键控的衍生数据。 级联策略: 删除(GDPR right-to-erasure,含个人指纹/设备/行为): Users / APIKeys / InviteCodes / InviteRelations / MediaRequests
internal/store/store.go:2299
↓ 1 callersMethodFindUserByEmail
(email string)
internal/store/store.go:1852
↓ 1 callersMethodGet
(ctx context.Context, key string)
internal/redis/redis.go:95
↓ 1 callersMethodHijack
()
internal/api/app.go:199
↓ 1 callersMethodIncrExpire
(ctx context.Context, key string, seconds int)
internal/redis/redis.go:133
↓ 1 callersMethodListAPIKeys
(uid int64)
internal/store/store.go:2510
↓ 1 callersMethodLockEmbyGrantForBoundUsers
LockEmbyGrantForBoundUsers sets EmbyGrantLocked=true for bound users in one store write. Users without Emby are returned as skipped instead of being t
internal/store/store.go:1932
↓ 1 callersFunctionNeedsRehash
NeedsRehash 在以下情况返回 true: - 哈希格式为 legacy("salt$sha256")。 - 当前哈希迭代数低于 MinAcceptablePBKDF2Iterations。 调用方(auth_handlers.go 登录路径)应在 VerifyPassword 通过后检查
internal/security/password.go:74
↓ 1 callersFunctionNew
(rawURL string, poolSize int)
internal/redis/redis.go:40
↓ 1 callersMethodPath
()
internal/store/store.go:893
↓ 1 callersMethodPath
()
internal/config/reader.go:13
↓ 1 callersMethodPing
(ctx context.Context)
internal/redis/redis.go:87
↓ 1 callersMethodRecordAPIKeyUse
(id int64)
internal/store/store.go:2572
↓ 1 callersMethodRemoveTicketAttachment
RemoveTicketAttachment 从工单移除指定文件名的图片元数据。返回更新后的工单。
internal/store/store.go:3155
↓ 1 callersMethodRenameTicketType
RenameTicketType 重命名工单类型。
internal/store/store.go:3281
↓ 1 callersMethodResetTelegramBotOffset
ResetTelegramBotOffset 主动清零,bot 在检测到 username 变更(不同 bot 实例)时调用,避免错把旧 bot 的 offset 套到新 bot 上。
internal/store/store.go:4425
↓ 1 callersMethodRevokeApprovedRebindRequests
RevokeApprovedRebindRequests 把所有 status=="approved"(尚未被解绑消费的换绑 许可)批量置为 "revoked",让持有者立即失去解绑权限,但保留再次申请的能力 (CreateRebindRequest 只拦截 pending;revoked 不影响)
internal/store/store.go:3943
↓ 1 callersMethodSetTelegramBotOffset
SetTelegramBotOffset 持久化 offset。仅当传入值大于当前值才写入:getUpdates 是单调推进的,倒退(极少见,仅 token 切换 / 测试场景)应当走显式 ResetTelegramBotOffset,不通过常规写路径意外覆盖。
internal/store/store.go:4409
↓ 1 callersMethodSpendSigninPointsAndUpdateUser
(uid int64, cost int, fn func(*User) error)
internal/store/signin.go:62
↓ 1 callersMethodTelegramBotOffset
TelegramBotOffset 读取持久化的 getUpdates offset。新部署 / 历史 state 没有该字段时返回 0,调用方按"未设置"处理。
internal/store/store.go:4397
↓ 1 callersMethodTelegramRosterStats
(chatID string)
internal/store/store.go:4076
↓ 1 callersMethodUpsertBindCode
(code BindCode)
internal/store/store.go:2754
↓ 1 callersMethodUpsertRegCodes
UpsertRegCodes 在一次状态写入中批量插入/更新注册码。批量生成注册码时用它替代 逐条 UpsertRegCode,避免每条都触发一次全量状态落盘(saveLocked 每次序列化整个 state,逐条写入时磁盘开销随数量线性放大)。单条字段默认值与 UpsertRegCode 保持一致
internal/store/store.go:3646
↓ 1 callersFunctionabsInt
(value int)
internal/api/emby_inventory.go:284
↓ 1 callersFunctionacquireStateLock
(path string)
internal/store/flock_unix.go:26
↓ 1 callersMethodactivateDeveloperMode
(payload: { code: string; password: string })
webui/src/lib/api.ts:1819
↓ 1 callersFunctionaddPreset
(preset: string)
webui/src/app/(main)/admin/config/page.tsx:332
↓ 1 callersMethodadminAddTicketType
(name: string)
webui/src/lib/api.ts:2573
↓ 1 callersMethodadminBangumiClearLogs
(uid: number)
webui/src/lib/api.ts:375
↓ 1 callersMethodadminBangumiRecords
(uid: number, limit = 100)
webui/src/lib/api.ts:363
↓ 1 callersMethodadminBangumiSyncLogs
(uid: number, limit = 100)
webui/src/lib/api.ts:371
↓ 1 callersMethodadminBangumiSyncUser
(uid: number)
webui/src/lib/api.ts:367
↓ 1 callersMethodadminBangumiUsers
(page = 1, perPage = 20, search = "")
webui/src/lib/api.ts:356
↓ 1 callersMethodadminBindEmbyToUser
(uid: number, payload: { emby_username?: string; emby_id?: string; force?: boolean })
webui/src/lib/api.ts:1003
↓ 1 callersMethodadminBindTelegramToUser
(uid: number, telegramId: number)
webui/src/lib/api.ts:852
↓ 1 callersMethodadminBindUserEmail
(uid: number, data: { email: string; mark_verified?: boolean; force?: boolean })
webui/src/lib/api.ts:566
↓ 1 callersMethodadminBulkEnableDisabledUsers
按当前筛选或指定 UID 批量启用已禁用账号。
webui/src/lib/api.ts:1598
↓ 1 callersMethodadminBulkSetExpire
* 批量一键调控用户到期时间(按筛选条件覆盖普通用户)。 * 后端需要 confirm="BULK_EXPIRE_OK";前端这里强制带上。
webui/src/lib/api.ts:1570
↓ 1 callersMethodadminCleanupEmailVerifications
()
webui/src/lib/api.ts:594
↓ 1 callersMethodadminClearUnverifiedEmails
()
webui/src/lib/api.ts:601
↓ 1 callersMethodadminCreateAnnouncement
(payload: { title?: string; content: string; level?: 'info' | 'notice' | 'warning' | 'critical';
webui/src/lib/api.ts:2320
↓ 1 callersMethodadminCreateStandaloneEmby
(payload: { username: string; password: string; email?: string })
webui/src/lib/api.ts:996
↓ 1 callersMethodadminCreateUser
(payload: { username: string; password?: string; email?: string; role?: number; expired_at?: number; days?: nu
webui/src/lib/api.ts:825
↓ 1 callersMethodadminDeleteAnnouncement
(id: number)
webui/src/lib/api.ts:2350
↓ 1 callersMethodadminDeleteTicket
(id: number)
webui/src/lib/api.ts:2564
↓ 1 callersMethodadminDeleteTicketType
(name: string)
webui/src/lib/api.ts:2580
↓ 1 callersMethodadminDetachInviteUser
(uid: number)
webui/src/lib/api.ts:2426
↓ 1 callersMethodadminForceSetEmbyPassword
* 管理员凭 Emby 用户名强制重置 Emby 密码(即使没有绑定本地账号)。 * @param embyUsername 目标 Emby 用户名 * @param newPassword 可选;省略时后端生成 12 位强密码并在响应里返回
webui/src/lib/api.ts:1160
← previousnext →1,001–1,100 of 2,686, ranked by callers