Documentation
¶
Overview ¶
Package v1 - duplicate detection handlers for P2-C002.
Package v1 - knowledge graph handlers for P3-C001.
Package v1 - review system handlers for P3-C002.
Index ¶
- Constants
- Variables
- func ExtractActivityIDFromName(name string) (int32, error)
- func ExtractAttachmentUIDFromName(name string) (string, error)
- func ExtractIdentityProviderIDFromName(name string) (int32, error)
- func ExtractInboxIDFromName(name string) (int32, error)
- func ExtractInstanceSettingKeyFromName(name string) (string, error)
- func ExtractMemoReactionIDFromName(name string) (string, int32, error)
- func ExtractMemoUIDFromName(name string) (string, error)
- func ExtractNotificationIDFromName(name string) (int32, error)
- func ExtractUserIDAndSettingKeyFromName(name string) (int32, string, error)
- func ExtractUserIDFromName(name string) (int32, error)
- func GetNameParentTokens(name string, tokenPrefixes ...string) ([]string, error)
- func IsPublicMethod(procedure string) bool
- func SaveAttachmentBlob(ctx context.Context, profile *profile.Profile, stores *store.Store, ...) error
- func SetResponseHeader(ctx context.Context, key, value string) error
- func WithHeaderCarrier(ctx context.Context) context.Context
- type AIService
- func (s *AIService) AddContextSeparator(ctx context.Context, req *v1pb.AddContextSeparatorRequest) (*emptypb.Empty, error)
- func (s *AIService) Chat(req *v1pb.ChatRequest, stream v1pb.AIService_ChatServer) error
- func (s *AIService) ClearConversationMessages(ctx context.Context, req *v1pb.ClearConversationMessagesRequest) (*emptypb.Empty, error)
- func (s *AIService) CreateAIConversation(ctx context.Context, req *v1pb.CreateAIConversationRequest) (*v1pb.AIConversation, error)
- func (s *AIService) DeleteAIConversation(ctx context.Context, req *v1pb.DeleteAIConversationRequest) (*emptypb.Empty, error)
- func (s *AIService) DetectDuplicates(ctx context.Context, req *v1pb.DetectDuplicatesRequest) (*v1pb.DetectDuplicatesResponse, error)
- func (s *AIService) GetAIConversation(ctx context.Context, req *v1pb.GetAIConversationRequest) (*v1pb.AIConversation, error)
- func (s *AIService) GetDueReviews(ctx context.Context, req *v1pb.GetDueReviewsRequest) (*v1pb.GetDueReviewsResponse, error)
- func (s *AIService) GetKnowledgeGraph(ctx context.Context, req *v1pb.GetKnowledgeGraphRequest) (*v1pb.GetKnowledgeGraphResponse, error)
- func (s *AIService) GetRelatedMemos(ctx context.Context, req *v1pb.GetRelatedMemosRequest) (*v1pb.GetRelatedMemosResponse, error)
- func (s *AIService) GetReviewStats(ctx context.Context, req *v1pb.GetReviewStatsRequest) (*v1pb.GetReviewStatsResponse, error)
- func (s *AIService) IsEnabled() bool
- func (s *AIService) IsLLMEnabled() bool
- func (s *AIService) LinkMemos(ctx context.Context, req *v1pb.LinkMemosRequest) (*v1pb.LinkMemosResponse, error)
- func (s *AIService) ListAIConversations(ctx context.Context, _ *v1pb.ListAIConversationsRequest) (*v1pb.ListAIConversationsResponse, error)
- func (s *AIService) ListMessages(ctx context.Context, req *v1pb.ListMessagesRequest) (*v1pb.ListMessagesResponse, error)
- func (s *AIService) MergeMemos(ctx context.Context, req *v1pb.MergeMemosRequest) (*v1pb.MergeMemosResponse, error)
- func (s *AIService) RecordReview(ctx context.Context, req *v1pb.RecordReviewRequest) (*emptypb.Empty, error)
- func (s *AIService) SemanticSearch(ctx context.Context, req *v1pb.SemanticSearchRequest) (*v1pb.SemanticSearchResponse, error)
- func (s *AIService) StopChat(ctx context.Context, req *v1pb.StopChatRequest) (*emptypb.Empty, error)
- func (s *AIService) SuggestTags(ctx context.Context, req *v1pb.SuggestTagsRequest) (*v1pb.SuggestTagsResponse, error)
- func (s *AIService) UpdateAIConversation(ctx context.Context, req *v1pb.UpdateAIConversationRequest) (*v1pb.AIConversation, error)
- type APIV1Service
- func (s *APIV1Service) Check(ctx context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
- func (s *APIV1Service) CreateAttachment(ctx context.Context, request *v1pb.CreateAttachmentRequest) (*v1pb.Attachment, error)
- func (s *APIV1Service) CreateIdentityProvider(ctx context.Context, request *v1pb.CreateIdentityProviderRequest) (*v1pb.IdentityProvider, error)
- func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoRequest) (*v1pb.Memo, error)
- func (s *APIV1Service) CreateMemoComment(ctx context.Context, request *v1pb.CreateMemoCommentRequest) (*v1pb.Memo, error)
- func (s *APIV1Service) CreatePersonalAccessToken(ctx context.Context, request *v1pb.CreatePersonalAccessTokenRequest) (*v1pb.CreatePersonalAccessTokenResponse, error)
- func (s *APIV1Service) CreateShortcut(ctx context.Context, request *v1pb.CreateShortcutRequest) (*v1pb.Shortcut, error)
- func (s *APIV1Service) CreateUser(ctx context.Context, request *v1pb.CreateUserRequest) (*v1pb.User, error)
- func (s *APIV1Service) CreateUserWebhook(ctx context.Context, request *v1pb.CreateUserWebhookRequest) (*v1pb.UserWebhook, error)
- func (s *APIV1Service) DeleteAttachment(ctx context.Context, request *v1pb.DeleteAttachmentRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteIdentityProvider(ctx context.Context, request *v1pb.DeleteIdentityProviderRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteMemo(ctx context.Context, request *v1pb.DeleteMemoRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteMemoReaction(ctx context.Context, request *v1pb.DeleteMemoReactionRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeletePersonalAccessToken(ctx context.Context, request *v1pb.DeletePersonalAccessTokenRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteShortcut(ctx context.Context, request *v1pb.DeleteShortcutRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteUser(ctx context.Context, request *v1pb.DeleteUserRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteUserNotification(ctx context.Context, request *v1pb.DeleteUserNotificationRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DeleteUserWebhook(ctx context.Context, request *v1pb.DeleteUserWebhookRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) DispatchMemoCreatedWebhook(ctx context.Context, memo *v1pb.Memo) error
- func (s *APIV1Service) DispatchMemoDeletedWebhook(ctx context.Context, memo *v1pb.Memo) error
- func (s *APIV1Service) DispatchMemoUpdatedWebhook(ctx context.Context, memo *v1pb.Memo) error
- func (s *APIV1Service) GetActivity(ctx context.Context, request *v1pb.GetActivityRequest) (*v1pb.Activity, error)
- func (s *APIV1Service) GetAttachment(ctx context.Context, request *v1pb.GetAttachmentRequest) (*v1pb.Attachment, error)
- func (s *APIV1Service) GetAttachmentBlob(attachment *store.Attachment) ([]byte, error)
- func (s *APIV1Service) GetCurrentUser(ctx context.Context, _ *v1pb.GetCurrentUserRequest) (*v1pb.GetCurrentUserResponse, error)
- func (s *APIV1Service) GetIdentityProvider(ctx context.Context, request *v1pb.GetIdentityProviderRequest) (*v1pb.IdentityProvider, error)
- func (s *APIV1Service) GetInstanceOwner(ctx context.Context) (*v1pb.User, error)
- func (s *APIV1Service) GetInstanceProfile(ctx context.Context, _ *v1pb.GetInstanceProfileRequest) (*v1pb.InstanceProfile, error)
- func (s *APIV1Service) GetInstanceSetting(ctx context.Context, request *v1pb.GetInstanceSettingRequest) (*v1pb.InstanceSetting, error)
- func (s *APIV1Service) GetMemo(ctx context.Context, request *v1pb.GetMemoRequest) (*v1pb.Memo, error)
- func (s *APIV1Service) GetMetricsOverview(c echo.Context) error
- func (s *APIV1Service) GetRelatedMemos(ctx context.Context, request *v1pb.GetRelatedMemosRequest) (*v1pb.GetRelatedMemosResponse, error)
- func (s *APIV1Service) GetShortcut(ctx context.Context, request *v1pb.GetShortcutRequest) (*v1pb.Shortcut, error)
- func (s *APIV1Service) GetUser(ctx context.Context, request *v1pb.GetUserRequest) (*v1pb.User, error)
- func (s *APIV1Service) GetUserSetting(ctx context.Context, request *v1pb.GetUserSettingRequest) (*v1pb.UserSetting, error)
- func (s *APIV1Service) GetUserStats(ctx context.Context, request *v1pb.GetUserStatsRequest) (*v1pb.UserStats, error)
- func (s *APIV1Service) ListActivities(ctx context.Context, request *v1pb.ListActivitiesRequest) (*v1pb.ListActivitiesResponse, error)
- func (s *APIV1Service) ListAllUserStats(ctx context.Context, _ *v1pb.ListAllUserStatsRequest) (*v1pb.ListAllUserStatsResponse, error)
- func (s *APIV1Service) ListAttachments(ctx context.Context, request *v1pb.ListAttachmentsRequest) (*v1pb.ListAttachmentsResponse, error)
- func (s *APIV1Service) ListIdentityProviders(ctx context.Context, _ *v1pb.ListIdentityProvidersRequest) (*v1pb.ListIdentityProvidersResponse, error)
- func (s *APIV1Service) ListMemoAttachments(ctx context.Context, request *v1pb.ListMemoAttachmentsRequest) (*v1pb.ListMemoAttachmentsResponse, error)
- func (s *APIV1Service) ListMemoComments(ctx context.Context, request *v1pb.ListMemoCommentsRequest) (*v1pb.ListMemoCommentsResponse, error)
- func (s *APIV1Service) ListMemoReactions(ctx context.Context, request *v1pb.ListMemoReactionsRequest) (*v1pb.ListMemoReactionsResponse, error)
- func (s *APIV1Service) ListMemoRelations(ctx context.Context, request *v1pb.ListMemoRelationsRequest) (*v1pb.ListMemoRelationsResponse, error)
- func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosRequest) (*v1pb.ListMemosResponse, error)
- func (s *APIV1Service) ListPersonalAccessTokens(ctx context.Context, request *v1pb.ListPersonalAccessTokensRequest) (*v1pb.ListPersonalAccessTokensResponse, error)
- func (s *APIV1Service) ListShortcuts(ctx context.Context, request *v1pb.ListShortcutsRequest) (*v1pb.ListShortcutsResponse, error)
- func (s *APIV1Service) ListUserNotifications(ctx context.Context, request *v1pb.ListUserNotificationsRequest) (*v1pb.ListUserNotificationsResponse, error)
- func (s *APIV1Service) ListUserSettings(ctx context.Context, request *v1pb.ListUserSettingsRequest) (*v1pb.ListUserSettingsResponse, error)
- func (s *APIV1Service) ListUserWebhooks(ctx context.Context, request *v1pb.ListUserWebhooksRequest) (*v1pb.ListUserWebhooksResponse, error)
- func (s *APIV1Service) ListUsers(ctx context.Context, request *v1pb.ListUsersRequest) (*v1pb.ListUsersResponse, error)
- func (s *APIV1Service) RefreshToken(ctx context.Context, _ *v1pb.RefreshTokenRequest) (*v1pb.RefreshTokenResponse, error)
- func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Echo) error
- func (s *APIV1Service) SearchWithHighlight(ctx context.Context, request *v1pb.SearchWithHighlightRequest) (*v1pb.SearchWithHighlightResponse, error)
- func (s *APIV1Service) SetMemoAttachments(ctx context.Context, request *v1pb.SetMemoAttachmentsRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) SetMemoRelations(ctx context.Context, request *v1pb.SetMemoRelationsRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) SignIn(ctx context.Context, request *v1pb.SignInRequest) (*v1pb.SignInResponse, error)
- func (s *APIV1Service) SignOut(ctx context.Context, _ *v1pb.SignOutRequest) (*emptypb.Empty, error)
- func (s *APIV1Service) UpdateAttachment(ctx context.Context, request *v1pb.UpdateAttachmentRequest) (*v1pb.Attachment, error)
- func (s *APIV1Service) UpdateIdentityProvider(ctx context.Context, request *v1pb.UpdateIdentityProviderRequest) (*v1pb.IdentityProvider, error)
- func (s *APIV1Service) UpdateInstanceSetting(ctx context.Context, request *v1pb.UpdateInstanceSettingRequest) (*v1pb.InstanceSetting, error)
- func (s *APIV1Service) UpdateMemo(ctx context.Context, request *v1pb.UpdateMemoRequest) (*v1pb.Memo, error)
- func (s *APIV1Service) UpdateShortcut(ctx context.Context, request *v1pb.UpdateShortcutRequest) (*v1pb.Shortcut, error)
- func (s *APIV1Service) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRequest) (*v1pb.User, error)
- func (s *APIV1Service) UpdateUserNotification(ctx context.Context, request *v1pb.UpdateUserNotificationRequest) (*v1pb.UserNotification, error)
- func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.UpdateUserSettingRequest) (*v1pb.UserSetting, error)
- func (s *APIV1Service) UpdateUserWebhook(ctx context.Context, request *v1pb.UpdateUserWebhookRequest) (*v1pb.UserWebhook, error)
- func (s *APIV1Service) UpsertMemoReaction(ctx context.Context, request *v1pb.UpsertMemoReactionRequest) (*v1pb.Reaction, error)
- type AuthInterceptor
- type ConnectServiceHandler
- func (s *ConnectServiceHandler) AddContextSeparator(ctx context.Context, req *connect.Request[v1pb.AddContextSeparatorRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) BatchCreateSchedules(ctx context.Context, req *connect.Request[v1pb.BatchCreateSchedulesRequest]) (*connect.Response[v1pb.BatchCreateSchedulesResponse], error)
- func (s *ConnectServiceHandler) BatchParseSchedule(ctx context.Context, req *connect.Request[v1pb.BatchParseScheduleRequest]) (*connect.Response[v1pb.BatchParseScheduleResponse], error)
- func (s *ConnectServiceHandler) Chat(ctx context.Context, req *connect.Request[v1pb.ChatRequest], ...) error
- func (s *ConnectServiceHandler) CheckConflict(ctx context.Context, req *connect.Request[v1pb.CheckConflictRequest]) (*connect.Response[v1pb.CheckConflictResponse], error)
- func (s *ConnectServiceHandler) ClearConversationMessages(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) CreateAIConversation(ctx context.Context, req *connect.Request[v1pb.CreateAIConversationRequest]) (*connect.Response[v1pb.AIConversation], error)
- func (s *ConnectServiceHandler) CreateAttachment(ctx context.Context, req *connect.Request[v1pb.CreateAttachmentRequest]) (*connect.Response[v1pb.Attachment], error)
- func (s *ConnectServiceHandler) CreateIdentityProvider(ctx context.Context, req *connect.Request[v1pb.CreateIdentityProviderRequest]) (*connect.Response[v1pb.IdentityProvider], error)
- func (s *ConnectServiceHandler) CreateMemo(ctx context.Context, req *connect.Request[v1pb.CreateMemoRequest]) (*connect.Response[v1pb.Memo], error)
- func (s *ConnectServiceHandler) CreateMemoComment(ctx context.Context, req *connect.Request[v1pb.CreateMemoCommentRequest]) (*connect.Response[v1pb.Memo], error)
- func (s *ConnectServiceHandler) CreatePersonalAccessToken(ctx context.Context, ...) (*connect.Response[v1pb.CreatePersonalAccessTokenResponse], error)
- func (s *ConnectServiceHandler) CreateSchedule(ctx context.Context, req *connect.Request[v1pb.CreateScheduleRequest]) (*connect.Response[v1pb.Schedule], error)
- func (s *ConnectServiceHandler) CreateShortcut(ctx context.Context, req *connect.Request[v1pb.CreateShortcutRequest]) (*connect.Response[v1pb.Shortcut], error)
- func (s *ConnectServiceHandler) CreateUser(ctx context.Context, req *connect.Request[v1pb.CreateUserRequest]) (*connect.Response[v1pb.User], error)
- func (s *ConnectServiceHandler) CreateUserWebhook(ctx context.Context, req *connect.Request[v1pb.CreateUserWebhookRequest]) (*connect.Response[v1pb.UserWebhook], error)
- func (s *ConnectServiceHandler) DeleteAIConversation(ctx context.Context, req *connect.Request[v1pb.DeleteAIConversationRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteAttachment(ctx context.Context, req *connect.Request[v1pb.DeleteAttachmentRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteIdentityProvider(ctx context.Context, req *connect.Request[v1pb.DeleteIdentityProviderRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteMemo(ctx context.Context, req *connect.Request[v1pb.DeleteMemoRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteMemoReaction(ctx context.Context, req *connect.Request[v1pb.DeleteMemoReactionRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeletePersonalAccessToken(ctx context.Context, ...) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteSchedule(ctx context.Context, req *connect.Request[v1pb.DeleteScheduleRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteShortcut(ctx context.Context, req *connect.Request[v1pb.DeleteShortcutRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteUser(ctx context.Context, req *connect.Request[v1pb.DeleteUserRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteUserNotification(ctx context.Context, req *connect.Request[v1pb.DeleteUserNotificationRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DeleteUserWebhook(ctx context.Context, req *connect.Request[v1pb.DeleteUserWebhookRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) DetectDuplicates(ctx context.Context, req *connect.Request[v1pb.DetectDuplicatesRequest]) (*connect.Response[v1pb.DetectDuplicatesResponse], error)
- func (s *ConnectServiceHandler) GetAIConversation(ctx context.Context, req *connect.Request[v1pb.GetAIConversationRequest]) (*connect.Response[v1pb.AIConversation], error)
- func (s *ConnectServiceHandler) GetActivity(ctx context.Context, req *connect.Request[v1pb.GetActivityRequest]) (*connect.Response[v1pb.Activity], error)
- func (s *ConnectServiceHandler) GetAttachment(ctx context.Context, req *connect.Request[v1pb.GetAttachmentRequest]) (*connect.Response[v1pb.Attachment], error)
- func (s *ConnectServiceHandler) GetCurrentUser(ctx context.Context, req *connect.Request[v1pb.GetCurrentUserRequest]) (*connect.Response[v1pb.GetCurrentUserResponse], error)
- func (s *ConnectServiceHandler) GetDueReviews(ctx context.Context, req *connect.Request[v1pb.GetDueReviewsRequest]) (*connect.Response[v1pb.GetDueReviewsResponse], error)
- func (s *ConnectServiceHandler) GetIdentityProvider(ctx context.Context, req *connect.Request[v1pb.GetIdentityProviderRequest]) (*connect.Response[v1pb.IdentityProvider], error)
- func (s *ConnectServiceHandler) GetInstanceProfile(ctx context.Context, req *connect.Request[v1pb.GetInstanceProfileRequest]) (*connect.Response[v1pb.InstanceProfile], error)
- func (s *ConnectServiceHandler) GetInstanceSetting(ctx context.Context, req *connect.Request[v1pb.GetInstanceSettingRequest]) (*connect.Response[v1pb.InstanceSetting], error)
- func (s *ConnectServiceHandler) GetKnowledgeGraph(ctx context.Context, req *connect.Request[v1pb.GetKnowledgeGraphRequest]) (*connect.Response[v1pb.GetKnowledgeGraphResponse], error)
- func (s *ConnectServiceHandler) GetMemo(ctx context.Context, req *connect.Request[v1pb.GetMemoRequest]) (*connect.Response[v1pb.Memo], error)
- func (s *ConnectServiceHandler) GetParrotSelfCognition(ctx context.Context, req *connect.Request[v1pb.GetParrotSelfCognitionRequest]) (*connect.Response[v1pb.GetParrotSelfCognitionResponse], error)
- func (s *ConnectServiceHandler) GetRelatedMemos(ctx context.Context, req *connect.Request[v1pb.GetRelatedMemosRequest]) (*connect.Response[v1pb.GetRelatedMemosResponse], error)
- func (s *ConnectServiceHandler) GetReviewStats(ctx context.Context, req *connect.Request[v1pb.GetReviewStatsRequest]) (*connect.Response[v1pb.GetReviewStatsResponse], error)
- func (s *ConnectServiceHandler) GetSchedule(ctx context.Context, req *connect.Request[v1pb.GetScheduleRequest]) (*connect.Response[v1pb.Schedule], error)
- func (s *ConnectServiceHandler) GetShortcut(ctx context.Context, req *connect.Request[v1pb.GetShortcutRequest]) (*connect.Response[v1pb.Shortcut], error)
- func (s *ConnectServiceHandler) GetUser(ctx context.Context, req *connect.Request[v1pb.GetUserRequest]) (*connect.Response[v1pb.User], error)
- func (s *ConnectServiceHandler) GetUserSetting(ctx context.Context, req *connect.Request[v1pb.GetUserSettingRequest]) (*connect.Response[v1pb.UserSetting], error)
- func (s *ConnectServiceHandler) GetUserStats(ctx context.Context, req *connect.Request[v1pb.GetUserStatsRequest]) (*connect.Response[v1pb.UserStats], error)
- func (s *ConnectServiceHandler) LinkMemos(ctx context.Context, req *connect.Request[v1pb.LinkMemosRequest]) (*connect.Response[v1pb.LinkMemosResponse], error)
- func (s *ConnectServiceHandler) ListAIConversations(ctx context.Context, req *connect.Request[v1pb.ListAIConversationsRequest]) (*connect.Response[v1pb.ListAIConversationsResponse], error)
- func (s *ConnectServiceHandler) ListActivities(ctx context.Context, req *connect.Request[v1pb.ListActivitiesRequest]) (*connect.Response[v1pb.ListActivitiesResponse], error)
- func (s *ConnectServiceHandler) ListAllUserStats(ctx context.Context, req *connect.Request[v1pb.ListAllUserStatsRequest]) (*connect.Response[v1pb.ListAllUserStatsResponse], error)
- func (s *ConnectServiceHandler) ListAttachments(ctx context.Context, req *connect.Request[v1pb.ListAttachmentsRequest]) (*connect.Response[v1pb.ListAttachmentsResponse], error)
- func (s *ConnectServiceHandler) ListIdentityProviders(ctx context.Context, req *connect.Request[v1pb.ListIdentityProvidersRequest]) (*connect.Response[v1pb.ListIdentityProvidersResponse], error)
- func (s *ConnectServiceHandler) ListMemoAttachments(ctx context.Context, req *connect.Request[v1pb.ListMemoAttachmentsRequest]) (*connect.Response[v1pb.ListMemoAttachmentsResponse], error)
- func (s *ConnectServiceHandler) ListMemoComments(ctx context.Context, req *connect.Request[v1pb.ListMemoCommentsRequest]) (*connect.Response[v1pb.ListMemoCommentsResponse], error)
- func (s *ConnectServiceHandler) ListMemoReactions(ctx context.Context, req *connect.Request[v1pb.ListMemoReactionsRequest]) (*connect.Response[v1pb.ListMemoReactionsResponse], error)
- func (s *ConnectServiceHandler) ListMemoRelations(ctx context.Context, req *connect.Request[v1pb.ListMemoRelationsRequest]) (*connect.Response[v1pb.ListMemoRelationsResponse], error)
- func (s *ConnectServiceHandler) ListMemos(ctx context.Context, req *connect.Request[v1pb.ListMemosRequest]) (*connect.Response[v1pb.ListMemosResponse], error)
- func (s *ConnectServiceHandler) ListMessages(ctx context.Context, req *connect.Request[v1pb.ListMessagesRequest]) (*connect.Response[v1pb.ListMessagesResponse], error)
- func (s *ConnectServiceHandler) ListParrots(ctx context.Context, req *connect.Request[v1pb.ListParrotsRequest]) (*connect.Response[v1pb.ListParrotsResponse], error)
- func (s *ConnectServiceHandler) ListPersonalAccessTokens(ctx context.Context, ...) (*connect.Response[v1pb.ListPersonalAccessTokensResponse], error)
- func (s *ConnectServiceHandler) ListSchedules(ctx context.Context, req *connect.Request[v1pb.ListSchedulesRequest]) (*connect.Response[v1pb.ListSchedulesResponse], error)
- func (s *ConnectServiceHandler) ListShortcuts(ctx context.Context, req *connect.Request[v1pb.ListShortcutsRequest]) (*connect.Response[v1pb.ListShortcutsResponse], error)
- func (s *ConnectServiceHandler) ListUserNotifications(ctx context.Context, req *connect.Request[v1pb.ListUserNotificationsRequest]) (*connect.Response[v1pb.ListUserNotificationsResponse], error)
- func (s *ConnectServiceHandler) ListUserSettings(ctx context.Context, req *connect.Request[v1pb.ListUserSettingsRequest]) (*connect.Response[v1pb.ListUserSettingsResponse], error)
- func (s *ConnectServiceHandler) ListUserWebhooks(ctx context.Context, req *connect.Request[v1pb.ListUserWebhooksRequest]) (*connect.Response[v1pb.ListUserWebhooksResponse], error)
- func (s *ConnectServiceHandler) ListUsers(ctx context.Context, req *connect.Request[v1pb.ListUsersRequest]) (*connect.Response[v1pb.ListUsersResponse], error)
- func (s *ConnectServiceHandler) MergeMemos(ctx context.Context, req *connect.Request[v1pb.MergeMemosRequest]) (*connect.Response[v1pb.MergeMemosResponse], error)
- func (s *ConnectServiceHandler) ParseAndCreateSchedule(ctx context.Context, req *connect.Request[v1pb.ParseAndCreateScheduleRequest]) (*connect.Response[v1pb.ParseAndCreateScheduleResponse], error)
- func (s *ConnectServiceHandler) PrecheckSchedule(ctx context.Context, req *connect.Request[v1pb.PrecheckScheduleRequest]) (*connect.Response[v1pb.PrecheckScheduleResponse], error)
- func (s *ConnectServiceHandler) RecordReview(ctx context.Context, req *connect.Request[v1pb.RecordReviewRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) RefreshToken(ctx context.Context, req *connect.Request[v1pb.RefreshTokenRequest]) (*connect.Response[v1pb.RefreshTokenResponse], error)
- func (s *ConnectServiceHandler) RegisterConnectHandlers(mux *http.ServeMux, opts ...connect.HandlerOption)
- func (s *ConnectServiceHandler) SearchWithHighlight(ctx context.Context, req *connect.Request[v1pb.SearchWithHighlightRequest]) (*connect.Response[v1pb.SearchWithHighlightResponse], error)
- func (s *ConnectServiceHandler) SemanticSearch(ctx context.Context, req *connect.Request[v1pb.SemanticSearchRequest]) (*connect.Response[v1pb.SemanticSearchResponse], error)
- func (s *ConnectServiceHandler) SetMemoAttachments(ctx context.Context, req *connect.Request[v1pb.SetMemoAttachmentsRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) SetMemoRelations(ctx context.Context, req *connect.Request[v1pb.SetMemoRelationsRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) SignIn(ctx context.Context, req *connect.Request[v1pb.SignInRequest]) (*connect.Response[v1pb.SignInResponse], error)
- func (s *ConnectServiceHandler) SignOut(ctx context.Context, req *connect.Request[v1pb.SignOutRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) StopChat(ctx context.Context, req *connect.Request[v1pb.StopChatRequest]) (*connect.Response[emptypb.Empty], error)
- func (s *ConnectServiceHandler) SuggestTags(ctx context.Context, req *connect.Request[v1pb.SuggestTagsRequest]) (*connect.Response[v1pb.SuggestTagsResponse], error)
- func (s *ConnectServiceHandler) UpdateAIConversation(ctx context.Context, req *connect.Request[v1pb.UpdateAIConversationRequest]) (*connect.Response[v1pb.AIConversation], error)
- func (s *ConnectServiceHandler) UpdateAttachment(ctx context.Context, req *connect.Request[v1pb.UpdateAttachmentRequest]) (*connect.Response[v1pb.Attachment], error)
- func (s *ConnectServiceHandler) UpdateIdentityProvider(ctx context.Context, req *connect.Request[v1pb.UpdateIdentityProviderRequest]) (*connect.Response[v1pb.IdentityProvider], error)
- func (s *ConnectServiceHandler) UpdateInstanceSetting(ctx context.Context, req *connect.Request[v1pb.UpdateInstanceSettingRequest]) (*connect.Response[v1pb.InstanceSetting], error)
- func (s *ConnectServiceHandler) UpdateMemo(ctx context.Context, req *connect.Request[v1pb.UpdateMemoRequest]) (*connect.Response[v1pb.Memo], error)
- func (s *ConnectServiceHandler) UpdateSchedule(ctx context.Context, req *connect.Request[v1pb.UpdateScheduleRequest]) (*connect.Response[v1pb.Schedule], error)
- func (s *ConnectServiceHandler) UpdateShortcut(ctx context.Context, req *connect.Request[v1pb.UpdateShortcutRequest]) (*connect.Response[v1pb.Shortcut], error)
- func (s *ConnectServiceHandler) UpdateUser(ctx context.Context, req *connect.Request[v1pb.UpdateUserRequest]) (*connect.Response[v1pb.User], error)
- func (s *ConnectServiceHandler) UpdateUserNotification(ctx context.Context, req *connect.Request[v1pb.UpdateUserNotificationRequest]) (*connect.Response[v1pb.UserNotification], error)
- func (s *ConnectServiceHandler) UpdateUserSetting(ctx context.Context, req *connect.Request[v1pb.UpdateUserSettingRequest]) (*connect.Response[v1pb.UserSetting], error)
- func (s *ConnectServiceHandler) UpdateUserWebhook(ctx context.Context, req *connect.Request[v1pb.UpdateUserWebhookRequest]) (*connect.Response[v1pb.UserWebhook], error)
- func (s *ConnectServiceHandler) UpsertMemoReaction(ctx context.Context, req *connect.Request[v1pb.UpsertMemoReactionRequest]) (*connect.Response[v1pb.Reaction], error)
- type HeaderCarrier
- type LoggingInterceptor
- func (*LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (*LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (in *LoggingInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type MetadataInterceptor
- func (*MetadataInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (*MetadataInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (*MetadataInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type MetricsOverviewResponse
- type RecoveryInterceptor
- func (*RecoveryInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (*RecoveryInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (in *RecoveryInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type ScheduleAgentService
- type ScheduleAgentServiceConnectHandler
- func (s *ScheduleAgentServiceConnectHandler) Chat(ctx context.Context, req *connect.Request[v1pb.ScheduleAgentChatRequest]) (*connect.Response[v1pb.ScheduleAgentChatResponse], error)
- func (s *ScheduleAgentServiceConnectHandler) ChatStream(ctx context.Context, req *connect.Request[v1pb.ScheduleAgentChatRequest], ...) error
- type ScheduleService
- func (s *ScheduleService) BatchCreateSchedules(ctx context.Context, req *v1pb.BatchCreateSchedulesRequest) (*v1pb.BatchCreateSchedulesResponse, error)
- func (s *ScheduleService) BatchParseSchedule(ctx context.Context, req *v1pb.BatchParseScheduleRequest) (*v1pb.BatchParseScheduleResponse, error)
- func (s *ScheduleService) CheckConflict(ctx context.Context, req *v1pb.CheckConflictRequest) (*v1pb.CheckConflictResponse, error)
- func (s *ScheduleService) CreateSchedule(ctx context.Context, req *v1pb.CreateScheduleRequest) (*v1pb.Schedule, error)
- func (s *ScheduleService) DeleteSchedule(ctx context.Context, req *v1pb.DeleteScheduleRequest) (*emptypb.Empty, error)
- func (s *ScheduleService) GetSchedule(ctx context.Context, req *v1pb.GetScheduleRequest) (*v1pb.Schedule, error)
- func (s *ScheduleService) ListSchedules(ctx context.Context, req *v1pb.ListSchedulesRequest) (*v1pb.ListSchedulesResponse, error)
- func (s *ScheduleService) ParseAndCreateSchedule(ctx context.Context, req *v1pb.ParseAndCreateScheduleRequest) (*v1pb.ParseAndCreateScheduleResponse, error)
- func (s *ScheduleService) PrecheckSchedule(ctx context.Context, req *v1pb.PrecheckScheduleRequest) (*v1pb.PrecheckScheduleResponse, error)
- func (s *ScheduleService) UpdateSchedule(ctx context.Context, req *v1pb.UpdateScheduleRequest) (*v1pb.Schedule, error)
Constants ¶
const ( // The upload memory buffer is 32 MiB. // It should be kept low, so RAM usage doesn't get out of control. // This is unrelated to maximum upload size limit, which is now set through system setting. MaxUploadBufferSizeBytes = 32 << 20 MebiByte = 1024 * 1024 // ThumbnailCacheFolder is the folder name where the thumbnail images are stored. ThumbnailCacheFolder = ".thumbnail_cache" )
const ( // DefaultPageSize is the default page size for requests. DefaultPageSize = 10 // MaxPageSize is the maximum page size for requests. MaxPageSize = 1000 )
const ( InstanceSettingNamePrefix = "instance/settings/" UserNamePrefix = "users/" MemoNamePrefix = "memos/" AttachmentNamePrefix = "attachments/" ReactionNamePrefix = "reactions/" InboxNamePrefix = "inboxes/" IdentityProviderNamePrefix = "identity-providers/" ActivityNamePrefix = "activities/" WebhookNamePrefix = "webhooks/" )
const DefaultHistoryRetention = 10
Default history retention count for router memory service.
const (
// DefaultTimezone is the default timezone for schedule operations.
DefaultTimezone = "Asia/Shanghai"
)
const MaxMessageLimit = 100
MaxMessageLimit is the maximum number of messages to return in a single request.
Variables ¶
var PublicMethods = map[string]struct{}{
"/memos.api.v1.AuthService/SignIn": {},
"/memos.api.v1.AuthService/RefreshToken": {},
"/memos.api.v1.InstanceService/GetInstanceProfile": {},
"/memos.api.v1.InstanceService/GetInstanceSetting": {},
"/memos.api.v1.UserService/CreateUser": {},
"/memos.api.v1.UserService/GetUser": {},
"/memos.api.v1.UserService/GetUserAvatar": {},
"/memos.api.v1.UserService/GetUserStats": {},
"/memos.api.v1.UserService/ListAllUserStats": {},
"/memos.api.v1.UserService/SearchUsers": {},
"/memos.api.v1.IdentityProviderService/ListIdentityProviders": {},
"/memos.api.v1.MemoService/GetMemo": {},
"/memos.api.v1.MemoService/ListMemos": {},
"/memos.api.v1.MemoService/ListMemoComments": {},
}
PublicMethods defines API endpoints that don't require authentication. All other endpoints require a valid session or access token.
This is the SINGLE SOURCE OF TRUTH for public endpoints. Both Connect interceptor and gRPC-Gateway interceptor use this map.
Format: Full gRPC procedure path as returned by req.Spec().Procedure (Connect) or info.FullMethod (gRPC interceptor).
var SupportedThumbnailMimeTypes = []string{
"image/png",
"image/jpeg",
}
Functions ¶
func ExtractAttachmentUIDFromName ¶
ExtractAttachmentUIDFromName returns the attachment UID from a resource name.
func ExtractInboxIDFromName ¶
ExtractInboxIDFromName returns the inbox ID from a resource name.
func ExtractMemoReactionIDFromName ¶
ExtractMemoReactionIDFromName returns the memo UID and reaction ID from a resource name. e.g., "memos/abc/reactions/123" -> ("abc", 123).
func ExtractMemoUIDFromName ¶
ExtractMemoUIDFromName returns the memo UID from a resource name. e.g., "memos/uuid" -> "uuid".
func ExtractNotificationIDFromName ¶
ExtractNotificationIDFromName extracts the notification ID from a resource name. Expected format: users/{user_id}/notifications/{notification_id}.
func ExtractUserIDAndSettingKeyFromName ¶
ExtractUserIDAndSettingKeyFromName extracts user ID and setting key from resource name. e.g., "users/123/settings/general" -> 123, "general".
func ExtractUserIDFromName ¶
ExtractUserIDFromName returns the uid from a resource name.
func GetNameParentTokens ¶
GetNameParentTokens returns the tokens from a resource name.
func IsPublicMethod ¶
IsPublicMethod checks if a procedure path is public (no authentication required). Returns true for public methods, false for protected methods.
func SaveAttachmentBlob ¶
func SaveAttachmentBlob(ctx context.Context, profile *profile.Profile, stores *store.Store, create *store.Attachment) error
SaveAttachmentBlob save the blob of attachment based on the storage config. For personal assistant, always uses local storage.
func SetResponseHeader ¶
SetResponseHeader sets a header in the response.
This function works for both gRPC and Connect protocols:
- For gRPC: Uses grpc.SetHeader to set headers in gRPC metadata
- For Connect: Stores in HeaderCarrier for Connect wrapper to apply later
The protocol is automatically detected based on whether a HeaderCarrier exists in the context (injected by Connect wrappers).
Types ¶
type AIService ¶
type AIService struct {
v1pb.UnimplementedAIServiceServer
RerankerService pluginai.RerankerService
EmbeddingService pluginai.EmbeddingService
LLMService pluginai.LLMService
AdaptiveRetriever *retrieval.AdaptiveRetriever
IntentClassifierConfig *pluginai.IntentClassifierConfig
Store *store.Store
EmbeddingModel string
// contains filtered or unexported fields
}
AIService provides AI-powered features for memo management.
func (*AIService) AddContextSeparator ¶
func (*AIService) Chat ¶
func (s *AIService) Chat(req *v1pb.ChatRequest, stream v1pb.AIService_ChatServer) error
Chat streams a chat response with AI agents. Emits events for conversation persistence (handled by ConversationService).
func (*AIService) ClearConversationMessages ¶
func (s *AIService) ClearConversationMessages(ctx context.Context, req *v1pb.ClearConversationMessagesRequest) (*emptypb.Empty, error)
ClearConversationMessages deletes all messages in a conversation.
func (*AIService) CreateAIConversation ¶
func (s *AIService) CreateAIConversation(ctx context.Context, req *v1pb.CreateAIConversationRequest) (*v1pb.AIConversation, error)
func (*AIService) DeleteAIConversation ¶
func (*AIService) DetectDuplicates ¶
func (s *AIService) DetectDuplicates(ctx context.Context, req *v1pb.DetectDuplicatesRequest) (*v1pb.DetectDuplicatesResponse, error)
DetectDuplicates checks for duplicate or related memos.
func (*AIService) GetAIConversation ¶
func (s *AIService) GetAIConversation(ctx context.Context, req *v1pb.GetAIConversationRequest) (*v1pb.AIConversation, error)
func (*AIService) GetDueReviews ¶
func (s *AIService) GetDueReviews(ctx context.Context, req *v1pb.GetDueReviewsRequest) (*v1pb.GetDueReviewsResponse, error)
GetDueReviews returns memos that are due for review.
func (*AIService) GetKnowledgeGraph ¶
func (s *AIService) GetKnowledgeGraph(ctx context.Context, req *v1pb.GetKnowledgeGraphRequest) (*v1pb.GetKnowledgeGraphResponse, error)
GetKnowledgeGraph returns the knowledge graph for the current user.
func (*AIService) GetRelatedMemos ¶
func (s *AIService) GetRelatedMemos(ctx context.Context, req *v1pb.GetRelatedMemosRequest) (*v1pb.GetRelatedMemosResponse, error)
GetRelatedMemos finds memos related to a specific memo.
func (*AIService) GetReviewStats ¶
func (s *AIService) GetReviewStats(ctx context.Context, req *v1pb.GetReviewStatsRequest) (*v1pb.GetReviewStatsResponse, error)
GetReviewStats returns review statistics for the current user.
func (*AIService) IsEnabled ¶
IsEnabled returns whether AI features are enabled. For basic features (embedding, search), only EmbeddingService is required. For Agent features (Memo, Schedule, etc.), both EmbeddingService and LLMService are required.
func (*AIService) IsLLMEnabled ¶
IsLLMEnabled returns whether LLM features are enabled (required for Agents).
func (*AIService) LinkMemos ¶
func (s *AIService) LinkMemos(ctx context.Context, req *v1pb.LinkMemosRequest) (*v1pb.LinkMemosResponse, error)
LinkMemos creates a bidirectional relation between two memos.
func (*AIService) ListAIConversations ¶
func (s *AIService) ListAIConversations(ctx context.Context, _ *v1pb.ListAIConversationsRequest) (*v1pb.ListAIConversationsResponse, error)
func (*AIService) ListMessages ¶
func (s *AIService) ListMessages(ctx context.Context, req *v1pb.ListMessagesRequest) (*v1pb.ListMessagesResponse, error)
- SUMMARY messages are filtered out (never returned to frontend).
func (*AIService) MergeMemos ¶
func (s *AIService) MergeMemos(ctx context.Context, req *v1pb.MergeMemosRequest) (*v1pb.MergeMemosResponse, error)
MergeMemos merges source memo into target memo.
func (*AIService) RecordReview ¶
func (s *AIService) RecordReview(ctx context.Context, req *v1pb.RecordReviewRequest) (*emptypb.Empty, error)
RecordReview records a review result and updates spaced repetition state.
func (*AIService) SemanticSearch ¶
func (s *AIService) SemanticSearch(ctx context.Context, req *v1pb.SemanticSearchRequest) (*v1pb.SemanticSearchResponse, error)
SemanticSearch performs semantic search on memos.
func (*AIService) StopChat ¶ added in v0.80.0
func (s *AIService) StopChat(ctx context.Context, req *v1pb.StopChatRequest) (*emptypb.Empty, error)
StopChat cancels an ongoing chat stream and terminates the associated session. This is the implementation for session.stop from the async architecture spec. StopChat 取消正在进行的聊天流并终止相关会话。 这是异步架构规范中 session.stop 的实现。
Architecture Note: Session termination is primarily client-driven.
- The client should cancel the streaming request (gRPC/HTTP) to immediately stop processing.
- This method emits monitoring events for observability and metrics collection.
- Active sessions are cleaned up after a 30-minute idle timeout (CCSessionManager).
- For server-initiated termination in future, consider adding a session registry that maps conversationID to active context.CancelFunc for immediate cancellation.
func (*AIService) SuggestTags ¶
func (s *AIService) SuggestTags(ctx context.Context, req *v1pb.SuggestTagsRequest) (*v1pb.SuggestTagsResponse, error)
SuggestTags suggests tags for memo content. P2-C001: Uses three-layer progressive strategy (statistics -> rules -> LLM).
func (*AIService) UpdateAIConversation ¶
func (s *AIService) UpdateAIConversation(ctx context.Context, req *v1pb.UpdateAIConversationRequest) (*v1pb.AIConversation, error)
type APIV1Service ¶
type APIV1Service struct {
v1pb.UnimplementedAIServiceServer
v1pb.UnimplementedScheduleAgentServiceServer
v1pb.UnimplementedUserServiceServer
v1pb.UnimplementedScheduleServiceServer
v1pb.UnimplementedAttachmentServiceServer
v1pb.UnimplementedShortcutServiceServer
v1pb.UnimplementedActivityServiceServer
v1pb.UnimplementedIdentityProviderServiceServer
v1pb.UnimplementedAuthServiceServer
v1pb.UnimplementedInstanceServiceServer
v1pb.UnimplementedMemoServiceServer
MarkdownService markdown.Service
Profile *profile.Profile
Store *store.Store
AIService *AIService
ScheduleService *ScheduleService
ScheduleAgentService *ScheduleAgentService
Secret string
// contains filtered or unexported fields
}
func NewAPIV1Service ¶
func (*APIV1Service) Check ¶
func (s *APIV1Service) Check(ctx context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*APIV1Service) CreateAttachment ¶
func (s *APIV1Service) CreateAttachment(ctx context.Context, request *v1pb.CreateAttachmentRequest) (*v1pb.Attachment, error)
func (*APIV1Service) CreateIdentityProvider ¶
func (s *APIV1Service) CreateIdentityProvider(ctx context.Context, request *v1pb.CreateIdentityProviderRequest) (*v1pb.IdentityProvider, error)
func (*APIV1Service) CreateMemo ¶
func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoRequest) (*v1pb.Memo, error)
func (*APIV1Service) CreateMemoComment ¶
func (s *APIV1Service) CreateMemoComment(ctx context.Context, request *v1pb.CreateMemoCommentRequest) (*v1pb.Memo, error)
func (*APIV1Service) CreatePersonalAccessToken ¶
func (s *APIV1Service) CreatePersonalAccessToken(ctx context.Context, request *v1pb.CreatePersonalAccessTokenRequest) (*v1pb.CreatePersonalAccessTokenResponse, error)
CreatePersonalAccessToken creates a new Personal Access Token (PAT) for a user.
Use cases: - User manually creates token in settings for mobile app - User creates token for CLI tool - User creates token for third-party integration
Token properties: - Random string with memos_pat_ prefix - SHA-256 hash stored in database - Optional expiration time (can be never-expiring) - User-provided description for identification
Security considerations: - Full token is only shown ONCE (in this response) - User should copy and store it securely - Token can be revoked by deleting it from settings
Authentication: Required (session cookie or access token) Authorization: User can only create tokens for themselves.
func (*APIV1Service) CreateShortcut ¶
func (s *APIV1Service) CreateShortcut(ctx context.Context, request *v1pb.CreateShortcutRequest) (*v1pb.Shortcut, error)
func (*APIV1Service) CreateUser ¶
func (s *APIV1Service) CreateUser(ctx context.Context, request *v1pb.CreateUserRequest) (*v1pb.User, error)
func (*APIV1Service) CreateUserWebhook ¶
func (s *APIV1Service) CreateUserWebhook(ctx context.Context, request *v1pb.CreateUserWebhookRequest) (*v1pb.UserWebhook, error)
func (*APIV1Service) DeleteAttachment ¶
func (s *APIV1Service) DeleteAttachment(ctx context.Context, request *v1pb.DeleteAttachmentRequest) (*emptypb.Empty, error)
func (*APIV1Service) DeleteIdentityProvider ¶
func (s *APIV1Service) DeleteIdentityProvider(ctx context.Context, request *v1pb.DeleteIdentityProviderRequest) (*emptypb.Empty, error)
func (*APIV1Service) DeleteMemo ¶
func (s *APIV1Service) DeleteMemo(ctx context.Context, request *v1pb.DeleteMemoRequest) (*emptypb.Empty, error)
func (*APIV1Service) DeleteMemoReaction ¶
func (s *APIV1Service) DeleteMemoReaction(ctx context.Context, request *v1pb.DeleteMemoReactionRequest) (*emptypb.Empty, error)
func (*APIV1Service) DeletePersonalAccessToken ¶
func (s *APIV1Service) DeletePersonalAccessToken(ctx context.Context, request *v1pb.DeletePersonalAccessTokenRequest) (*emptypb.Empty, error)
DeletePersonalAccessToken revokes a Personal Access Token.
This endpoint: 1. Removes the token from the user's access tokens list 2. Immediately invalidates the token (subsequent API calls with it will fail)
Use cases: - User revokes a compromised token - User removes token for unused app/device - User cleans up old tokens
Authentication: Required (session cookie or access token) Authorization: User can only delete their own tokens.
func (*APIV1Service) DeleteShortcut ¶
func (s *APIV1Service) DeleteShortcut(ctx context.Context, request *v1pb.DeleteShortcutRequest) (*emptypb.Empty, error)
func (*APIV1Service) DeleteUser ¶
func (s *APIV1Service) DeleteUser(ctx context.Context, request *v1pb.DeleteUserRequest) (*emptypb.Empty, error)
func (*APIV1Service) DeleteUserNotification ¶
func (s *APIV1Service) DeleteUserNotification(ctx context.Context, request *v1pb.DeleteUserNotificationRequest) (*emptypb.Empty, error)
DeleteUserNotification permanently deletes a notification. Only the notification owner can delete their notifications.
func (*APIV1Service) DeleteUserWebhook ¶
func (s *APIV1Service) DeleteUserWebhook(ctx context.Context, request *v1pb.DeleteUserWebhookRequest) (*emptypb.Empty, error)
func (*APIV1Service) DispatchMemoCreatedWebhook ¶
DispatchMemoCreatedWebhook dispatches webhook when memo is created.
func (*APIV1Service) DispatchMemoDeletedWebhook ¶
DispatchMemoDeletedWebhook dispatches webhook when memo is deleted.
func (*APIV1Service) DispatchMemoUpdatedWebhook ¶
DispatchMemoUpdatedWebhook dispatches webhook when memo is updated.
func (*APIV1Service) GetActivity ¶
func (s *APIV1Service) GetActivity(ctx context.Context, request *v1pb.GetActivityRequest) (*v1pb.Activity, error)
func (*APIV1Service) GetAttachment ¶
func (s *APIV1Service) GetAttachment(ctx context.Context, request *v1pb.GetAttachmentRequest) (*v1pb.Attachment, error)
func (*APIV1Service) GetAttachmentBlob ¶
func (s *APIV1Service) GetAttachmentBlob(attachment *store.Attachment) ([]byte, error)
func (*APIV1Service) GetCurrentUser ¶
func (s *APIV1Service) GetCurrentUser(ctx context.Context, _ *v1pb.GetCurrentUserRequest) (*v1pb.GetCurrentUserResponse, error)
GetCurrentUser returns the authenticated user's information. Validates the access token and returns user details.
Authentication: Required (access token). Returns: User information.
func (*APIV1Service) GetIdentityProvider ¶
func (s *APIV1Service) GetIdentityProvider(ctx context.Context, request *v1pb.GetIdentityProviderRequest) (*v1pb.IdentityProvider, error)
func (*APIV1Service) GetInstanceOwner ¶
func (*APIV1Service) GetInstanceProfile ¶
func (s *APIV1Service) GetInstanceProfile(ctx context.Context, _ *v1pb.GetInstanceProfileRequest) (*v1pb.InstanceProfile, error)
GetInstanceProfile returns the instance profile.
func (*APIV1Service) GetInstanceSetting ¶
func (s *APIV1Service) GetInstanceSetting(ctx context.Context, request *v1pb.GetInstanceSettingRequest) (*v1pb.InstanceSetting, error)
func (*APIV1Service) GetMemo ¶
func (s *APIV1Service) GetMemo(ctx context.Context, request *v1pb.GetMemoRequest) (*v1pb.Memo, error)
func (*APIV1Service) GetMetricsOverview ¶
func (s *APIV1Service) GetMetricsOverview(c echo.Context) error
GET /api/v1/system/metrics/overview.
func (*APIV1Service) GetRelatedMemos ¶
func (s *APIV1Service) GetRelatedMemos(ctx context.Context, request *v1pb.GetRelatedMemosRequest) (*v1pb.GetRelatedMemosResponse, error)
GetRelatedMemos returns related memos for a given memo. P1-C003: Related memo recommendations based on semantic similarity and tag co-occurrence.
func (*APIV1Service) GetShortcut ¶
func (s *APIV1Service) GetShortcut(ctx context.Context, request *v1pb.GetShortcutRequest) (*v1pb.Shortcut, error)
func (*APIV1Service) GetUser ¶
func (s *APIV1Service) GetUser(ctx context.Context, request *v1pb.GetUserRequest) (*v1pb.User, error)
func (*APIV1Service) GetUserSetting ¶
func (s *APIV1Service) GetUserSetting(ctx context.Context, request *v1pb.GetUserSettingRequest) (*v1pb.UserSetting, error)
func (*APIV1Service) GetUserStats ¶
func (s *APIV1Service) GetUserStats(ctx context.Context, request *v1pb.GetUserStatsRequest) (*v1pb.UserStats, error)
func (*APIV1Service) ListActivities ¶
func (s *APIV1Service) ListActivities(ctx context.Context, request *v1pb.ListActivitiesRequest) (*v1pb.ListActivitiesResponse, error)
func (*APIV1Service) ListAllUserStats ¶
func (s *APIV1Service) ListAllUserStats(ctx context.Context, _ *v1pb.ListAllUserStatsRequest) (*v1pb.ListAllUserStatsResponse, error)
func (*APIV1Service) ListAttachments ¶
func (s *APIV1Service) ListAttachments(ctx context.Context, request *v1pb.ListAttachmentsRequest) (*v1pb.ListAttachmentsResponse, error)
func (*APIV1Service) ListIdentityProviders ¶
func (s *APIV1Service) ListIdentityProviders(ctx context.Context, _ *v1pb.ListIdentityProvidersRequest) (*v1pb.ListIdentityProvidersResponse, error)
func (*APIV1Service) ListMemoAttachments ¶
func (s *APIV1Service) ListMemoAttachments(ctx context.Context, request *v1pb.ListMemoAttachmentsRequest) (*v1pb.ListMemoAttachmentsResponse, error)
func (*APIV1Service) ListMemoComments ¶
func (s *APIV1Service) ListMemoComments(ctx context.Context, request *v1pb.ListMemoCommentsRequest) (*v1pb.ListMemoCommentsResponse, error)
func (*APIV1Service) ListMemoReactions ¶
func (s *APIV1Service) ListMemoReactions(ctx context.Context, request *v1pb.ListMemoReactionsRequest) (*v1pb.ListMemoReactionsResponse, error)
func (*APIV1Service) ListMemoRelations ¶
func (s *APIV1Service) ListMemoRelations(ctx context.Context, request *v1pb.ListMemoRelationsRequest) (*v1pb.ListMemoRelationsResponse, error)
func (*APIV1Service) ListMemos ¶
func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosRequest) (*v1pb.ListMemosResponse, error)
func (*APIV1Service) ListPersonalAccessTokens ¶
func (s *APIV1Service) ListPersonalAccessTokens(ctx context.Context, request *v1pb.ListPersonalAccessTokensRequest) (*v1pb.ListPersonalAccessTokensResponse, error)
ListPersonalAccessTokens retrieves all Personal Access Tokens (PATs) for a user.
Personal Access Tokens are used for: - Mobile app authentication - CLI tool authentication - API client authentication - Any programmatic access requiring Bearer token auth
Security: - Only the token owner can list their tokens - Returns token metadata only (not the actual token value) - Invalid or expired tokens are filtered out
Authentication: Required (session cookie or access token) Authorization: User can only list their own tokens.
func (*APIV1Service) ListShortcuts ¶
func (s *APIV1Service) ListShortcuts(ctx context.Context, request *v1pb.ListShortcutsRequest) (*v1pb.ListShortcutsResponse, error)
func (*APIV1Service) ListUserNotifications ¶
func (s *APIV1Service) ListUserNotifications(ctx context.Context, request *v1pb.ListUserNotificationsRequest) (*v1pb.ListUserNotificationsResponse, error)
ListUserNotifications lists all notifications for a user. Notifications are backed by the inbox storage layer and represent activities that require user attention (e.g., memo comments).
func (*APIV1Service) ListUserSettings ¶
func (s *APIV1Service) ListUserSettings(ctx context.Context, request *v1pb.ListUserSettingsRequest) (*v1pb.ListUserSettingsResponse, error)
func (*APIV1Service) ListUserWebhooks ¶
func (s *APIV1Service) ListUserWebhooks(ctx context.Context, request *v1pb.ListUserWebhooksRequest) (*v1pb.ListUserWebhooksResponse, error)
func (*APIV1Service) ListUsers ¶
func (s *APIV1Service) ListUsers(ctx context.Context, request *v1pb.ListUsersRequest) (*v1pb.ListUsersResponse, error)
func (*APIV1Service) RefreshToken ¶
func (s *APIV1Service) RefreshToken(ctx context.Context, _ *v1pb.RefreshTokenRequest) (*v1pb.RefreshTokenResponse, error)
RefreshToken exchanges a valid refresh token for a new access token.
This endpoint implements refresh token rotation with sliding window sessions: 1. Extracts the refresh token from the HttpOnly cookie (memos_refresh) 2. Validates the refresh token against the database (checking expiry and revocation) 3. Rotates the refresh token: generates a new one with fresh 30-day expiry 4. Generates a new short-lived access token (15 minutes) 5. Sets the new refresh token as HttpOnly cookie 6. Returns the new access token and its expiry time
Token rotation provides: - Sliding window sessions: active users stay logged in indefinitely - Better security: stolen refresh tokens become invalid after legitimate refresh
Authentication: Requires valid refresh token in cookie (public endpoint) Returns: New access token and expiry timestamp.
func (*APIV1Service) RegisterGateway ¶
RegisterGateway registers the gRPC-Gateway and Connect handlers with the given Echo instance.
func (*APIV1Service) SearchWithHighlight ¶
func (s *APIV1Service) SearchWithHighlight(ctx context.Context, request *v1pb.SearchWithHighlightRequest) (*v1pb.SearchWithHighlightResponse, error)
SearchWithHighlight searches memos and returns results with keyword highlighting. This is an AI-powered feature that requires PostgreSQL.
func (*APIV1Service) SetMemoAttachments ¶
func (s *APIV1Service) SetMemoAttachments(ctx context.Context, request *v1pb.SetMemoAttachmentsRequest) (*emptypb.Empty, error)
func (*APIV1Service) SetMemoRelations ¶
func (s *APIV1Service) SetMemoRelations(ctx context.Context, request *v1pb.SetMemoRelationsRequest) (*emptypb.Empty, error)
func (*APIV1Service) SignIn ¶
func (s *APIV1Service) SignIn(ctx context.Context, request *v1pb.SignInRequest) (*v1pb.SignInResponse, error)
SignIn authenticates a user with credentials and returns tokens. On success, returns an access token and sets a refresh token cookie.
Supports two authentication methods: 1. Password-based authentication (username + password). 2. SSO authentication (OAuth2 authorization code).
Authentication: Not required (public endpoint). Returns: User info, access token, and token expiry.
func (*APIV1Service) SignOut ¶
func (s *APIV1Service) SignOut(ctx context.Context, _ *v1pb.SignOutRequest) (*emptypb.Empty, error)
SignOut terminates the user's authentication. Revokes the refresh token and clears the authentication cookie.
Authentication: Required (access token). Returns: Empty response on success.
func (*APIV1Service) UpdateAttachment ¶
func (s *APIV1Service) UpdateAttachment(ctx context.Context, request *v1pb.UpdateAttachmentRequest) (*v1pb.Attachment, error)
func (*APIV1Service) UpdateIdentityProvider ¶
func (s *APIV1Service) UpdateIdentityProvider(ctx context.Context, request *v1pb.UpdateIdentityProviderRequest) (*v1pb.IdentityProvider, error)
func (*APIV1Service) UpdateInstanceSetting ¶
func (s *APIV1Service) UpdateInstanceSetting(ctx context.Context, request *v1pb.UpdateInstanceSettingRequest) (*v1pb.InstanceSetting, error)
func (*APIV1Service) UpdateMemo ¶
func (s *APIV1Service) UpdateMemo(ctx context.Context, request *v1pb.UpdateMemoRequest) (*v1pb.Memo, error)
func (*APIV1Service) UpdateShortcut ¶
func (s *APIV1Service) UpdateShortcut(ctx context.Context, request *v1pb.UpdateShortcutRequest) (*v1pb.Shortcut, error)
func (*APIV1Service) UpdateUser ¶
func (s *APIV1Service) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRequest) (*v1pb.User, error)
func (*APIV1Service) UpdateUserNotification ¶
func (s *APIV1Service) UpdateUserNotification(ctx context.Context, request *v1pb.UpdateUserNotificationRequest) (*v1pb.UserNotification, error)
UpdateUserNotification updates a notification's status (e.g., marking as read/archived). Only the notification owner can update their notifications.
func (*APIV1Service) UpdateUserSetting ¶
func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.UpdateUserSettingRequest) (*v1pb.UserSetting, error)
func (*APIV1Service) UpdateUserWebhook ¶
func (s *APIV1Service) UpdateUserWebhook(ctx context.Context, request *v1pb.UpdateUserWebhookRequest) (*v1pb.UserWebhook, error)
func (*APIV1Service) UpsertMemoReaction ¶
func (s *APIV1Service) UpsertMemoReaction(ctx context.Context, request *v1pb.UpsertMemoReactionRequest) (*v1pb.Reaction, error)
type AuthInterceptor ¶
type AuthInterceptor struct {
// contains filtered or unexported fields
}
AuthInterceptor handles authentication for Connect handlers.
It enforces authentication for all endpoints except those listed in PublicMethods. Role-based authorization (admin checks) remains in the service layer.
func NewAuthInterceptor ¶
func NewAuthInterceptor(store *store.Store, secret string) *AuthInterceptor
NewAuthInterceptor creates a new auth interceptor.
func (*AuthInterceptor) WrapStreamingClient ¶
func (*AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (*AuthInterceptor) WrapStreamingHandler ¶
func (in *AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type ConnectServiceHandler ¶
type ConnectServiceHandler struct {
*APIV1Service
}
ConnectServiceHandler wraps APIV1Service to implement Connect handler interfaces. It adapts the existing gRPC service implementations to work with Connect's request/response wrapper types.
This wrapper pattern allows us to: - Reuse existing gRPC service implementations - Support both native gRPC and Connect protocols - Maintain a single source of truth for business logic.
func NewConnectServiceHandler ¶
func NewConnectServiceHandler(svc *APIV1Service) *ConnectServiceHandler
NewConnectServiceHandler creates a new Connect service handler.
func (*ConnectServiceHandler) AddContextSeparator ¶
func (*ConnectServiceHandler) BatchCreateSchedules ¶
func (s *ConnectServiceHandler) BatchCreateSchedules(ctx context.Context, req *connect.Request[v1pb.BatchCreateSchedulesRequest]) (*connect.Response[v1pb.BatchCreateSchedulesResponse], error)
func (*ConnectServiceHandler) BatchParseSchedule ¶
func (s *ConnectServiceHandler) BatchParseSchedule(ctx context.Context, req *connect.Request[v1pb.BatchParseScheduleRequest]) (*connect.Response[v1pb.BatchParseScheduleResponse], error)
func (*ConnectServiceHandler) Chat ¶
func (s *ConnectServiceHandler) Chat(ctx context.Context, req *connect.Request[v1pb.ChatRequest], stream *connect.ServerStream[v1pb.ChatResponse]) error
func (*ConnectServiceHandler) CheckConflict ¶
func (s *ConnectServiceHandler) CheckConflict(ctx context.Context, req *connect.Request[v1pb.CheckConflictRequest]) (*connect.Response[v1pb.CheckConflictResponse], error)
func (*ConnectServiceHandler) ClearConversationMessages ¶
func (*ConnectServiceHandler) CreateAIConversation ¶
func (s *ConnectServiceHandler) CreateAIConversation(ctx context.Context, req *connect.Request[v1pb.CreateAIConversationRequest]) (*connect.Response[v1pb.AIConversation], error)
func (*ConnectServiceHandler) CreateAttachment ¶
func (s *ConnectServiceHandler) CreateAttachment(ctx context.Context, req *connect.Request[v1pb.CreateAttachmentRequest]) (*connect.Response[v1pb.Attachment], error)
func (*ConnectServiceHandler) CreateIdentityProvider ¶
func (s *ConnectServiceHandler) CreateIdentityProvider(ctx context.Context, req *connect.Request[v1pb.CreateIdentityProviderRequest]) (*connect.Response[v1pb.IdentityProvider], error)
func (*ConnectServiceHandler) CreateMemo ¶
func (*ConnectServiceHandler) CreateMemoComment ¶
func (*ConnectServiceHandler) CreatePersonalAccessToken ¶
func (s *ConnectServiceHandler) CreatePersonalAccessToken(ctx context.Context, req *connect.Request[v1pb.CreatePersonalAccessTokenRequest]) (*connect.Response[v1pb.CreatePersonalAccessTokenResponse], error)
func (*ConnectServiceHandler) CreateSchedule ¶
func (*ConnectServiceHandler) CreateShortcut ¶
func (*ConnectServiceHandler) CreateUser ¶
func (*ConnectServiceHandler) CreateUserWebhook ¶
func (s *ConnectServiceHandler) CreateUserWebhook(ctx context.Context, req *connect.Request[v1pb.CreateUserWebhookRequest]) (*connect.Response[v1pb.UserWebhook], error)
func (*ConnectServiceHandler) DeleteAIConversation ¶
func (*ConnectServiceHandler) DeleteAttachment ¶
func (*ConnectServiceHandler) DeleteIdentityProvider ¶
func (*ConnectServiceHandler) DeleteMemo ¶
func (*ConnectServiceHandler) DeleteMemoReaction ¶
func (*ConnectServiceHandler) DeletePersonalAccessToken ¶
func (*ConnectServiceHandler) DeleteSchedule ¶
func (*ConnectServiceHandler) DeleteShortcut ¶
func (*ConnectServiceHandler) DeleteUser ¶
func (*ConnectServiceHandler) DeleteUserNotification ¶
func (*ConnectServiceHandler) DeleteUserWebhook ¶
func (*ConnectServiceHandler) DetectDuplicates ¶
func (s *ConnectServiceHandler) DetectDuplicates(ctx context.Context, req *connect.Request[v1pb.DetectDuplicatesRequest]) (*connect.Response[v1pb.DetectDuplicatesResponse], error)
func (*ConnectServiceHandler) GetAIConversation ¶
func (s *ConnectServiceHandler) GetAIConversation(ctx context.Context, req *connect.Request[v1pb.GetAIConversationRequest]) (*connect.Response[v1pb.AIConversation], error)
func (*ConnectServiceHandler) GetActivity ¶
func (*ConnectServiceHandler) GetAttachment ¶
func (s *ConnectServiceHandler) GetAttachment(ctx context.Context, req *connect.Request[v1pb.GetAttachmentRequest]) (*connect.Response[v1pb.Attachment], error)
func (*ConnectServiceHandler) GetCurrentUser ¶
func (s *ConnectServiceHandler) GetCurrentUser(ctx context.Context, req *connect.Request[v1pb.GetCurrentUserRequest]) (*connect.Response[v1pb.GetCurrentUserResponse], error)
func (*ConnectServiceHandler) GetDueReviews ¶
func (s *ConnectServiceHandler) GetDueReviews(ctx context.Context, req *connect.Request[v1pb.GetDueReviewsRequest]) (*connect.Response[v1pb.GetDueReviewsResponse], error)
func (*ConnectServiceHandler) GetIdentityProvider ¶
func (s *ConnectServiceHandler) GetIdentityProvider(ctx context.Context, req *connect.Request[v1pb.GetIdentityProviderRequest]) (*connect.Response[v1pb.IdentityProvider], error)
func (*ConnectServiceHandler) GetInstanceProfile ¶
func (s *ConnectServiceHandler) GetInstanceProfile(ctx context.Context, req *connect.Request[v1pb.GetInstanceProfileRequest]) (*connect.Response[v1pb.InstanceProfile], error)
func (*ConnectServiceHandler) GetInstanceSetting ¶
func (s *ConnectServiceHandler) GetInstanceSetting(ctx context.Context, req *connect.Request[v1pb.GetInstanceSettingRequest]) (*connect.Response[v1pb.InstanceSetting], error)
func (*ConnectServiceHandler) GetKnowledgeGraph ¶
func (s *ConnectServiceHandler) GetKnowledgeGraph(ctx context.Context, req *connect.Request[v1pb.GetKnowledgeGraphRequest]) (*connect.Response[v1pb.GetKnowledgeGraphResponse], error)
func (*ConnectServiceHandler) GetParrotSelfCognition ¶
func (s *ConnectServiceHandler) GetParrotSelfCognition(ctx context.Context, req *connect.Request[v1pb.GetParrotSelfCognitionRequest]) (*connect.Response[v1pb.GetParrotSelfCognitionResponse], error)
GetParrotSelfCognition returns the metacognitive information of a parrot agent.
func (*ConnectServiceHandler) GetRelatedMemos ¶
func (s *ConnectServiceHandler) GetRelatedMemos(ctx context.Context, req *connect.Request[v1pb.GetRelatedMemosRequest]) (*connect.Response[v1pb.GetRelatedMemosResponse], error)
func (*ConnectServiceHandler) GetReviewStats ¶
func (s *ConnectServiceHandler) GetReviewStats(ctx context.Context, req *connect.Request[v1pb.GetReviewStatsRequest]) (*connect.Response[v1pb.GetReviewStatsResponse], error)
func (*ConnectServiceHandler) GetSchedule ¶
func (*ConnectServiceHandler) GetShortcut ¶
func (*ConnectServiceHandler) GetUserSetting ¶
func (s *ConnectServiceHandler) GetUserSetting(ctx context.Context, req *connect.Request[v1pb.GetUserSettingRequest]) (*connect.Response[v1pb.UserSetting], error)
func (*ConnectServiceHandler) GetUserStats ¶
func (*ConnectServiceHandler) LinkMemos ¶
func (s *ConnectServiceHandler) LinkMemos(ctx context.Context, req *connect.Request[v1pb.LinkMemosRequest]) (*connect.Response[v1pb.LinkMemosResponse], error)
func (*ConnectServiceHandler) ListAIConversations ¶
func (s *ConnectServiceHandler) ListAIConversations(ctx context.Context, req *connect.Request[v1pb.ListAIConversationsRequest]) (*connect.Response[v1pb.ListAIConversationsResponse], error)
func (*ConnectServiceHandler) ListActivities ¶
func (s *ConnectServiceHandler) ListActivities(ctx context.Context, req *connect.Request[v1pb.ListActivitiesRequest]) (*connect.Response[v1pb.ListActivitiesResponse], error)
func (*ConnectServiceHandler) ListAllUserStats ¶
func (s *ConnectServiceHandler) ListAllUserStats(ctx context.Context, req *connect.Request[v1pb.ListAllUserStatsRequest]) (*connect.Response[v1pb.ListAllUserStatsResponse], error)
func (*ConnectServiceHandler) ListAttachments ¶
func (s *ConnectServiceHandler) ListAttachments(ctx context.Context, req *connect.Request[v1pb.ListAttachmentsRequest]) (*connect.Response[v1pb.ListAttachmentsResponse], error)
func (*ConnectServiceHandler) ListIdentityProviders ¶
func (s *ConnectServiceHandler) ListIdentityProviders(ctx context.Context, req *connect.Request[v1pb.ListIdentityProvidersRequest]) (*connect.Response[v1pb.ListIdentityProvidersResponse], error)
func (*ConnectServiceHandler) ListMemoAttachments ¶
func (s *ConnectServiceHandler) ListMemoAttachments(ctx context.Context, req *connect.Request[v1pb.ListMemoAttachmentsRequest]) (*connect.Response[v1pb.ListMemoAttachmentsResponse], error)
func (*ConnectServiceHandler) ListMemoComments ¶
func (s *ConnectServiceHandler) ListMemoComments(ctx context.Context, req *connect.Request[v1pb.ListMemoCommentsRequest]) (*connect.Response[v1pb.ListMemoCommentsResponse], error)
func (*ConnectServiceHandler) ListMemoReactions ¶
func (s *ConnectServiceHandler) ListMemoReactions(ctx context.Context, req *connect.Request[v1pb.ListMemoReactionsRequest]) (*connect.Response[v1pb.ListMemoReactionsResponse], error)
func (*ConnectServiceHandler) ListMemoRelations ¶
func (s *ConnectServiceHandler) ListMemoRelations(ctx context.Context, req *connect.Request[v1pb.ListMemoRelationsRequest]) (*connect.Response[v1pb.ListMemoRelationsResponse], error)
func (*ConnectServiceHandler) ListMemos ¶
func (s *ConnectServiceHandler) ListMemos(ctx context.Context, req *connect.Request[v1pb.ListMemosRequest]) (*connect.Response[v1pb.ListMemosResponse], error)
func (*ConnectServiceHandler) ListMessages ¶
func (s *ConnectServiceHandler) ListMessages(ctx context.Context, req *connect.Request[v1pb.ListMessagesRequest]) (*connect.Response[v1pb.ListMessagesResponse], error)
func (*ConnectServiceHandler) ListParrots ¶
func (s *ConnectServiceHandler) ListParrots(ctx context.Context, req *connect.Request[v1pb.ListParrotsRequest]) (*connect.Response[v1pb.ListParrotsResponse], error)
ListParrots returns all available parrot agents with their metacognitive information.
func (*ConnectServiceHandler) ListPersonalAccessTokens ¶
func (s *ConnectServiceHandler) ListPersonalAccessTokens(ctx context.Context, req *connect.Request[v1pb.ListPersonalAccessTokensRequest]) (*connect.Response[v1pb.ListPersonalAccessTokensResponse], error)
func (*ConnectServiceHandler) ListSchedules ¶
func (s *ConnectServiceHandler) ListSchedules(ctx context.Context, req *connect.Request[v1pb.ListSchedulesRequest]) (*connect.Response[v1pb.ListSchedulesResponse], error)
func (*ConnectServiceHandler) ListShortcuts ¶
func (s *ConnectServiceHandler) ListShortcuts(ctx context.Context, req *connect.Request[v1pb.ListShortcutsRequest]) (*connect.Response[v1pb.ListShortcutsResponse], error)
func (*ConnectServiceHandler) ListUserNotifications ¶
func (s *ConnectServiceHandler) ListUserNotifications(ctx context.Context, req *connect.Request[v1pb.ListUserNotificationsRequest]) (*connect.Response[v1pb.ListUserNotificationsResponse], error)
func (*ConnectServiceHandler) ListUserSettings ¶
func (s *ConnectServiceHandler) ListUserSettings(ctx context.Context, req *connect.Request[v1pb.ListUserSettingsRequest]) (*connect.Response[v1pb.ListUserSettingsResponse], error)
func (*ConnectServiceHandler) ListUserWebhooks ¶
func (s *ConnectServiceHandler) ListUserWebhooks(ctx context.Context, req *connect.Request[v1pb.ListUserWebhooksRequest]) (*connect.Response[v1pb.ListUserWebhooksResponse], error)
func (*ConnectServiceHandler) ListUsers ¶
func (s *ConnectServiceHandler) ListUsers(ctx context.Context, req *connect.Request[v1pb.ListUsersRequest]) (*connect.Response[v1pb.ListUsersResponse], error)
func (*ConnectServiceHandler) MergeMemos ¶
func (s *ConnectServiceHandler) MergeMemos(ctx context.Context, req *connect.Request[v1pb.MergeMemosRequest]) (*connect.Response[v1pb.MergeMemosResponse], error)
func (*ConnectServiceHandler) ParseAndCreateSchedule ¶
func (s *ConnectServiceHandler) ParseAndCreateSchedule(ctx context.Context, req *connect.Request[v1pb.ParseAndCreateScheduleRequest]) (*connect.Response[v1pb.ParseAndCreateScheduleResponse], error)
func (*ConnectServiceHandler) PrecheckSchedule ¶
func (s *ConnectServiceHandler) PrecheckSchedule(ctx context.Context, req *connect.Request[v1pb.PrecheckScheduleRequest]) (*connect.Response[v1pb.PrecheckScheduleResponse], error)
func (*ConnectServiceHandler) RecordReview ¶
func (*ConnectServiceHandler) RefreshToken ¶
func (s *ConnectServiceHandler) RefreshToken(ctx context.Context, req *connect.Request[v1pb.RefreshTokenRequest]) (*connect.Response[v1pb.RefreshTokenResponse], error)
func (*ConnectServiceHandler) RegisterConnectHandlers ¶
func (s *ConnectServiceHandler) RegisterConnectHandlers(mux *http.ServeMux, opts ...connect.HandlerOption)
RegisterConnectHandlers registers all Connect service handlers on the given mux.
func (*ConnectServiceHandler) SearchWithHighlight ¶
func (s *ConnectServiceHandler) SearchWithHighlight(ctx context.Context, req *connect.Request[v1pb.SearchWithHighlightRequest]) (*connect.Response[v1pb.SearchWithHighlightResponse], error)
func (*ConnectServiceHandler) SemanticSearch ¶
func (s *ConnectServiceHandler) SemanticSearch(ctx context.Context, req *connect.Request[v1pb.SemanticSearchRequest]) (*connect.Response[v1pb.SemanticSearchResponse], error)
func (*ConnectServiceHandler) SetMemoAttachments ¶
func (*ConnectServiceHandler) SetMemoRelations ¶
func (*ConnectServiceHandler) SignIn ¶
func (s *ConnectServiceHandler) SignIn(ctx context.Context, req *connect.Request[v1pb.SignInRequest]) (*connect.Response[v1pb.SignInResponse], error)
func (*ConnectServiceHandler) StopChat ¶ added in v0.80.0
func (s *ConnectServiceHandler) StopChat(ctx context.Context, req *connect.Request[v1pb.StopChatRequest]) (*connect.Response[emptypb.Empty], error)
StopChat cancels an ongoing chat stream and terminates the associated session. StopChat 取消正在进行的聊天流并终止相关会话。
func (*ConnectServiceHandler) SuggestTags ¶
func (s *ConnectServiceHandler) SuggestTags(ctx context.Context, req *connect.Request[v1pb.SuggestTagsRequest]) (*connect.Response[v1pb.SuggestTagsResponse], error)
func (*ConnectServiceHandler) UpdateAIConversation ¶
func (s *ConnectServiceHandler) UpdateAIConversation(ctx context.Context, req *connect.Request[v1pb.UpdateAIConversationRequest]) (*connect.Response[v1pb.AIConversation], error)
func (*ConnectServiceHandler) UpdateAttachment ¶
func (s *ConnectServiceHandler) UpdateAttachment(ctx context.Context, req *connect.Request[v1pb.UpdateAttachmentRequest]) (*connect.Response[v1pb.Attachment], error)
func (*ConnectServiceHandler) UpdateIdentityProvider ¶
func (s *ConnectServiceHandler) UpdateIdentityProvider(ctx context.Context, req *connect.Request[v1pb.UpdateIdentityProviderRequest]) (*connect.Response[v1pb.IdentityProvider], error)
func (*ConnectServiceHandler) UpdateInstanceSetting ¶
func (s *ConnectServiceHandler) UpdateInstanceSetting(ctx context.Context, req *connect.Request[v1pb.UpdateInstanceSettingRequest]) (*connect.Response[v1pb.InstanceSetting], error)
func (*ConnectServiceHandler) UpdateMemo ¶
func (*ConnectServiceHandler) UpdateSchedule ¶
func (*ConnectServiceHandler) UpdateShortcut ¶
func (*ConnectServiceHandler) UpdateUser ¶
func (*ConnectServiceHandler) UpdateUserNotification ¶
func (s *ConnectServiceHandler) UpdateUserNotification(ctx context.Context, req *connect.Request[v1pb.UpdateUserNotificationRequest]) (*connect.Response[v1pb.UserNotification], error)
func (*ConnectServiceHandler) UpdateUserSetting ¶
func (s *ConnectServiceHandler) UpdateUserSetting(ctx context.Context, req *connect.Request[v1pb.UpdateUserSettingRequest]) (*connect.Response[v1pb.UserSetting], error)
func (*ConnectServiceHandler) UpdateUserWebhook ¶
func (s *ConnectServiceHandler) UpdateUserWebhook(ctx context.Context, req *connect.Request[v1pb.UpdateUserWebhookRequest]) (*connect.Response[v1pb.UserWebhook], error)
func (*ConnectServiceHandler) UpsertMemoReaction ¶
type HeaderCarrier ¶
type HeaderCarrier struct {
// contains filtered or unexported fields
}
HeaderCarrier stores headers that need to be set in the response.
Problem: The codebase supports two protocols simultaneously:
- Native gRPC: Uses grpc.SetHeader() to set response headers
- Connect-RPC: Uses connect.Response.Header().Set() to set response headers
Solution: HeaderCarrier provides a protocol-agnostic way to set headers.
- Service methods call SetResponseHeader() regardless of protocol
- For gRPC requests: SetResponseHeader uses grpc.SetHeader directly
- For Connect requests: SetResponseHeader stores headers in HeaderCarrier
- Connect wrappers extract headers from HeaderCarrier and apply to response
This allows service methods to work with both protocols without knowing which one is being used.
func GetHeaderCarrier ¶
func GetHeaderCarrier(ctx context.Context) *HeaderCarrier
GetHeaderCarrier retrieves the header carrier from the context. Returns nil if no carrier is present.
func (*HeaderCarrier) All ¶
func (h *HeaderCarrier) All() map[string]string
All returns all headers.
func (*HeaderCarrier) Get ¶
func (h *HeaderCarrier) Get(key string) string
Get retrieves a header from the carrier.
func (*HeaderCarrier) Set ¶
func (h *HeaderCarrier) Set(key, value string)
Set adds a header to the carrier.
type LoggingInterceptor ¶
type LoggingInterceptor struct {
// contains filtered or unexported fields
}
LoggingInterceptor logs Connect RPC requests with appropriate log levels.
Log levels: - INFO: Successful requests and expected client errors (not found, permission denied, etc.) - ERROR: Server errors (internal, unavailable, etc.)
func NewLoggingInterceptor ¶
func NewLoggingInterceptor(logStacktrace bool) *LoggingInterceptor
NewLoggingInterceptor creates a new logging interceptor.
func (*LoggingInterceptor) WrapStreamingClient ¶
func (*LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (*LoggingInterceptor) WrapStreamingHandler ¶
func (*LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type MetadataInterceptor ¶
type MetadataInterceptor struct{}
MetadataInterceptor converts Connect HTTP headers to gRPC metadata.
This ensures service methods can use metadata.FromIncomingContext() to access headers like User-Agent, X-Forwarded-For, etc., regardless of whether the request came via Connect RPC or gRPC-Gateway.
func NewMetadataInterceptor ¶
func NewMetadataInterceptor() *MetadataInterceptor
NewMetadataInterceptor creates a new metadata interceptor.
func (*MetadataInterceptor) WrapStreamingClient ¶
func (*MetadataInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (*MetadataInterceptor) WrapStreamingHandler ¶
func (*MetadataInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type MetricsOverviewResponse ¶
type MetricsOverviewResponse struct {
TimeRange string `json:"time_range"`
TotalRequests int64 `json:"total_requests"`
SuccessRate float64 `json:"success_rate"`
AvgLatencyMs int64 `json:"avg_latency_ms"`
P50LatencyMs int64 `json:"p50_latency_ms"`
P95LatencyMs int64 `json:"p95_latency_ms"`
ErrorCount int64 `json:"error_count"`
IsMock bool `json:"is_mock"`
}
MetricsOverviewResponse represents the overview response of system metrics.
type RecoveryInterceptor ¶
type RecoveryInterceptor struct {
// contains filtered or unexported fields
}
RecoveryInterceptor recovers from panics in Connect handlers and returns an internal error.
func NewRecoveryInterceptor ¶
func NewRecoveryInterceptor(logStacktrace bool) *RecoveryInterceptor
NewRecoveryInterceptor creates a new recovery interceptor.
func (*RecoveryInterceptor) WrapStreamingClient ¶
func (*RecoveryInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (*RecoveryInterceptor) WrapStreamingHandler ¶
func (*RecoveryInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type ScheduleAgentService ¶
type ScheduleAgentService struct {
v1pb.UnimplementedScheduleAgentServiceServer
Store *store.Store
LLM ai.LLMService
Profile *profile.Profile
ContextStore *agent.ContextStore // TODO: Persist to PostgreSQL for cross-restart context recovery
IntentClassifier *agent.LLMIntentClassifier
}
ScheduleAgentService is a dedicated service for schedule agent interactions.
func NewScheduleAgentService ¶
func NewScheduleAgentService(store *store.Store, llm ai.LLMService, profile *profile.Profile) *ScheduleAgentService
NewScheduleAgentService creates a new schedule agent service.
func (*ScheduleAgentService) Chat ¶
func (s *ScheduleAgentService) Chat(ctx context.Context, req *v1pb.ScheduleAgentChatRequest) (*v1pb.ScheduleAgentChatResponse, error)
Chat handles non-streaming schedule agent chat requests.
func (*ScheduleAgentService) ChatStream ¶
func (s *ScheduleAgentService) ChatStream(req *v1pb.ScheduleAgentChatRequest, stream v1pb.ScheduleAgentService_ChatStreamServer) error
ChatStream handles streaming schedule agent chat requests.
type ScheduleAgentServiceConnectHandler ¶
type ScheduleAgentServiceConnectHandler struct {
// contains filtered or unexported fields
}
ScheduleAgentServiceConnectHandler implements ScheduleAgentServiceHandler interface by delegating to the underlying ScheduleAgentService.
func NewScheduleAgentServiceConnectHandler ¶
func NewScheduleAgentServiceConnectHandler(svc *ScheduleAgentService) *ScheduleAgentServiceConnectHandler
NewScheduleAgentServiceConnectHandler creates a new Connect handler for ScheduleAgentService.
func (*ScheduleAgentServiceConnectHandler) Chat ¶
func (s *ScheduleAgentServiceConnectHandler) Chat(ctx context.Context, req *connect.Request[v1pb.ScheduleAgentChatRequest]) (*connect.Response[v1pb.ScheduleAgentChatResponse], error)
Chat handles non-streaming schedule agent chat requests.
func (*ScheduleAgentServiceConnectHandler) ChatStream ¶
func (s *ScheduleAgentServiceConnectHandler) ChatStream(ctx context.Context, req *connect.Request[v1pb.ScheduleAgentChatRequest], stream *connect.ServerStream[v1pb.ScheduleAgentStreamResponse]) error
ChatStream handles streaming schedule agent chat requests.
type ScheduleService ¶
type ScheduleService struct {
v1pb.UnimplementedScheduleServiceServer
Store *store.Store
LLMService ai.LLMService
}
ScheduleService provides schedule management APIs.
func (*ScheduleService) BatchCreateSchedules ¶
func (s *ScheduleService) BatchCreateSchedules(ctx context.Context, req *v1pb.BatchCreateSchedulesRequest) (*v1pb.BatchCreateSchedulesResponse, error)
BatchCreateSchedules creates multiple schedules from a batch request.
func (*ScheduleService) BatchParseSchedule ¶
func (s *ScheduleService) BatchParseSchedule(ctx context.Context, req *v1pb.BatchParseScheduleRequest) (*v1pb.BatchParseScheduleResponse, error)
BatchParseSchedule parses natural language for batch schedule creation.
func (*ScheduleService) CheckConflict ¶
func (s *ScheduleService) CheckConflict(ctx context.Context, req *v1pb.CheckConflictRequest) (*v1pb.CheckConflictResponse, error)
CheckConflict checks for schedule conflicts.
func (*ScheduleService) CreateSchedule ¶
func (s *ScheduleService) CreateSchedule(ctx context.Context, req *v1pb.CreateScheduleRequest) (*v1pb.Schedule, error)
CreateSchedule creates a new schedule.
func (*ScheduleService) DeleteSchedule ¶
func (s *ScheduleService) DeleteSchedule(ctx context.Context, req *v1pb.DeleteScheduleRequest) (*emptypb.Empty, error)
DeleteSchedule deletes a schedule.
func (*ScheduleService) GetSchedule ¶
func (s *ScheduleService) GetSchedule(ctx context.Context, req *v1pb.GetScheduleRequest) (*v1pb.Schedule, error)
GetSchedule gets a schedule by name.
func (*ScheduleService) ListSchedules ¶
func (s *ScheduleService) ListSchedules(ctx context.Context, req *v1pb.ListSchedulesRequest) (*v1pb.ListSchedulesResponse, error)
ListSchedules lists schedules with filters.
func (*ScheduleService) ParseAndCreateSchedule ¶
func (s *ScheduleService) ParseAndCreateSchedule(ctx context.Context, req *v1pb.ParseAndCreateScheduleRequest) (*v1pb.ParseAndCreateScheduleResponse, error)
ParseAndCreateSchedule parses natural language and creates a schedule.
func (*ScheduleService) PrecheckSchedule ¶
func (s *ScheduleService) PrecheckSchedule(ctx context.Context, req *v1pb.PrecheckScheduleRequest) (*v1pb.PrecheckScheduleResponse, error)
PrecheckSchedule validates a schedule before creation.
func (*ScheduleService) UpdateSchedule ¶
func (s *ScheduleService) UpdateSchedule(ctx context.Context, req *v1pb.UpdateScheduleRequest) (*v1pb.Schedule, error)
UpdateSchedule updates a schedule.
Source Files
¶
- acl_config.go
- activity_service.go
- ai_service.go
- ai_service_chat.go
- ai_service_conversation.go
- ai_service_duplicate.go
- ai_service_graph.go
- ai_service_review.go
- ai_service_semantic.go
- attachment_service.go
- auth_service.go
- common.go
- connect_handler.go
- connect_interceptors.go
- connect_services.go
- header_carrier.go
- health_service.go
- idp_service.go
- instance_service.go
- memo_attachment_service.go
- memo_relation_service.go
- memo_service.go
- memo_service_converter.go
- memo_service_filter.go
- reaction_service.go
- resource_name.go
- schedule_agent_service.go
- schedule_service.go
- shortcut_service.go
- system_metrics.go
- user_service.go
- user_service_stats.go
- v1.go