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
↓ 448 callers
Method
Error
()
apps/api/internal/galgame/client/client.go:37
↓ 133 callers
Method
Set
Set replaces or adds a user.
apps/api/pkg/userclient/mock.go:52
↓ 42 callers
Method
Error
()
apps/api/pkg/errors/errors.go:11
↓ 40 callers
Method
Create
(ctx context.Context, userID int, req dto.DocCreateRequest)
apps/api/internal/doc/service/service.go:334
↓ 37 callers
Method
Do
(req *http.Request)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:179
↓ 35 callers
Method
Delete
(id int)
apps/api/internal/doc/service/service.go:436
↓ 32 callers
Method
get
─── Generic GET ───────────────────────────────────── get sends a GET request, parses the {code, message, data} envelope and unmarshals data into out.
apps/api/internal/galgame/client/client.go:214
↓ 30 callers
Function
getIDParam
(c fiber.Ctx, name string)
apps/api/internal/patch/handler/handler.go:42
↓ 29 callers
Method
Put
(value []byte)
apps/api/internal/infrastructure/markdown/markdown.go:82
↓ 26 callers
Method
Scan
(value any)
apps/api/internal/patch/model/model.go:45
↓ 23 callers
Method
Offset
()
apps/api/pkg/utils/pagination.go:10
↓ 21 callers
Function
getEnv
(key, fallback string)
apps/api/pkg/config/config.go:172
↓ 18 callers
Function
cancel
()
apps/web/app/composables/useResourceUpload.ts:397
↓ 16 callers
Method
Request
Request sends an HTTP request to the Fiber app and returns the response
apps/api/internal/testutil/testutil.go:86
↓ 13 callers
Method
Award
Award adjusts the user's unified balance and syncs the local cache. Best-effort + non-blocking: it must be called OUTSIDE any DB transaction and AFTE
apps/api/pkg/moemoepoint/awarder.go:30
↓ 13 callers
Method
GalgameBatch
GalgameBatch calls /galgame/batch?ids=1,2,3 to fetch lightweight galgame info in bulk. contentLimit is the NSFW filter — pass "sfw" / "nsfw" / "all"
apps/api/internal/galgame/client/client.go:442
↓ 13 callers
Method
Update
(id int, req dto.DocUpdateRequest)
apps/api/internal/doc/service/service.go:375
↓ 13 callers
Method
Users
Users fetches user briefs by id. Cache hits skip the network. Misses are deduped, sharded into chunks of 100, coalesced via singleflight, and the resu
apps/api/pkg/userclient/client.go:100
↓ 12 callers
Function
New
(code int, message string, httpStatus int)
apps/api/pkg/errors/errors.go:15
↓ 12 callers
Function
truncate
(s string, n int)
apps/api/internal/galgame/client/client.go:838
↓ 12 callers
Function
writeWikiResult
writeWikiResult is the shared result -> response mapping for both modes. Wiki business errors (e.g. 80008 image quota, 60002 review rejected, 40300 fo
apps/api/internal/patch/handler/handler.go:922
↓ 11 callers
Method
Init
Init POST /api/upload/init — start an upload; the artifact service decides single-PUT vs multipart and returns the presigned URL(s).
apps/api/internal/common/upload/handler.go:52
↓ 11 callers
Function
getUID
(c fiber.Ctx)
apps/api/internal/user/handler/handler.go:48
↓ 10 callers
Function
New
(cfg Config)
apps/api/pkg/userclient/client.go:76
↓ 9 callers
Method
Status
Status returns HTTPResponse.Status
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:724
↓ 9 callers
Function
qs
(q?: Q)
apps/web/app/composables/useGalgameEdit.ts:134
↓ 8 callers
Method
applyEditors
(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:619
↓ 8 callers
Function
writeBatchResp
(w http.ResponseWriter, users []Brief, notFound []uint)
apps/api/pkg/userclient/client_test.go:192
↓ 7 callers
Method
GetCommentByID
(id int)
apps/api/internal/patch/repository/repository.go:216
↓ 7 callers
Method
GetResourceByID
(id int)
apps/api/internal/patch/repository/repository.go:307
↓ 7 callers
Method
gatePatchByContentLimit
gatePatchByContentLimit checks whether `patchID`'s owning galgame passes the caller's content_limit filter. Returns true → handler may serve the data;
apps/api/internal/patch/handler/handler.go:64
↓ 6 callers
Method
ContentType
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:740
↓ 6 callers
Method
UpdateCount
(patchID int, field string, delta int)
apps/api/internal/patch/repository/repository.go:454
↓ 6 callers
Function
atoi
atoi is a panic-free helper for already-regex-validated digit strings.
apps/api/pkg/utils/release_date.go:140
↓ 6 callers
Method
createDedupMessage
createDedupMessage inserts a user_message unless a matching one already exists. redeliverAfterRead controls the dedup window: - false: dedup against A
apps/api/internal/patch/service/service.go:1537
↓ 6 callers
Function
getIDParam
(c fiber.Ctx, name string)
apps/api/internal/admin/handler/handler.go:111
↓ 6 callers
Function
newTestClient
(srv *httptest.Server)
apps/api/pkg/moemoepoint/client_test.go:11
↓ 6 callers
Method
ownedPatchIDsSubquery
ownedPatchIDsSubquery is the `id IN (patches owned by U)` building block, reused across the owned-patch collateral counts and the S3-key collection.
apps/api/internal/admin/repository/repository.go:348
↓ 5 callers
Method
Adjust
Adjust applies a signed moemoepoint delta to a user. Returns the resulting authoritative balance. A non-zero business code (16002/16003/16004/…) or an
apps/api/pkg/moemoepoint/client.go:84
↓ 5 callers
Method
Configured
Configured reports whether the client can talk to the artifact service.
apps/api/pkg/artifactclient/client.go:155
↓ 5 callers
Method
CreateLog
(actorID int, action string, data any)
apps/api/internal/patch/service/service.go:43
↓ 5 callers
Method
CreateTestSession
CreateTestSession creates a Redis session and returns the cookie value. roles is the OAuth roles set; pass e.g. "admin" / "moderator" to grant privile
apps/api/internal/testutil/testutil.go:60
↓ 5 callers
Method
DB
DB exposes the underlying *gorm.DB so a few thin "no-business-logic" handler endpoints (the wiki messages read-state shims) can do single-table reads
apps/api/internal/patch/service/service.go:393
↓ 5 callers
Method
DeleteObject
DeleteObject deletes an object. Returns nil even if the object does not exist (idempotent).
apps/api/internal/infrastructure/storage/s3.go:129
↓ 5 callers
Method
Error
()
apps/api/pkg/userclient/client.go:312
↓ 5 callers
Method
Ready
Ready reports whether the client has been configured. When not configured, all operations return ErrNotConfigured.
apps/api/internal/infrastructure/storage/s3.go:87
↓ 5 callers
Method
User
User is a single-id convenience wrapper. Returns (nil, nil) when the id is not present.
apps/api/pkg/userclient/client.go:162
↓ 5 callers
Function
countOrLog
countOrLog runs a Count and, on a DB error, LOGS it instead of silently returning a false 0 (audit F074). These four profile aggregates are display-on
apps/api/internal/user/repository/repository.go:37
↓ 5 callers
Method
effectiveBanner
effectiveBanner prefers the image_service-derived URL (from the hash) and falls back to the legacy static banner URL.
apps/api/internal/doc/service/service.go:48
↓ 5 callers
Function
mapErr
mapErr turns a non-success artifact response into a sentinel (where callers branch) or a descriptive error.
apps/api/pkg/artifactclient/client.go:277
↓ 5 callers
Function
request
( endpoint: string, options: ApiOptions = {} )
apps/web/app/composables/useApi.ts:167
↓ 5 callers
Method
resolveRoomForMember
─── helpers ──────────────────────────────────────── resolveRoomForMember fetches the room and confirms userID is a member, else returns an error.
apps/api/internal/chat/service/service.go:203
↓ 4 callers
Method
Configured
Configured reports whether the client has both a base URL and credentials — i.e. Upload / ReferencePing can actually reach image_service. Lets callers
apps/api/pkg/imageclient/client.go:217
↓ 4 callers
Method
Delete
Delete soft-deletes an artifact (GC physically reclaims it after the TTL).
apps/api/pkg/artifactclient/client.go:259
↓ 4 callers
Method
GetAll
GetAll returns docs newest-first by the frontmatter date string (lexical == chronological for ISO), slug ASC to break ties. onlyPublished restricts to
apps/api/internal/doc/repository/repository.go:21
↓ 4 callers
Method
GetGalgame
GetGalgame calls /galgame/:gid; used to enrich detail pages. contentLimit is the NSFW filter — pass "sfw" / "nsfw" / "all" to apply, or "" to omit th
apps/api/internal/galgame/client/client.go:403
↓ 4 callers
Method
GetMessage
GetMessage fetches a single message by ID.
apps/api/internal/chat/repository/repository.go:250
↓ 4 callers
Method
GetPatchByID
(id int)
apps/api/internal/patch/repository/repository.go:27
↓ 4 callers
Method
GetPatchDetail
GetPatchDetail returns the local patch row, or gorm.ErrRecordNotFound when moyu has none. Like GetPatch it does NOT materialize on view (see GetPatch)
apps/api/internal/patch/service/service.go:255
↓ 4 callers
Method
Invalidate
Invalidate drops both positive and negative cache entries for a single id.
apps/api/pkg/userclient/client.go:212
↓ 4 callers
Method
StatusCode
StatusCode returns HTTPResponse.StatusCode
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:732
↓ 4 callers
Method
TableName
()
apps/api/internal/patch/model/model.go:154
↓ 4 callers
Method
TouchResourceUpdateTime
TouchResourceUpdateTime bumps a galgame's patch.resource_update_time to now — the moyu "最近更新" sort key. Called after a successful Wiki galgame-info ed
apps/api/internal/patch/service/service.go:400
↓ 4 callers
Function
applyGalgame
applyGalgame merges the Wiki galgame info into a card.
apps/api/internal/galgame/enricher/enricher.go:523
↓ 4 callers
Method
attachResourceUsers
attachResourceUsers / attachCommentUsers do the same id-collect → batch → stamp dance for the various list endpoints below. Best-effort: on OAuth erro
apps/api/internal/common/handler.go:45
↓ 4 callers
Function
complete
( artifactUuid: string, parts?: { part_number: number; etag: string }[] )
apps/web/app/composables/useResourceUpload.ts:240
↓ 4 callers
Function
deleteOAuthCookie
(name: string)
apps/web/app/shared/utils/pkce.ts:53
↓ 4 callers
Function
displayGalgameName
displayGalgameName picks the first non-empty translation for the local notification body. Falls back to the integer id so the message never reads "您提交
apps/api/internal/infrastructure/cron/wiki_sync.go:281
↓ 4 callers
Function
joinInts
─── helpers ─────────────────────────────────────────
apps/api/internal/galgame/client/client.go:830
↓ 4 callers
Function
read
()
apps/web/app/composables/useResourceResumeUploads.ts:13
↓ 4 callers
Function
readBody
(t *testing.T, resp *http.Response)
apps/api/pkg/response/response_test.go:107
↓ 4 callers
Function
refreshOAuthToken
(ctx context.Context, rdb *redis.Client, oauthCfg config.OAuthConfig, sessionID string, session *SessionData)
apps/api/internal/middleware/auth.go:531
↓ 4 callers
Function
resolveUser
resolveUser turns a single OAuth user id into a PatchUser brief (name / avatar / roles) via the short-TTL userclient cache. Returns nil for a nil clie
apps/api/internal/galgame/enricher/enricher.go:200
↓ 4 callers
Function
setupApp
()
apps/api/pkg/response/response_test.go:18
↓ 4 callers
Function
useApi
()
apps/web/app/composables/useApi.ts:29
↓ 3 callers
Method
AddMember
AddMember joins a room; idempotent if already a member.
apps/api/internal/chat/repository/repository.go:85
↓ 3 callers
Method
Balance
Balance reads a user's current authoritative balance (GET /users/:id/moemoepoint). Used by the one-time cache-seed cmd.
apps/api/pkg/moemoepoint/client.go:120
↓ 3 callers
Method
CheckGalgameByVndbID
CheckGalgameByVndbID calls /galgame/check?vndb_id=xxx and returns (exists, galgame_id). Used as a pre-check for POST /api/patch.
apps/api/internal/galgame/client/client.go:418
↓ 3 callers
Method
FindByID
===== User Info =====
apps/api/internal/user/repository/repository.go:23
↓ 3 callers
Method
GetBool
GetBool reports whether the setting is enabled. A missing key → false (settings default off). A read error also yields false: failing safe means an ou
apps/api/internal/setting/service/service.go:35
↓ 3 callers
Method
GetByID
(id int)
apps/api/internal/doc/repository/repository.go:37
↓ 3 callers
Method
GetBySlug
(slug string)
apps/api/internal/doc/repository/repository.go:31
↓ 3 callers
Function
GetUser
(c fiber.Ctx)
apps/api/internal/middleware/auth.go:263
↓ 3 callers
Function
HasAnyRole
HasAnyRole reports whether the current request's roles set contains any of the listed roles. Pass nothing to require "at least logged in".
apps/api/internal/middleware/auth.go:313
↓ 3 callers
Method
Log
Log reads a page of a user's moemoepoint ledger (GET /users/:id/moemoepoint/log). Cursor pagination: pass beforeID=0 for the newest page, then the las
apps/api/pkg/moemoepoint/client.go:176
↓ 3 callers
Method
Proxy
Proxy relays a GET / JSON-write to the Wiki Service. pathAndQuery is the Wiki path WITH its leading slash and any query string, e.g. "/galgame/8329/r
apps/api/internal/galgame/client/editing.go:35
↓ 3 callers
Method
RecalculatePatchAggregates
===== Aggregate Updates =====
apps/api/internal/patch/repository/repository.go:428
↓ 3 callers
Method
Upload
Upload sends one image to image_service. - body / filename / mime describe the file (mime may be "" — the server sniffs by magic number anyway). - pr
apps/api/pkg/imageclient/client.go:117
↓ 3 callers
Method
Value
()
apps/api/internal/patch/model/model.go:72
↓ 3 callers
Function
apiGet
(path: string)
apps/web/server/utils/kunSitemapSources.ts:92
↓ 3 callers
Method
attachPatchSummaries
attachPatchSummaries fills the `Patch` field on every comment / resource row in one Wiki batch call, avoiding an N+1 over the page. Either slice may b
apps/api/internal/common/handler.go:298
↓ 3 callers
Function
attachUsersToResources
attachUsersToResources batch-fetches publisher briefs from OAuth and stamps the User field on each resource row.
apps/api/internal/patch/service/service.go:870
↓ 3 callers
Function
baseCard
baseCard builds the local-field portion of the card from a patch (Wiki-owned fields like Name/Banner start empty).
apps/api/internal/galgame/enricher/enricher.go:495
↓ 3 callers
Function
briefToPatchUser
briefToPatchUser is the small adapter from OAuth /users/batch shape to the embedded PatchUser wire shape ({id, name, avatar}).
apps/api/internal/patch/service/service.go:609
↓ 3 callers
Function
calendarContentLimits
─── Galgame release calendar (发售月表) ─────────────── Thin moyu-side wrapper over the wiki calendar endpoints (docs/galgame_wiki/01-galgame.md §发售月历). T
apps/api/internal/common/handler.go:892
↓ 3 callers
Function
docID
(c fiber.Ctx)
apps/api/internal/doc/handler/handler.go:27
↓ 3 callers
Method
effectiveAuthorAvatar
effectiveAuthorAvatar resolves a user brief to a renderable avatar URL, preferring the image_service hash (the post-OAuth-migration form; "100" varian
apps/api/internal/doc/service/service.go:62
↓ 3 callers
Method
enrichCalendarItems
enrichCalendarItems collects ids → looks up which moyu has a patch for → builds the has_patch-stamped cards, then stamps is_favorite for the logged-in
apps/api/internal/common/handler.go:927
↓ 3 callers
Method
ensureCanPublishGalgame
===== Patch CRUD ===== ensureCanPublishGalgame enforces the "creator_only" publish toggle: when on, only the trusted-publisher set — creators / modera
apps/api/internal/patch/handler/handler.go:84
↓ 3 callers
Method
ensureLocalPatch
ensureLocalPatch reads the local patch row, lazily INSERTing a zero-stat stub when it's missing. It is called from the INTERACTION paths (ToggleFavori
apps/api/internal/patch/service/service.go:271
next →
1–100 of 1,135, ranked by callers