Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/KunMoe/kun-galgame-patch
/ functions
Functions
1,135 in github.com/KunMoe/kun-galgame-patch
⨍
Functions
1,135
◇
Types & classes
365
↓ 3 callers
Function
getEnvProd
getEnvProd returns the env var if set; otherwise it panics in prod mode (fail-fast — no silent dev-default fallback for things that must be configured
apps/api/pkg/config/config.go:190
↓ 3 callers
Function
getMessageIDParam
(c fiber.Ctx)
apps/api/internal/chat/handler/handler.go:168
↓ 3 callers
Function
getOAuthCookie
(name: string)
apps/web/app/shared/utils/pkce.ts:45
↓ 3 callers
Function
hikariOriginAllowed
(origin string)
apps/api/internal/middleware/cors.go:68
↓ 3 callers
Function
mapArtifactErr
mapArtifactErr translates artifact client sentinels into user-facing messages.
apps/api/internal/common/upload/service.go:266
↓ 3 callers
Function
nameOf
nameOf strips the "<category>/" prefix to recover the within-category name.
apps/api/internal/doc/service/service.go:444
↓ 3 callers
Method
notifyContentInteraction
notifyContentInteraction creates a "someone liked / favorited your content" notification. msgType distinguishes the interaction so the message center
apps/api/internal/patch/service/service.go:1682
↓ 3 callers
Function
ptr
(v T)
apps/api/internal/common/upload/service.go:50
↓ 3 callers
Function
putToS3
( url: string, body: Blob, onProgress: (delta: number) => void )
apps/web/app/composables/useResourceUpload.ts:152
↓ 3 callers
Function
setOAuthCookie
(name: string, value: string)
apps/web/app/shared/utils/pkce.ts:40
↓ 3 callers
Function
setOpen
(value: boolean)
apps/web/app/composables/useKunDisclosure.ts:26
↓ 3 callers
Function
setToSlice
(s map[string]bool)
apps/api/internal/patch/repository/repository.go:496
↓ 3 callers
Function
toIso
(d: unknown)
apps/web/server/utils/kunSitemapSources.ts:55
↓ 3 callers
Function
truncate
(s string, n int)
apps/api/pkg/imageclient/client.go:398
↓ 3 callers
Function
truncate
(s string, n int)
apps/api/internal/auth/service/service.go:349
↓ 3 callers
Function
unwrap
(json: unknown)
apps/web/server/utils/kunSitemapSources.ts:52
↓ 3 callers
Function
wikiPathFromRequest
wikiPathFromRequest turns the incoming original URL into the Wiki path, preserving exact path/query encoding. c.OriginalURL() keeps the raw, undecoded
apps/api/internal/patch/handler/galgame_edit.go:40
↓ 3 callers
Function
write
(items: PatchPendingUpload[])
apps/web/app/composables/useResourceResumeUploads.ts:24
↓ 3 callers
Method
writeUserJSON
─── shared write helpers ──────────────────────────────
apps/api/internal/galgame/client/submission.go:403
↓ 3 callers
Function
writeWikiNotificationRaw
(tx *gorm.DB, m *galgameClient.WikiMessage, text string)
apps/api/internal/infrastructure/cron/wiki_sync.go:246
↓ 2 callers
Function
CardFromBrief
CardFromBrief builds a GalgameCard from a Wiki brief alone (no local patch row). All moyu-side stats stay zero — used when enriching Wiki responses (t
apps/api/internal/galgame/enricher/enricher.go:539
↓ 2 callers
Method
CompleteUpload
(ctx context.Context, uuid string, body CompleteUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:262
↓ 2 callers
Method
CreateCommentNotification
(senderID int, comment *model.PatchComment)
apps/api/internal/patch/service/service.go:1579
↓ 2 callers
Method
CreateMentionMessages
CreateMentionMessages notifies every @mentioned user. commentID is the comment carrying the mention, so the notification deep-links straight to it (/p
apps/api/internal/patch/service/service.go:1565
↓ 2 callers
Method
Download
Download returns a download URL (presigned GET, or a Worker URL for public artifacts on a site with a CDN base configured).
apps/api/pkg/artifactclient/client.go:242
↓ 2 callers
Method
EnsureContributor
(userID, patchID int)
apps/api/internal/patch/repository/repository.go:413
↓ 2 callers
Method
ExtractMentionUserIDs
===== Mention detection ===== ExtractMentionUserIDs delegates to the markdown package so the regex used for notification routing matches exactly what
apps/api/internal/patch/service/service.go:1490
↓ 2 callers
Method
FindFavorite
===== Favorites =====
apps/api/internal/patch/repository/repository.go:385
↓ 2 callers
Method
FindFollow
===== Follow =====
apps/api/internal/user/repository/repository.go:139
↓ 2 callers
Method
FindResourceFavorite
===== Resource Favorites (per-resource subscription) =====
apps/api/internal/patch/repository/repository.go:369
↓ 2 callers
Method
FindRoomByLink
─── Room ─────────────────────────────────────────── FindRoomByLink looks up a room by its link.
apps/api/internal/chat/repository/repository.go:24
↓ 2 callers
Method
FindUserByID
FindUserByID looks up the local user row by id. The id should equal OAuth.users.id (aligned by migrate-users) and is taken from oauth/userinfo's `id`
apps/api/internal/auth/repository/repository.go:24
↓ 2 callers
Method
GetCommentPatchID
GetCommentPatchID returns the comment's owning patch.id so the handler can NSFW-gate it before serving the markdown body.
apps/api/internal/patch/service/service.go:803
↓ 2 callers
Function
GetRoles
GetRoles returns the OAuth roles for the current request, or an empty slice if no session is attached. Roles come from the access_token JWT roles clai
apps/api/internal/middleware/auth.go:298
↓ 2 callers
Method
GetSetting
===== Settings ===== Source of truth is the site_setting table via settingService (durable + audited), NOT Redis. SetSetting records the acting admin
apps/api/internal/admin/service/service.go:208
↓ 2 callers
Method
InitUpload
(ctx context.Context, body InitUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:251
↓ 2 callers
Method
IsMember
IsMember reports whether a user is a member of a given room.
apps/api/internal/chat/repository/repository.go:76
↓ 2 callers
Method
LookupPatchesByIDs
(ids []int)
apps/api/internal/galgame/enricher/enricher.go:277
↓ 2 callers
Method
MainURL
MainURL builds the canonical CDN URL for the full image (`.webp`). Returns "" for empty / malformed hashes — caller can fall back to a placeholder.
apps/api/pkg/imageclient/client.go:366
↓ 2 callers
Function
NewCompleteUploadRequestWithBody
NewCompleteUploadRequestWithBody generates requests for CompleteUpload with any type of body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:550
↓ 2 callers
Function
NewInitUploadRequestWithBody
NewInitUploadRequestWithBody generates requests for InitUpload with any type of body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:442
↓ 2 callers
Function
ParseCompleteUploadResp
ParseCompleteUploadResp parses an HTTP response from a CompleteUploadWithResponse call
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:1074
↓ 2 callers
Function
ParseInitUploadResp
ParseInitUploadResp parses an HTTP response from a InitUploadWithResponse call
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:975
↓ 2 callers
Function
Sanitize
Sanitize runs the shared allow-list over already-rendered HTML. Exposed so the render entry points (Render / RenderWithTOC) share one boundary.
apps/api/internal/infrastructure/markdown/sanitize.go:20
↓ 2 callers
Method
SetSetting
(key string, enabled bool, adminUID int)
apps/api/internal/admin/service/service.go:212
↓ 2 callers
Method
SubmitGalgame
===== Wiki submission proxies (docs/galgame_wiki/07-submission.md) ===== Each endpoint is a thin pass-through to Wiki: extract the user's access_toke
apps/api/internal/patch/handler/handler.go:944
↓ 2 callers
Method
UpdateGalgame
UpdateGalgame PUT /api/v1/galgame/:gid Thin proxy over the Wiki Service's PUT /galgame/:gid. Two modes: - application/json -> forwards the JSON bod
apps/api/internal/patch/handler/handler.go:827
↓ 2 callers
Method
applyCommentSideEffects
applyCommentSideEffects runs the once-per-visible-comment bookkeeping: bump the patch's comment_count, award the owner +1 moemoepoint (unless they aut
apps/api/internal/patch/service/service.go:660
↓ 2 callers
Function
applyFollowCountsTx
applyFollowCountsTx applies the +/-delta to following_count (follower) and follower_count (followee) within the given tx. GREATEST clamps at 0.
apps/api/internal/user/repository/repository.go:181
↓ 2 callers
Method
attachCommentUsers
(ctx context.Context, cs []patchModel.PatchComment)
apps/api/internal/common/handler.go:61
↓ 2 callers
Method
attachGalgameNames
attachGalgameNames batch-resolves the multilingual game name (from each game-scoped message's /patch/<id> link) and stamps msg.GalgameName, so the fro
apps/api/internal/message/handler/handler.go:48
↓ 2 callers
Method
attachPatchSummaries
attachPatchSummaries stamps the `Patch` field on each resource and each comment in one Wiki batch call (name + banner come from the Wiki Service). Eit
apps/api/internal/user/service/service.go:59
↓ 2 callers
Method
attachPatchSummaries
attachPatchSummaries fills the owning-galgame summary (name / banner / vndb_id) on comment / resource rows so the admin UI can show the game's NAME in
apps/api/internal/admin/handler/handler.go:68
↓ 2 callers
Method
attachSenders
attachSenders batch-resolves sender briefs from OAuth /users/batch and stamps msg.Sender. Without this every message serialized with sender=nil, and t
apps/api/internal/message/handler/handler.go:104
↓ 2 callers
Function
base64UrlEncode
(input: Uint8Array)
apps/web/app/shared/utils/pkce.ts:3
↓ 2 callers
Method
briefsToFollowItems
briefsToFollowItems is briefsToUserBasic + per-row is_followed stamp. One follow-set lookup covers the whole page.
apps/api/internal/user/service/service.go:202
↓ 2 callers
Function
buildImageServiceURL
(hash: string, variant?: string)
apps/web/app/shared/utils/resolveBannerUrl.ts:41
↓ 2 callers
Method
check
()
apps/api/internal/infrastructure/storage/s3.go:92
↓ 2 callers
Function
clearSessionCookie
clearSessionCookie wipes the kun_session cookie on the response. Used when we reject a request because the upstream OAuth refresh permanently failed -
apps/api/internal/middleware/auth.go:651
↓ 2 callers
Function
close
()
apps/web/app/composables/useAuthModal.ts:18
↓ 2 callers
Method
composeMe
composeMe merges the local user row with the OAuth brief (name/avatar/bio) into a MeResponse. If the OAuth /users/batch call fails we still return the
apps/api/internal/auth/handler/handler.go:219
↓ 2 callers
Function
composeSlug
composeSlug builds the stored "<category>/<name>" slug from its parts.
apps/api/internal/doc/service/service.go:439
↓ 2 callers
Method
createPatchRow
createPatchRow is the shared register-a-carrier body for both entrypoints: idempotent dedup by id (= galgame_id), mirror the Wiki release_date, then o
apps/api/internal/patch/service/service.go:127
↓ 2 callers
Method
creatorApplicationReq
(req *http.Request)
apps/api/pkg/userclient/client.go:337
↓ 2 callers
Method
creatorEligibility
(ctx context.Context, userID int)
apps/api/internal/user/service/creator.go:34
↓ 2 callers
Function
decodeJWTRoles
decodeJWTRoles extracts the `roles` claim from a JWT without verifying the signature. Safe here because the token came out of our Redis session (place
apps/api/internal/middleware/auth.go:446
↓ 2 callers
Function
destroySpoilerAnimation
(spoilerEl: HTMLElement)
apps/web/app/composables/topic/useSpoilerContent.ts:39
↓ 2 callers
Method
doEnvelope
doEnvelope executes req, decodes the standard {code,message,data} envelope and returns the raw `data` (so the handler can re-wrap without an extra unm
apps/api/internal/galgame/client/editing.go:113
↓ 2 callers
Method
enrichMessages
enrichMessages fills ContentHTML (rendered markdown), Reaction[] (with the reacting users' briefs) and QuoteMessage (the replied-to message preview) f
apps/api/internal/chat/handler/handler.go:79
↓ 2 callers
Function
ensureLoaded
(accounts: Ref<KnownAccount[]>)
apps/web/app/composables/useKnownAccounts.ts:50
↓ 2 callers
Function
handleAuthExpiry
(code: number)
apps/web/app/composables/useApi.ts:159
↓ 2 callers
Function
hikariFail
hikariFail writes the legacy error envelope ({success:false, data:null}).
apps/api/internal/common/handler.go:623
↓ 2 callers
Function
lcsDiff
(a: T[], b: T[], eq: (x: T, y: T) => boolean)
apps/web/app/utils/lcs-diff.ts:50
↓ 2 callers
Method
listMetadata
(docs []model.Doc)
apps/api/internal/doc/service/service.go:152
↓ 2 callers
Function
newRenderContext
newRenderContext builds the parser context shared by Render / RenderWithTOC: CJK-friendly heading IDs plus (when a meta resolver is wired) the content
apps/api/internal/infrastructure/markdown/markdown.go:162
↓ 2 callers
Function
num
(row: Record<string, unknown>, key: string)
apps/web/server/utils/kunSitemapSources.ts:63
↓ 2 callers
Method
oauthPostJSON
oauthPostJSON POSTs JSON to the OAuth server and decodes the wrapped {code, message, data} envelope into out (when not nil). A non-zero envelope code
apps/api/internal/auth/service/service.go:286
↓ 2 callers
Function
parseDeleteReason
parseDeleteReason reads an OPTIONAL moderation reason from the request body ({"reason":"..."}) sent when a mod/admin deletes someone else's content fr
apps/api/internal/patch/handler/handler.go:410
↓ 2 callers
Function
parseDocDate
parseDocDate tolerantly parses a doc's display date (e.g. "2025-6-18"). Unparseable values return the zero time so they sort last.
apps/api/internal/doc/service/service.go:140
↓ 2 callers
Function
parseGalgameMultipart
parseGalgameMultipart is shared between SubmitGalgame and PatchGalgameDraft. Returns the JSON body, the file name / bytes / mime if present, or an App
apps/api/internal/patch/handler/handler.go:1220
↓ 2 callers
Function
parseRef
parseRef splits a "type:id" moemoepoint ref (e.g. "comment:42") into its kind and numeric id; id is 0 when absent / unparseable.
apps/api/internal/user/service/service.go:347
↓ 2 callers
Function
parseSet
(csv string)
apps/api/cmd/migrate/main.go:111
↓ 2 callers
Function
payloadString
payloadString pulls a scalar string field out of the Wiki message payload JSON. Returns "" when missing or wrong-typed (no error — payload fields are
apps/api/internal/infrastructure/cron/wiki_sync.go:264
↓ 2 callers
Function
prepareAuthorizeUrl
( opts: AuthorizeOptions = {} )
apps/web/app/shared/utils/pkce.ts:77
↓ 2 callers
Method
proxyUserOAuth
proxyUserOAuth is the shared helper for the display-layer proxies. Pulls access_token from session, forwards body + content-type to the OAuth endpoint
apps/api/internal/auth/handler/handler.go:196
↓ 2 callers
Function
putParts
( file: File, partSize: number, parts: InitPart[], baseCommittedBytes: number )
apps/web/app/composables/useResourceUpload.ts:194
↓ 2 callers
Function
renewSlidingSession
renewSlidingSession implements the rolling half of the session-timeout model: while the user is active it slides the cookie + Redis TTL forward, so a
apps/api/internal/middleware/auth.go:398
↓ 2 callers
Function
resolveAvatarUrl
( user: AvatarSource | null | undefined, variant?: '100' )
apps/web/app/shared/utils/resolveAvatarUrl.ts:46
↓ 2 callers
Function
reverseMessages
(m []model.ChatMessage)
apps/api/internal/chat/repository/repository.go:184
↓ 2 callers
Function
startOAuthLogin
( opts: AuthorizeOptions = {} )
apps/web/app/shared/utils/pkce.ts:120
↓ 2 callers
Function
toUrls
( src: PagedSource, rows: Record<string, unknown>[] )
apps/web/server/utils/kunSitemapSources.ts:104
↓ 2 callers
Function
truncate
(s string, n int)
apps/api/internal/middleware/auth.go:663
↓ 2 callers
Function
unionInts
unionInts merges several int slices into one deduped slice (order unimportant — used only for `WHERE id IN (...)` recompute targets).
apps/api/internal/admin/repository/repository.go:626
↓ 2 callers
Function
uploadTier
uploadTier resolves the caller's per-role upload allowance from the OAuth roles claim: admin/ren > moderator > creator > user. Each tier is distinct;
apps/api/internal/common/upload/handler.go:37
↓ 2 callers
Function
useResourceResumeUploads
(galgameId: number)
apps/web/app/composables/useResourceResumeUploads.ts:10
↓ 2 callers
Function
validateStruct
(s any)
apps/api/pkg/utils/validate.go:27
↓ 2 callers
Method
variantPath
(hash, variant string)
apps/api/pkg/imageclient/client.go:376
↓ 2 callers
Function
waitForRefreshedSession
waitForRefreshedSession is the lock-loser path. Another request holds the per-session refresh lock and is doing the OAuth round-trip; we poll Redis fo
apps/api/internal/middleware/auth.go:506
↓ 2 callers
Function
writeJSONResp
(w http.ResponseWriter, v any)
apps/api/pkg/userclient/client_test.go:202
↓ 2 callers
Function
writeMockJSON
(w http.ResponseWriter, v any)
apps/api/pkg/userclient/mock.go:116
← previous
next →
101–200 of 1,135, ranked by callers