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
↓ 4 callers
Method
getSigninSummary
()
webui/src/lib/api.ts:649
↓ 4 callers
Function
getTypeBadge
(type: number)
webui/src/app/(main)/admin/regcodes/page.tsx:634
↓ 4 callers
Function
gitRepositoryState
(ctx context.Context, cwd string)
internal/api/system_update.go:225
↓ 4 callers
Function
handleBgChange
(field: keyof BackgroundConfig, value: string)
webui/src/app/(main)/settings/appearance/page.tsx:185
↓ 4 callers
Method
handleCreateInviteCode
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/invite_handlers.go:60
↓ 4 callers
Function
handleOpenEdit
(item: any)
webui/src/app/(main)/bangumi/page.tsx:157
↓ 4 callers
Method
handleUnbindEmby
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/handlers.go:420
↓ 4 callers
Function
hasAuditAction
(app *App, action string)
internal/api/developer_sandbox_test.go:757
↓ 4 callers
Function
hashAPIKey
(key string)
internal/api/app.go:1459
↓ 4 callers
Function
int64Value
(payload map[string]any, key string, fallback int64)
internal/api/announcement_handlers.go:90
↓ 4 callers
Function
inviteChildCanDeleteEmbyAndDetach
(child store.User, now int64)
internal/api/invite_handlers.go:289
↓ 4 callers
Function
inviteChildEmbyExpired
(child store.User, now int64)
internal/api/invite_handlers.go:285
↓ 4 callers
Function
isAbortError
(error: unknown)
webui/src/app/(main)/media/page.tsx:113
↓ 4 callers
Function
isPermanentDateValue
(date: string | Date | number | null | undefined)
webui/src/lib/utils.ts:34
↓ 4 callers
Function
isPositiveNumericID
(id string)
internal/api/media_service.go:63
↓ 4 callers
Method
issueEmailCode
issueEmailCode 校验邮箱、限流、冷却,生成并投递验证码、落库。返回 (verificationID, httpStatus, errCode, message),成功时 errCode 为空、status=200。 校验顺序为先廉价校验(格式/名单)后限流后冷却,最后才发信,避免无谓投
internal/api/email_verify_service.go:124
↓ 4 callers
Method
limiter
()
internal/api/app.go:131
↓ 4 callers
Function
localizedEntry
(locale: TextLocale, row: DeveloperJSDocEntry)
webui/src/components/developer-js-docs-panel.tsx:896
↓ 4 callers
Function
normalizeBackgroundImageValue
(raw?: string | null)
webui/src/lib/safe-url.ts:78
↓ 4 callers
Function
normalizeTMDBMediaType
(mediaType string)
internal/api/media_service.go:72
↓ 4 callers
Function
openStore
(ctx context.Context, cfg config.Config)
cmd/twilight/main.go:344
↓ 4 callers
Function
pad
(n: number)
webui/src/app/(main)/admin/announcements/page.tsx:99
↓ 4 callers
Function
pickEnv
(...keys: string[])
webui/src/app/layout.tsx:23
↓ 4 callers
Function
quickStatus
(ticket: Ticket, status: string)
webui/src/app/(main)/admin/tickets/page.tsx:141
↓ 4 callers
Function
rawToString
(raw any)
internal/config/config.go:1167
↓ 4 callers
Method
reconcileSchedulerRunState
(jobID string, running bool, now time.Time)
internal/api/scheduler_handlers.go:228
↓ 4 callers
Method
regcodeDTO
(code store.RegCode)
internal/api/business.go:584
↓ 4 callers
Function
regcodeStatus
(code store.RegCode)
internal/api/business.go:516
↓ 4 callers
Function
regcodeTypeName
(codeType int)
internal/api/business.go:503
↓ 4 callers
Method
reloadConfigIfChanged
()
internal/api/app.go:520
↓ 4 callers
Function
remainingUseSlots
(used, limit int)
internal/api/business.go:148
↓ 4 callers
Function
renderInline
(text: string, keyPrefix: string)
webui/src/lib/safe-render.tsx:30
↓ 4 callers
Function
replaceNotifPlaceholders
replaceNotifPlaceholders 替换通知模板中的占位符。
internal/api/auth_handlers.go:584
↓ 4 callers
Function
rowID
()
webui/src/app/(main)/admin/telegram/commands/page.tsx:58
↓ 4 callers
Function
runGitOutput
(ctx context.Context, cwd string, timeout time.Duration, args ...string)
internal/api/system_update.go:250
↓ 4 callers
Function
runUpdateCommand
(ctx context.Context, cwd string, args []string, timeout time.Duration)
internal/api/system_update.go:202
↓ 4 callers
Function
sameStringSlice
sameStringSlice 判断两个 string 切片在元素 + 顺序意义上完全相同。 reload 时仅当 CORS 配置实际变化才重跑 validateCORSOriginsStartup, 避免每次 hot reload 都刷一条 Info 日志。
internal/api/app.go:1053
↓ 4 callers
Method
schedulerDefaultRuntimeParams
(jobID string)
internal/api/scheduler_handlers.go:143
↓ 4 callers
Method
schedulerDefaultTriggerSpec
(jobID string)
internal/api/scheduler_daemon.go:391
↓ 4 callers
Function
schedulerJobExists
(jobID string)
internal/api/business.go:1440
↓ 4 callers
Function
signinCurrencyName
(cfg config.Config)
internal/api/signin_handlers.go:152
↓ 4 callers
Function
strconv36
(v int64)
internal/store/store.go:4447
↓ 4 callers
Method
telegramEditPanel
(ctx context.Context, panel telegramPanelContext)
internal/api/telegram_inline.go:482
↓ 4 callers
Method
telegramGroupUserPanelTextForChat
(ctx context.Context, chatID int64, u store.User)
internal/api/telegram_inline.go:505
↓ 4 callers
Function
telegramInlineKeyboard
(rows [][]telegramInlineButton)
internal/api/telegram_inline.go:984
↓ 4 callers
Function
telegramRetryAfterFromError
telegramRetryAfterFromError 从 telegram 错误字符串里反解出 retry_after 秒数。 找不到时第二个返回值 false,调用方走原有 fallback 行为。
internal/api/telegram.go:530
↓ 4 callers
Method
telegramRunJSCustomCommandWithContext
(ctx context.Context, code string, c telegramCommandCtx, privateChat bool)
internal/api/telegram_js_commands.go:116
↓ 4 callers
Function
ticketHasAttachment
(ticket store.Ticket, filename string)
internal/api/ticket_handlers.go:534
↓ 4 callers
Function
toBool
(value any)
internal/api/business.go:1002
↓ 4 callers
Function
tomlSectionFieldFromLine
历史说明:早期存在一个 values 维度的 restoreConfigSecretSentinels(在解析后的 map 上还原哨兵),但 raw TOML PUT 走的是文本路径(saveConfigContent 接收原始 TOML 字符串,不经过 values 往返),因此哨兵还原必须在文本
internal/api/config_admin.go:75
↓ 4 callers
Function
usedCount
(code: Regcode)
webui/src/app/(main)/admin/regcodes/page.tsx:689
↓ 4 callers
Method
userCanSelfUnbindEmby
(u store.User)
internal/api/business.go:262
↓ 4 callers
Function
userKey
(u: EmbyAuditUser, index: number)
webui/src/components/admin/emby-device-audit-panel.tsx:82
↓ 4 callers
Function
usersSummary
(users []store.User)
internal/api/admin_extra.go:1045
↓ 4 callers
Function
validRegcodeTargetUsername
(username string)
internal/api/regcode_handlers.go:254
↓ 4 callers
Method
validatedEmbyEndpoint
validatedEmbyEndpoint 校验 cfg.EmbyURL 后返回拼接好的目标 URL。任何 不可信 scheme(非 http/https)、空 host、解析为 loopback / link-local / 私有 / 元数据 IP 的目标会立即报错,避免 admin 误配 / 被
internal/api/emby_client.go:38
↓ 4 callers
Function
valueOrNil
(ok bool, value bool)
internal/api/telegram_js_commands.go:1628
↓ 4 callers
Function
writeFileAtomicSync
writeFileAtomicSync 把 data 原子地写入 path:tmp 写完先 fsync 文件, 关闭后 rename,再 fsync 父目录。任一步失败清理 tmp 后返回 error。 saveLocked / BackupWithNote / writeBackupNote /
internal/store/store.go:1537
↓ 4 callers
Function
writeJSONWithCode
writeJSONWithCode 在 writeJSON 基础上允许传入业务级 error_code(见 errcode.go)。 当 errorCode 为空时回落到按 HTTP status 自动推导(defaultErrorCode)。
internal/api/response.go:24
↓ 3 callers
Method
AddPlaybackRecord
(record PlaybackRecord)
internal/store/playback.go:7
↓ 3 callers
Method
AddRuntimeLog
(entry RuntimeLogEntry, limit int)
internal/store/runtime_log.go:42
↓ 3 callers
Method
AuditLogCount
AuditLogCount 返回当前审计日志总数。
internal/store/store.go:4317
↓ 3 callers
Method
CleanupExpiredEmailVerifications
CleanupExpiredEmailVerifications 清理过期验证码,由调度任务周期调用。
internal/store/email_verification.go:175
↓ 3 callers
Method
ConsumeRebindRequest
ConsumeRebindRequest marks an approved rebind request as "used" so it cannot be reused to bypass force-bind policy again. Called after the user succes
internal/store/store.go:3920
↓ 3 callers
Method
CreateAPIKey
(k APIKey)
internal/store/store.go:2488
↓ 3 callers
Method
CreateRebindRequest
(req RebindRequest)
internal/store/store.go:3824
↓ 3 callers
Method
Del
(ctx context.Context, key string)
internal/redis/redis.go:112
↓ 3 callers
Method
DeveloperJSPreset
(id int64)
internal/store/store.go:2952
↓ 3 callers
Method
LastSchedulerRunByType
LastSchedulerRunByType 返回 (jobID, runType) 命中的最新一条 SchedulerRun(按 StartedAt 取大者,处理乱序记录)。该方法**不**走 SchedulerRuns 的 20 条窗 口——cron_daily 任务的"今天是否已经自动跑过"判
internal/store/scheduler.go:175
↓ 3 callers
Method
LoadSnapshot
(data []byte)
internal/store/store.go:1333
↓ 3 callers
Method
MarkTelegramRosterLeft
(chatID string, telegramID int64, status string)
internal/store/store.go:3998
↓ 3 callers
Function
OpenPostgres
(ctx context.Context, dsn string)
internal/store/store.go:544
↓ 3 callers
Function
ResolveBackupPath
(dir, name string)
internal/store/store.go:1600
↓ 3 callers
Method
ReviewRebindRequest
(id, reviewerUID int64, status, note string)
internal/store/store.go:3872
↓ 3 callers
Method
RuntimeLogStats
()
internal/store/runtime_log.go:173
↓ 3 callers
Method
SetEX
(ctx context.Context, key string, seconds int, value string)
internal/redis/redis.go:107
↓ 3 callers
Method
SetSchedulerSchedule
(jobID string, spec map[string]any, custom bool)
internal/store/scheduler.go:197
↓ 3 callers
Method
Signin
最多保留 730 条签到记录(约 2 年),超出的旧记录自动裁剪
internal/store/signin.go:8
↓ 3 callers
Method
Snapshot
()
internal/store/store.go:1261
↓ 3 callers
Method
UpdateAPIKey
(uid, id int64, fn func(*APIKey) error)
internal/store/store.go:2550
↓ 3 callers
Method
UpsertAnnouncement
(a Announcement)
internal/store/store.go:2858
↓ 3 callers
Method
adminUpdateAnnouncement
(id: number, payload: { title?: string; content?: string; level?: 'info' | 'notice' | 'warning' |
webui/src/lib/api.ts:2335
↓ 3 callers
Function
apiRequest
( endpoint: string, options: RequestInit = {}, extra: ApiRequestExtraOptions = {}, )
webui/src/lib/api-request.ts:267
↓ 3 callers
Method
argString
argString 把 Args 拼成单个查询字符串(多关键词以空格分隔), 等价于过去 strings.Join(fields[1:], " ") 的写法。
internal/api/telegram_commands.go:43
↓ 3 callers
Function
clampRuntimeLogReadLimit
(limit int)
internal/store/runtime_log.go:282
↓ 3 callers
Function
clientFilterValue
(name: string)
webui/src/components/admin/emby-device-audit-panel.tsx:56
↓ 3 callers
Function
cloneZapFields
(fields []zapcore.Field)
internal/api/runtime_logs.go:358
↓ 3 callers
Function
closeDepthPrompt
(value: string | null)
webui/src/app/(main)/admin/invite/page.tsx:209
↓ 3 callers
Method
completeEmbyRegistration
(embyUsername: string, embyPassword: string)
webui/src/lib/api.ts:493
↓ 3 callers
Method
configure
(st *store.Store, limit int)
internal/api/runtime_logs.go:69
↓ 3 callers
Method
configuredServerIconPath
()
internal/api/handlers.go:1354
↓ 3 callers
Method
confirmBindCodeAtomic
(code string, telegramID int64, telegramUsername string, now int64)
internal/api/telegram_bind_status.go:150
↓ 3 callers
Function
constantTimeStringEqual
constantTimeStringEqual 在 ConstantTimeCompare 基础上消除 length-mismatch 提前 return 0 引入的 timing oracle:先把两侧 zero-pad 到相同长度再比对, 然后 AND 上长度等价位。即便攻击者通过响应时延区分"
internal/api/bangumi_webhook.go:148
↓ 3 callers
Function
countOf
(result: DatabaseMigrationResult | null, key: string)
webui/src/app/(main)/admin/database/page.tsx:57
↓ 3 callers
Function
databaseBackupInfo
(path string)
internal/api/database_admin.go:417
↓ 3 callers
Method
databaseMismatchWarning
()
internal/api/storage_guard.go:59
↓ 3 callers
Method
deleteUserScoped
* 扩展用户删除:支持邀请树级联,且三种 mode 均可级联。 * - mode = with_emby:本地 + Emby * - mode = local_only:仅本地(保留 Emby) * - mode = emby_only:仅 Emby(保留本地与树关系) *
webui/src/lib/api.ts:2469
↓ 3 callers
Method
developerJSCreateAnnouncement
developerJSCreateAnnouncement mirrors handleCreateAnnouncement: admin-gated, preview-aware and audited. Render mode is normalized to the safe subset.
internal/api/telegram_js_generators.go:347
↓ 3 callers
Method
developerJSGenerateInviteCode
developerJSGenerateInviteCode mirrors handleCreateInviteCode for admins, honoring the InviteEnabled feature gate, day caps, collision detection, previ
internal/api/telegram_js_generators.go:242
↓ 3 callers
Method
developerJSGenerateRegcode
developerJSGenerateRegcode mirrors handleCreateRegcodes: admin-gated, validated, collision-checked, preview-aware (dry-run) and audited. Returns a res
internal/api/telegram_js_generators.go:87
← previous
next →
401–500 of 2,686, ranked by callers