Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Prejudice-Studio/Twilight
/ functions
Functions
2,686 in github.com/Prejudice-Studio/Twilight
⨍
Functions
2,686
◇
Types & classes
267
↓ 7 callers
Function
batchResult
(total int)
internal/api/business.go:1394
↓ 7 callers
Method
batchUserUIDsFromPayload
(w http.ResponseWriter, payload map[string]any, maxExplicit, maxSelectedAll int, tooManyMessage string)
internal/api/batch_user_handlers.go:361
↓ 7 callers
Method
clearDelAccountPending
(chatID, telegramID int64)
internal/api/telegram_bot.go:69
↓ 7 callers
Function
clearUserSelection
()
webui/src/app/(main)/admin/users/page.tsx:380
↓ 7 callers
Method
configBackupDir
()
internal/api/config_admin.go:596
↓ 7 callers
Function
csvSafe
csvSafe 中和 CSV 公式注入:Excel / WPS / LibreOffice 会把以 = + - @ 开头 (或以 Tab / CR / LF 起始)的单元格当作公式求值,恶意用户名 / 媒体标题 形如 "=HYPERLINK(...)"、"=1+2"、"+cmd" 在管理员打开导出文
internal/api/handlers.go:2771
↓ 7 callers
Method
embyUserByID
(ctx context.Context, id string)
internal/api/emby.go:237
↓ 7 callers
Function
generateRegCode
(format string, codeType int, algorithm string, days int, index int, validity int64, useLimit int)
internal/api/business.go:703
↓ 7 callers
Function
paginate
(items []T, page, perPage int)
internal/api/business.go:357
↓ 7 callers
Function
postJSON
(ctx context.Context, endpoint string, headers map[string]string, body any, dst any)
internal/api/http_json_client.go:85
↓ 7 callers
Function
redactGitURL
(raw string)
internal/api/system_update.go:280
↓ 7 callers
Method
refreshTelegramUsername
refreshTelegramUsername 在收到任意来自已绑定用户的更新时被动刷新其存储的 Telegram 用户名。只有解析到绑定账号、且新用户名非空并与现存不同才写库,避免 无谓写盘;用户名为空(对方删了 @username)时保留旧值不清空,以免破坏指名码匹配。
internal/api/telegram_bot.go:299
↓ 7 callers
Method
runtimeDatabaseMismatch
()
internal/api/storage_guard.go:24
↓ 7 callers
Function
setupObject
(payload map[string]any, key string)
internal/api/setup_handlers.go:240
↓ 7 callers
Method
telegramDeletePanel
(token string)
internal/api/telegram_inline.go:235
↓ 7 callers
Method
telegramEditMessageText
(ctx context.Context, chatID, messageID int64, text string, replyMarkup any)
internal/api/telegram.go:187
↓ 7 callers
Method
telegramSavePanel
(panel telegramPanelContext)
internal/api/telegram_inline.go:132
↓ 7 callers
Method
updateMySettings
(data: { bgm_mode?: boolean; bgm_manage_mode?: boolean; bgm_token?: string; email?: string; notify_on_login_te
webui/src/lib/api.ts:296
↓ 7 callers
Method
userFromPath
userFromPath 抽掉"按 :uid path-param 加载用户,不存在则 404"的 重复模板。原先 handlers.go / upload_handlers.go / admin_extra.go / library_handlers.go 各处共有 9 个完全一样的 4 行片段:
internal/api/app.go:1370
↓ 7 callers
Function
userLabel
(username?: string | null, uid?: number | null)
webui/src/app/(main)/admin/regcodes/page.tsx:695
↓ 6 callers
Method
Close
()
internal/redis/redis.go:66
↓ 6 callers
Method
EmailVerification
(id string)
internal/store/email_verification.go:155
↓ 6 callers
Method
FindUserByEmbyID
(embyID string)
internal/store/store.go:1866
↓ 6 callers
Method
ListAuditLogs
ListAuditLogs 返回所有审计日志,最新在前。
internal/store/store.go:4241
↓ 6 callers
Method
ListBangumiSyncLogs
(uid int64, limit int)
internal/store/store.go:4342
↓ 6 callers
Method
ListTickets
(filter TicketFilter)
internal/store/store.go:3044
↓ 6 callers
Method
LoginHistory
(uid int64, blockedOnly bool, since int64, limit int)
internal/store/login_log.go:27
↓ 6 callers
Function
ResolveLeafFile
ResolveLeafFile 是 ResolveWithinRoot 的严格子集:要求 name 为单一文件名 (没有目录分隔符 / 没有 ..),且最终路径必须是普通文件、非符号链接, 可选地校验扩展名(lowercase,不含点 ".";空字符串表示不校验)。 用于备份恢复、上传资源访问等"必
internal/api/safepath.go:54
↓ 6 callers
Method
SetDeveloperModeEnabled
(enabled bool)
internal/store/store.go:3318
↓ 6 callers
Method
UpdateDevice
(uid int64, deviceID string, fn func(*Device))
internal/store/device.go:37
↓ 6 callers
Method
UpsertTelegramRoster
(chatID string, telegramID int64, status string, isBot bool)
internal/store/store.go:3971
↓ 6 callers
Function
ValidatePasswordStrength
ValidatePasswordStrength 与前端 password.ts:validatePasswordStrength 等价。 前端可在用户输入时给出可视化提示,后端必须用本函数兜底,否则可被绕过。
internal/validate/validate.go:54
↓ 6 callers
Function
VerifyPassword
(password, encoded string)
internal/security/password.go:47
↓ 6 callers
Function
addDaysToExpiry
(current int64, days int, now time.Time)
internal/api/business.go:196
↓ 6 callers
Method
batchUserSelectionBody
(selection: number[] | BatchUserSelection)
webui/src/lib/api.ts:1065
↓ 6 callers
Function
cloneMap
(in map[string]any)
internal/api/business.go:1432
↓ 6 callers
Function
defaultPermissions
()
internal/api/apikey_handlers.go:202
↓ 6 callers
Function
describeApiTarget
(endpoint: string, method: string)
webui/src/lib/api-request.ts:172
↓ 6 callers
Function
developerJSAnySlice
(input any)
internal/api/telegram_js_commands.go:2133
↓ 6 callers
Function
developerJSListOptions
developerJSListOptions parses { limit, offset } from an exported JS options object. limit is clamped to [1, max] with the given fallback; offset is cl
internal/api/telegram_js_commands.go:801
↓ 6 callers
Function
developerJSMapString
(values map[string]any, key string)
internal/api/telegram_js_commands.go:1842
↓ 6 callers
Function
developerJSPrivateIP
(ip net.IP)
internal/api/telegram_js_commands.go:2113
↓ 6 callers
Function
developerJSStringSlice
(input any)
internal/api/telegram_js_commands.go:2165
↓ 6 callers
Function
dispatch
(action: Action)
webui/src/hooks/use-toast.ts:154
↓ 6 callers
Function
embyPolicy
(user map[string]any)
internal/api/admin_extra.go:1053
↓ 6 callers
Function
filterRows
(rows: DeveloperJSDocEntry[], query: string, category?: string)
webui/src/components/developer-js-docs-panel.tsx:938
↓ 6 callers
Function
inspect
(name: string, settled: PromiseSettledResult<unknown>)
webui/src/app/(main)/dashboard/page.tsx:247
↓ 6 callers
Function
int64Slice
(value any)
internal/api/business.go:1373
↓ 6 callers
Method
inviteDepth
(uid int64)
internal/api/business.go:1170
↓ 6 callers
Function
jobParamInt
(params map[string]any, key string, fallback int)
internal/api/scheduler_runner.go:773
↓ 6 callers
Method
maintainTelegramIDIndex
maintainTelegramIDIndex 在用户变更后增量维护 telegramID → UID 索引。 调用方须持有 s.mu 写锁。索引为空时自动从 state 重建。
internal/store/store.go:2455
↓ 6 callers
Function
normalizeRegcodeTargetTelegramUsername
(username string)
internal/api/regcode_handlers.go:258
↓ 6 callers
Method
pgDB
()
internal/api/session.go:104
↓ 6 callers
Function
pushText
()
webui/src/lib/safe-render.tsx:35
↓ 6 callers
Method
redis
()
internal/api/app.go:138
↓ 6 callers
Function
refreshAfterBatch
()
webui/src/app/(main)/admin/users/page.tsx:1229
↓ 6 callers
Function
regcodeUsedByUIDs
(code store.RegCode)
internal/api/business.go:622
↓ 6 callers
Method
reloadConfig
()
internal/api/app.go:331
↓ 6 callers
Function
runtimeConfigPath
(path string)
cmd/twilight/main.go:415
↓ 6 callers
Function
selectedBatchTarget
()
webui/src/app/(main)/admin/users/page.tsx:405
↓ 6 callers
Method
setTelegramRuntimeStatus
(polling bool, err error)
internal/api/telegram.go:72
↓ 6 callers
Function
stripProtectedAdminConfig
(content string)
internal/api/config_admin.go:652
↓ 6 callers
Method
telegramDeleteMessage
(ctx context.Context, chatID, messageID int64)
internal/api/telegram.go:212
↓ 6 callers
Method
telegramIDTakenLocked
(telegramID, allowedUID int64)
internal/store/store.go:1683
↓ 6 callers
Method
telegramRunJSCustomCommandWithOptions
(code string, c telegramCommandCtx, privateChat bool, opts developerJSRunOptions)
internal/api/telegram_js_commands.go:120
↓ 6 callers
Method
telegramSanitizeError
(err error)
internal/api/telegram.go:139
↓ 6 callers
Method
ticketAttachmentDir
ticketAttachmentDir 返回某工单的图片目录绝对路径(约束在 uploads/tickets/<id> 内)。
internal/api/ticket_handlers.go:301
↓ 6 callers
Function
ticketDTO
ticketDTO 把单个工单序列化为响应 map,并为每张附件补上可访问的 url 字段。
internal/api/ticket_handlers.go:567
↓ 6 callers
Function
uploadImageExtension
(contentType string)
internal/api/upload_handlers.go:326
↓ 6 callers
Method
userHasEmbyGrantHistory
(u store.User)
internal/api/business.go:258
↓ 6 callers
Function
validateOutboundBaseURL
validateOutboundBaseURL 用于所有出站远端服务(Emby / Bangumi / Telegram / TMDB)配置的 base URL 校验。返回 trim 右斜杠的规范化 base URL。 规则: - scheme 必须为 http 或 https; - host 不
internal/api/outbound_url.go:45
↓ 6 callers
Function
wrap
(cls: string, text: string)
webui/src/components/js-code-editor.tsx:59
↓ 5 callers
Method
AddLoginLog
(log LoginLog)
internal/store/login_log.go:7
↓ 5 callers
Method
AddViolationLog
AddViolationLog records a code violation attempt.
internal/store/store.go:4166
↓ 5 callers
Method
BackupWithNote
(dir, note string)
internal/store/store.go:1413
↓ 5 callers
Method
CreateMediaRequest
(r MediaRequest)
internal/store/store.go:2600
↓ 5 callers
Method
FindActiveEmailVerification
FindActiveEmailVerification 返回匹配 (purpose,email) 且未过期的记录(用于登出态 找回:客户端只提交 email+code,没有 id;也用于发码前的重发冷却判定)。
internal/store/email_verification.go:71
↓ 5 callers
Method
Flush
()
internal/api/app.go:186
↓ 5 callers
Method
IsIPBlacklisted
(ip string)
internal/store/ip_blacklist.go:39
↓ 5 callers
Function
NewReader
(path string)
internal/config/reader.go:9
↓ 5 callers
Method
RuntimeLogs
(limit int, after int64)
internal/store/runtime_log.go:118
↓ 5 callers
Method
Save
()
internal/store/store.go:1064
↓ 5 callers
Method
SchedulerSchedule
(jobID string)
internal/store/scheduler.go:264
↓ 5 callers
Method
UpsertTicket
---- Tickets ----
internal/store/store.go:2989
↓ 5 callers
Function
applyThemeCustom
(tc: ThemeCustom)
webui/src/lib/theme-custom.ts:158
↓ 5 callers
Function
clampRuntimeLogLimit
(limit int)
internal/store/runtime_log.go:292
↓ 5 callers
Function
commandExists
(name string)
internal/api/system_update.go:312
↓ 5 callers
Function
configFileSignature
(path string)
internal/api/app.go:547
↓ 5 callers
Function
copyToClipboard
(text: string)
webui/src/app/(main)/admin/regcodes/page.tsx:332
↓ 5 callers
Function
defaultErrorCode
(status int, success bool)
internal/api/response.go:72
↓ 5 callers
Function
describeTriggerSpec
(t: TFunc, spec: SchedulerTriggerSpec | undefined | null)
webui/src/app/(main)/admin/scheduler/page.tsx:134
↓ 5 callers
Method
emailGateActive
emailGateActive 判定某用户是否处于"强制邮箱验证"约束下:邮箱子系统可用 + force_bind 开启 + 角色为普通/白名单。管理员不被强制(仅前端提示)。
internal/api/email_verify_service.go:262
↓ 5 callers
Function
getThemeCustom
()
webui/src/lib/theme-custom.ts:127
↓ 5 callers
Method
handleInviteUse
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/invite_handlers.go:342
↓ 5 callers
Method
invalidateConfigSchemaCache
()
webui/src/lib/api.ts:127
↓ 5 callers
Method
inviteCodeDTO
(code store.InviteCode)
internal/api/business.go:1061
↓ 5 callers
Method
issueSessionCookies
(w http.ResponseWriter, sessionToken string, expires time.Time)
internal/api/app.go:1113
↓ 5 callers
Function
joinInt64
(values []int64)
internal/api/business.go:644
↓ 5 callers
Function
maskEmail
maskEmail 在响应里对邮箱做局部遮蔽(保留首尾少量字符),用于发码后的回显, 避免在共享屏幕 / 日志里完整暴露邮箱。
internal/api/email_handlers.go:18
↓ 5 callers
Function
mediaRequestUserDTO
(req store.MediaRequest)
internal/api/business.go:440
← previous
next →
201–300 of 2,686, ranked by callers