MCPcopy
hub / github.com/usememos/memos / APIV1Service

Struct APIV1Service

server/router/api/v1/v1.go:22–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20const maxAPIRequestBytes = 256 << 20
21
22type APIV1Service struct {
23 v1pb.UnimplementedInstanceServiceServer
24 v1pb.UnimplementedAuthServiceServer
25 v1pb.UnimplementedUserServiceServer
26 v1pb.UnimplementedMemoServiceServer
27 v1pb.UnimplementedAttachmentServiceServer
28 v1pb.UnimplementedAIServiceServer
29 v1pb.UnimplementedShortcutServiceServer
30 v1pb.UnimplementedIdentityProviderServiceServer
31
32 Secret string
33 Profile *profile.Profile
34 Store *store.Store
35 MarkdownService markdown.Service
36 SSEHub *SSEHub
37 NotificationEmailSender notification.EmailSender
38
39 // thumbnailSemaphore limits concurrent thumbnail generation to prevent memory exhaustion
40 thumbnailSemaphore *semaphore.Weighted
41 imageProcessingSemaphore *semaphore.Weighted
42
43 // instanceStatsCache memoizes GetInstanceStats results for instanceStatsCacheTTL.
44 instanceStatsCache instanceStatsCache
45}
46
47func NewAPIV1Service(secret string, profile *profile.Profile, store *store.Store) *APIV1Service {
48 markdownService := markdown.NewService(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected