├── .gitignore
├── api
├── cfg.yaml
└── generate.go
├── server
└── memos
│ └── proto
│ ├── generate.go
│ ├── buf.gen.yaml
│ ├── buf.yaml
│ ├── buf.lock
│ ├── api
│ └── v1
│ │ ├── common.proto
│ │ ├── auth_service.proto
│ │ ├── activity_service.proto
│ │ ├── shortcut_service.proto
│ │ ├── idp_service.proto
│ │ ├── attachment_service.proto
│ │ ├── instance_service.proto
│ │ └── memo_service.proto
│ └── gen
│ └── api
│ └── v1
│ ├── activity_service_grpc.pb.go
│ ├── common.pb.go
│ ├── instance_service_grpc.pb.go
│ ├── auth_service_grpc.pb.go
│ ├── shortcut_service_grpc.pb.go
│ ├── idp_service_grpc.pb.go
│ ├── attachment_service_grpc.pb.go
│ ├── shortcut_service.pb.go
│ ├── auth_service.pb.go
│ └── activity_service.pb.go
├── tools
└── tools.go
├── Dockerfile
├── utils
└── utils.go
├── main.go
├── LICENSE
├── .github
└── workflows
│ ├── build.yml
│ └── pages.yml
├── README.md
└── go.mod
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | /mortis
--------------------------------------------------------------------------------
/api/cfg.yaml:
--------------------------------------------------------------------------------
1 | package: api
2 | output: api.gen.go
3 | generate:
4 | models: true
5 | echo-server: true
--------------------------------------------------------------------------------
/server/memos/proto/generate.go:
--------------------------------------------------------------------------------
1 | package proto
2 |
3 | //go:generate go run github.com/bufbuild/buf/cmd/buf generate
4 |
--------------------------------------------------------------------------------
/api/generate.go:
--------------------------------------------------------------------------------
1 | package api
2 |
3 | //go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config cfg.yaml ./openapi.yaml
4 |
--------------------------------------------------------------------------------
/tools/tools.go:
--------------------------------------------------------------------------------
1 | //go:build tools
2 | // +build tools
3 |
4 | package main
5 |
6 | import (
7 | _ "github.com/bufbuild/buf/cmd/buf"
8 | _ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen"
9 | )
10 |
--------------------------------------------------------------------------------
/server/memos/proto/buf.gen.yaml:
--------------------------------------------------------------------------------
1 | version: v2
2 | clean: true
3 | plugins:
4 | - remote: buf.build/protocolbuffers/go
5 | out: gen
6 | opt: paths=source_relative
7 | - remote: buf.build/grpc/go
8 | out: gen
9 | opt: paths=source_relative
--------------------------------------------------------------------------------
/server/memos/proto/buf.yaml:
--------------------------------------------------------------------------------
1 | # For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
2 | version: v2
3 | lint:
4 | use:
5 | - STANDARD
6 | deps:
7 | - buf.build/googleapis/googleapis
8 | breaking:
9 | use:
10 | - FILE
11 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Build stage
2 | FROM golang:alpine AS builder
3 | WORKDIR /app
4 | COPY go.mod go.sum ./
5 | RUN go mod download
6 | COPY . .
7 | RUN go build -o mortis .
8 |
9 | # Final stage
10 | FROM alpine:latest
11 | WORKDIR /app
12 | COPY --from=builder /app/mortis .
13 | EXPOSE 5431
14 | ENTRYPOINT ["./mortis"]
--------------------------------------------------------------------------------
/server/memos/proto/buf.lock:
--------------------------------------------------------------------------------
1 | # Generated by buf. DO NOT EDIT.
2 | version: v2
3 | deps:
4 | - name: buf.build/googleapis/googleapis
5 | commit: 546238c53f7340c6a2a6099fb863bc1b
6 | digest: b5:e017bbf31a3f912e2b969c03c3aa711f466cfe104f510865d1a8ede1be490240aabd4cca5865459a0f15222747284395f98afc094b0fd086e8917a5a7bdd9db0
7 |
--------------------------------------------------------------------------------
/utils/utils.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | // IntPtr returns a pointer to the given int
4 | func IntPtr(i int) *int {
5 | return &i
6 | }
7 |
8 | // StringPtr returns a pointer to the given string
9 | func StringPtr(s string) *string {
10 | return &s
11 | }
12 |
13 | func BoolPtr(b bool) *bool {
14 | return &b
15 | }
16 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/common.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | option go_package = "gen/api/v1";
6 |
7 | enum State {
8 | STATE_UNSPECIFIED = 0;
9 | NORMAL = 1;
10 | ARCHIVED = 2;
11 | }
12 |
13 | // Used internally for obfuscating the page token.
14 | message PageToken {
15 | int32 limit = 1;
16 | int32 offset = 2;
17 | }
18 |
19 | enum Direction {
20 | DIRECTION_UNSPECIFIED = 0;
21 | ASC = 1;
22 | DESC = 2;
23 | }
24 |
--------------------------------------------------------------------------------
/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "flag"
5 | "fmt"
6 | "log"
7 | "net/http/httputil"
8 | "net/url"
9 |
10 | "github.com/labstack/echo/v4"
11 | "github.com/mudkipme/mortis/api"
12 | "github.com/mudkipme/mortis/server/memos"
13 | )
14 |
15 | func main() {
16 | addr := flag.String("addr", "0.0.0.0", "Listen address")
17 | port := flag.Int("port", 5231, "Listen port")
18 | grpcAddr := flag.String("grpc-addr", "127.0.0.1:5230", "gRPC server address")
19 | flag.Parse()
20 |
21 | server := memos.NewServer(*grpcAddr)
22 |
23 | e := echo.New()
24 |
25 | api.RegisterHandlers(e, server)
26 | e.GET("/o/r/:uid", server.StreamResource)
27 | e.GET("/o/r/:uid/*", server.StreamResource)
28 |
29 | // Default handler - proxy to gRPC address
30 | e.Any("/*", echo.WrapHandler(httputil.NewSingleHostReverseProxy(&url.URL{
31 | Scheme: "http",
32 | Host: *grpcAddr,
33 | })))
34 |
35 | listenAddr := fmt.Sprintf("%s:%d", *addr, *port)
36 | log.Fatal(e.Start(listenAddr))
37 | }
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2025 Mudkip
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build and Release
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout code
13 | uses: actions/checkout@v4
14 |
15 | - name: Set up QEMU
16 | uses: docker/setup-qemu-action@v3
17 |
18 | - name: Set up Docker Buildx
19 | uses: docker/setup-buildx-action@v3
20 |
21 | - name: Login to GitHub Container Registry
22 | uses: docker/login-action@v3
23 | with:
24 | registry: ghcr.io
25 | username: ${{ github.actor }}
26 | password: ${{ secrets.GITHUB_TOKEN }}
27 |
28 | - name: Build and push Docker image
29 | uses: docker/build-push-action@v6
30 | with:
31 | context: .
32 | push: true
33 | tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }},ghcr.io/${{ github.repository }}:latest
34 | platforms: linux/amd64,linux/arm64
35 |
36 | - name: Set up Go
37 | uses: actions/setup-go@v5
38 |
39 | - name: Build binary
40 | run: |
41 | GOARCH=amd64 go build -o mortis-amd64
42 | GOARCH=arm64 go build -o mortis-arm64
43 |
44 | - name: Compress binary
45 | run: |
46 | tar -czvf mortis-amd64.tar.gz mortis-amd64
47 | tar -czvf mortis-arm64.tar.gz mortis-arm64
48 |
49 | - name: Upload binary to GitHub Release
50 | uses: softprops/action-gh-release@v2
51 | with:
52 | files: |
53 | mortis-amd64.tar.gz
54 | mortis-arm64.tar.gz
--------------------------------------------------------------------------------
/.github/workflows/pages.yml:
--------------------------------------------------------------------------------
1 | name: Deploy Swagger UI to Pages
2 |
3 | on:
4 | push:
5 | branches: ["main"]
6 | workflow_dispatch:
7 |
8 | permissions:
9 | contents: read
10 | pages: write
11 | id-token: write
12 |
13 | concurrency:
14 | group: "pages"
15 | cancel-in-progress: false
16 |
17 | jobs:
18 | deploy:
19 | environment:
20 | name: github-pages
21 | url: ${{ steps.deployment.outputs.page_url }}
22 | runs-on: ubuntu-latest
23 | steps:
24 | - name: Checkout
25 | uses: actions/checkout@v4
26 |
27 | - name: Setup Pages
28 | uses: actions/configure-pages@v5
29 |
30 | - name: Create Swagger UI
31 | run: |
32 | mkdir swagger-ui
33 | wget -O swagger-ui/swagger-ui-bundle.js https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js
34 | wget -O swagger-ui/swagger-ui.css https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css
35 | cat > swagger-ui/index.html << 'EOF'
36 |
37 |
38 |
39 |
40 | API Documentation
41 |
42 |
43 |
44 |
45 |
46 |
54 |
55 |
56 | EOF
57 | cp api/openapi.yaml swagger-ui/
58 |
59 | - name: Upload artifact
60 | uses: actions/upload-pages-artifact@v3
61 | with:
62 | path: 'swagger-ui'
63 |
64 | - name: Deploy to GitHub Pages
65 | id: deployment
66 | uses: actions/deploy-pages@v4
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Mortis - A Self-Hosted Server for Moe Memos
2 |
3 | A self-hosted server that provides [Memos 0.21.0 OpenAPI](https://mudkipme.github.io/mortis/) support for compatible apps like Moe Memos.
4 |
5 | Currently, it is implemented to use the latest Memos server as a backend.
6 |
7 | ## Usage
8 |
9 | The server can be started with the following command:
10 |
11 | ```bash
12 | mortis [flags]
13 | ```
14 |
15 | Available flags:
16 |
17 | * `-addr string`: Listen address (default "0.0.0.0")
18 | * `-port int`: Listen port (default 5231)
19 | * `-grpc-addr string`: gRPC server address of Memos server (default "127.0.0.1:5230")
20 |
21 | The `-grpc-addr` flag should point directly to your Memos instance. Reverse proxy is not currently supported since Mortis connects to Memos using the gRPC protocol, and gRPC-Web protocol is not yet implemented. However, Mortis itself can be placed behind a reverse proxy.
22 |
23 | You can use the same domain for both Memos and Mortis by proxying paths with the `/api/v1/` prefix to Mortis.
24 |
25 | ### Nginx Configuration Example
26 |
27 | Here is an example of an Nginx configuration to proxy requests to both Memos and Mortis:
28 |
29 | ```nginx
30 | server {
31 | listen 80;
32 | server_name yourdomain.com;
33 |
34 | location / {
35 | proxy_pass http://127.0.0.1:5230; # Memos server
36 | proxy_set_header Host $host;
37 | proxy_set_header X-Real-IP $remote_addr;
38 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
39 | proxy_set_header X-Forwarded-Proto $scheme;
40 | }
41 |
42 | location /api/v1/ {
43 | proxy_pass http://127.0.0.1:5231; # Mortis server
44 | proxy_set_header Host $host;
45 | proxy_set_header X-Real-IP $remote_addr;
46 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
47 | proxy_set_header X-Forwarded-Proto $scheme;
48 | }
49 |
50 | location /o/r/ {
51 | proxy_pass http://127.0.0.1:5231; # Mortis server
52 | proxy_set_header Host $host;
53 | proxy_set_header X-Real-IP $remote_addr;
54 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
55 | proxy_set_header X-Forwarded-Proto $scheme;
56 | }
57 | }
58 | ```
59 |
60 | ### Caddy Configuration Example
61 |
62 | Or if you prefer using caddy, here is an example of a configuration to proxy requests to both Memos and Mortis:
63 |
64 | ```caddyfile
65 | yourdomain.com {
66 | reverse_proxy /api/v1/* mortis:5231
67 | reverse_proxy /o/r/* mortis:5231
68 | reverse_proxy memos:5230
69 | }
70 | ```
71 |
72 | ### Docker Compose Example
73 |
74 | Here is an example `docker-compose.yml` file to run both Memos and Mortis:
75 |
76 | ```yaml
77 | services:
78 | memos:
79 | image: neosmemo/memos:0.25.3
80 | container_name: memos
81 | volumes:
82 | - ./data:/var/opt/memos
83 | ports:
84 | - "5230:5230"
85 |
86 | mortis:
87 | image: ghcr.io/mudkipme/mortis:0.25.3
88 | container_name: mortis
89 | ports:
90 | - "5231:5231"
91 | entrypoint: ["/app/mortis"]
92 | command: ["-grpc-addr=memos:5230"]
93 | depends_on:
94 | - memos
95 | ```
96 |
97 | ## License
98 |
99 | [MIT](LICENSE)
100 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/auth_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "api/v1/user_service.proto";
6 | import "google/api/annotations.proto";
7 | import "google/api/field_behavior.proto";
8 | import "google/protobuf/empty.proto";
9 | import "google/protobuf/timestamp.proto";
10 |
11 | option go_package = "gen/api/v1";
12 |
13 | service AuthService {
14 | // GetCurrentSession returns the current active session information.
15 | // This method is idempotent and safe, suitable for checking current session state.
16 | rpc GetCurrentSession(GetCurrentSessionRequest) returns (GetCurrentSessionResponse) {
17 | option (google.api.http) = {get: "/api/v1/auth/sessions/current"};
18 | }
19 |
20 | // CreateSession authenticates a user and creates a new session.
21 | // Returns the authenticated user information upon successful authentication.
22 | rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse) {
23 | option (google.api.http) = {
24 | post: "/api/v1/auth/sessions"
25 | body: "*"
26 | };
27 | }
28 |
29 | // DeleteSession terminates the current user session.
30 | // This is an idempotent operation that invalidates the user's authentication.
31 | rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) {
32 | option (google.api.http) = {delete: "/api/v1/auth/sessions/current"};
33 | }
34 | }
35 |
36 | message GetCurrentSessionRequest {}
37 |
38 | message GetCurrentSessionResponse {
39 | User user = 1;
40 |
41 | // Last time the session was accessed.
42 | // Used for sliding expiration calculation (last_accessed_time + 2 weeks).
43 | google.protobuf.Timestamp last_accessed_at = 2;
44 | }
45 |
46 | message CreateSessionRequest {
47 | // Nested message for password-based authentication credentials.
48 | message PasswordCredentials {
49 | // The username to sign in with.
50 | // Required field for password-based authentication.
51 | string username = 1 [(google.api.field_behavior) = REQUIRED];
52 |
53 | // The password to sign in with.
54 | // Required field for password-based authentication.
55 | string password = 2 [(google.api.field_behavior) = REQUIRED];
56 | }
57 |
58 | // Nested message for SSO authentication credentials.
59 | message SSOCredentials {
60 | // The ID of the SSO provider.
61 | // Required field to identify the SSO provider.
62 | int32 idp_id = 1 [(google.api.field_behavior) = REQUIRED];
63 |
64 | // The authorization code from the SSO provider.
65 | // Required field for completing the SSO flow.
66 | string code = 2 [(google.api.field_behavior) = REQUIRED];
67 |
68 | // The redirect URI used in the SSO flow.
69 | // Required field for security validation.
70 | string redirect_uri = 3 [(google.api.field_behavior) = REQUIRED];
71 | }
72 |
73 | // Provide one authentication method (username/password or SSO).
74 | // Required field to specify the authentication method.
75 | oneof credentials {
76 | // Username and password authentication method.
77 | PasswordCredentials password_credentials = 1;
78 |
79 | // SSO provider authentication method.
80 | SSOCredentials sso_credentials = 2;
81 | }
82 | }
83 |
84 | message CreateSessionResponse {
85 | // The authenticated user information.
86 | User user = 1;
87 |
88 | // Last time the session was accessed.
89 | // Used for sliding expiration calculation (last_accessed_time + 2 weeks).
90 | google.protobuf.Timestamp last_accessed_at = 2;
91 | }
92 |
93 | message DeleteSessionRequest {}
94 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/activity_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "google/api/annotations.proto";
6 | import "google/api/client.proto";
7 | import "google/api/field_behavior.proto";
8 | import "google/api/resource.proto";
9 | import "google/protobuf/timestamp.proto";
10 |
11 | option go_package = "gen/api/v1";
12 |
13 | service ActivityService {
14 | // ListActivities returns a list of activities.
15 | rpc ListActivities(ListActivitiesRequest) returns (ListActivitiesResponse) {
16 | option (google.api.http) = {get: "/api/v1/activities"};
17 | }
18 |
19 | // GetActivity returns the activity with the given id.
20 | rpc GetActivity(GetActivityRequest) returns (Activity) {
21 | option (google.api.http) = {get: "/api/v1/{name=activities/*}"};
22 | option (google.api.method_signature) = "name";
23 | }
24 | }
25 |
26 | message Activity {
27 | option (google.api.resource) = {
28 | type: "memos.api.v1/Activity"
29 | pattern: "activities/{activity}"
30 | name_field: "name"
31 | singular: "activity"
32 | plural: "activities"
33 | };
34 |
35 | // The name of the activity.
36 | // Format: activities/{id}
37 | string name = 1 [
38 | (google.api.field_behavior) = OUTPUT_ONLY,
39 | (google.api.field_behavior) = IDENTIFIER
40 | ];
41 |
42 | // The name of the creator.
43 | // Format: users/{user}
44 | string creator = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
45 |
46 | // The type of the activity.
47 | Type type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
48 |
49 | // The level of the activity.
50 | Level level = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
51 |
52 | // The create time of the activity.
53 | google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
54 |
55 | // The payload of the activity.
56 | ActivityPayload payload = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
57 |
58 | // Activity types.
59 | enum Type {
60 | // Unspecified type.
61 | TYPE_UNSPECIFIED = 0;
62 | // Memo comment activity.
63 | MEMO_COMMENT = 1;
64 | }
65 |
66 | // Activity levels.
67 | enum Level {
68 | // Unspecified level.
69 | LEVEL_UNSPECIFIED = 0;
70 | // Info level.
71 | INFO = 1;
72 | // Warn level.
73 | WARN = 2;
74 | // Error level.
75 | ERROR = 3;
76 | }
77 | }
78 |
79 | message ActivityPayload {
80 | oneof payload {
81 | // Memo comment activity payload.
82 | ActivityMemoCommentPayload memo_comment = 1;
83 | }
84 | }
85 |
86 | // ActivityMemoCommentPayload represents the payload of a memo comment activity.
87 | message ActivityMemoCommentPayload {
88 | // The memo name of comment.
89 | // Format: memos/{memo}
90 | string memo = 1;
91 | // The name of related memo.
92 | // Format: memos/{memo}
93 | string related_memo = 2;
94 | }
95 |
96 | message ListActivitiesRequest {
97 | // The maximum number of activities to return.
98 | // The service may return fewer than this value.
99 | // If unspecified, at most 100 activities will be returned.
100 | // The maximum value is 1000; values above 1000 will be coerced to 1000.
101 | int32 page_size = 1;
102 |
103 | // A page token, received from a previous `ListActivities` call.
104 | // Provide this to retrieve the subsequent page.
105 | string page_token = 2;
106 | }
107 |
108 | message ListActivitiesResponse {
109 | // The activities.
110 | repeated Activity activities = 1;
111 |
112 | // A token to retrieve the next page of results.
113 | // Pass this value in the page_token field in the subsequent call to `ListActivities`
114 | // method to retrieve the next page of results.
115 | string next_page_token = 2;
116 | }
117 |
118 | message GetActivityRequest {
119 | // The name of the activity.
120 | // Format: activities/{id}, id is the system generated auto-incremented id.
121 | string name = 1 [
122 | (google.api.field_behavior) = REQUIRED,
123 | (google.api.resource_reference) = {type: "memos.api.v1/Activity"}
124 | ];
125 | }
126 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/shortcut_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "google/api/annotations.proto";
6 | import "google/api/client.proto";
7 | import "google/api/field_behavior.proto";
8 | import "google/api/resource.proto";
9 | import "google/protobuf/empty.proto";
10 | import "google/protobuf/field_mask.proto";
11 |
12 | option go_package = "gen/api/v1";
13 |
14 | service ShortcutService {
15 | // ListShortcuts returns a list of shortcuts for a user.
16 | rpc ListShortcuts(ListShortcutsRequest) returns (ListShortcutsResponse) {
17 | option (google.api.http) = {get: "/api/v1/{parent=users/*}/shortcuts"};
18 | option (google.api.method_signature) = "parent";
19 | }
20 |
21 | // GetShortcut gets a shortcut by name.
22 | rpc GetShortcut(GetShortcutRequest) returns (Shortcut) {
23 | option (google.api.http) = {get: "/api/v1/{name=users/*/shortcuts/*}"};
24 | option (google.api.method_signature) = "name";
25 | }
26 |
27 | // CreateShortcut creates a new shortcut for a user.
28 | rpc CreateShortcut(CreateShortcutRequest) returns (Shortcut) {
29 | option (google.api.http) = {
30 | post: "/api/v1/{parent=users/*}/shortcuts"
31 | body: "shortcut"
32 | };
33 | option (google.api.method_signature) = "parent,shortcut";
34 | }
35 |
36 | // UpdateShortcut updates a shortcut for a user.
37 | rpc UpdateShortcut(UpdateShortcutRequest) returns (Shortcut) {
38 | option (google.api.http) = {
39 | patch: "/api/v1/{shortcut.name=users/*/shortcuts/*}"
40 | body: "shortcut"
41 | };
42 | option (google.api.method_signature) = "shortcut,update_mask";
43 | }
44 |
45 | // DeleteShortcut deletes a shortcut for a user.
46 | rpc DeleteShortcut(DeleteShortcutRequest) returns (google.protobuf.Empty) {
47 | option (google.api.http) = {delete: "/api/v1/{name=users/*/shortcuts/*}"};
48 | option (google.api.method_signature) = "name";
49 | }
50 | }
51 |
52 | message Shortcut {
53 | option (google.api.resource) = {
54 | type: "memos.api.v1/Shortcut"
55 | pattern: "users/{user}/shortcuts/{shortcut}"
56 | singular: "shortcut"
57 | plural: "shortcuts"
58 | };
59 |
60 | // The resource name of the shortcut.
61 | // Format: users/{user}/shortcuts/{shortcut}
62 | string name = 1 [(google.api.field_behavior) = IDENTIFIER];
63 |
64 | // The title of the shortcut.
65 | string title = 2 [(google.api.field_behavior) = REQUIRED];
66 |
67 | // The filter expression for the shortcut.
68 | string filter = 3 [(google.api.field_behavior) = OPTIONAL];
69 | }
70 |
71 | message ListShortcutsRequest {
72 | // Required. The parent resource where shortcuts are listed.
73 | // Format: users/{user}
74 | string parent = 1 [
75 | (google.api.field_behavior) = REQUIRED,
76 | (google.api.resource_reference) = {child_type: "memos.api.v1/Shortcut"}
77 | ];
78 | }
79 |
80 | message ListShortcutsResponse {
81 | // The list of shortcuts.
82 | repeated Shortcut shortcuts = 1;
83 | }
84 |
85 | message GetShortcutRequest {
86 | // Required. The resource name of the shortcut to retrieve.
87 | // Format: users/{user}/shortcuts/{shortcut}
88 | string name = 1 [
89 | (google.api.field_behavior) = REQUIRED,
90 | (google.api.resource_reference) = {type: "memos.api.v1/Shortcut"}
91 | ];
92 | }
93 |
94 | message CreateShortcutRequest {
95 | // Required. The parent resource where this shortcut will be created.
96 | // Format: users/{user}
97 | string parent = 1 [
98 | (google.api.field_behavior) = REQUIRED,
99 | (google.api.resource_reference) = {child_type: "memos.api.v1/Shortcut"}
100 | ];
101 |
102 | // Required. The shortcut to create.
103 | Shortcut shortcut = 2 [(google.api.field_behavior) = REQUIRED];
104 |
105 | // Optional. If set, validate the request, but do not actually create the shortcut.
106 | bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
107 | }
108 |
109 | message UpdateShortcutRequest {
110 | // Required. The shortcut resource which replaces the resource on the server.
111 | Shortcut shortcut = 1 [(google.api.field_behavior) = REQUIRED];
112 |
113 | // Optional. The list of fields to update.
114 | google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
115 | }
116 |
117 | message DeleteShortcutRequest {
118 | // Required. The resource name of the shortcut to delete.
119 | // Format: users/{user}/shortcuts/{shortcut}
120 | string name = 1 [
121 | (google.api.field_behavior) = REQUIRED,
122 | (google.api.resource_reference) = {type: "memos.api.v1/Shortcut"}
123 | ];
124 | }
125 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/idp_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "google/api/annotations.proto";
6 | import "google/api/client.proto";
7 | import "google/api/field_behavior.proto";
8 | import "google/api/resource.proto";
9 | import "google/protobuf/empty.proto";
10 | import "google/protobuf/field_mask.proto";
11 |
12 | option go_package = "gen/api/v1";
13 |
14 | service IdentityProviderService {
15 | // ListIdentityProviders lists identity providers.
16 | rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) {
17 | option (google.api.http) = {get: "/api/v1/identity-providers"};
18 | }
19 |
20 | // GetIdentityProvider gets an identity provider.
21 | rpc GetIdentityProvider(GetIdentityProviderRequest) returns (IdentityProvider) {
22 | option (google.api.http) = {get: "/api/v1/{name=identity-providers/*}"};
23 | option (google.api.method_signature) = "name";
24 | }
25 |
26 | // CreateIdentityProvider creates an identity provider.
27 | rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (IdentityProvider) {
28 | option (google.api.http) = {
29 | post: "/api/v1/identity-providers"
30 | body: "identity_provider"
31 | };
32 | option (google.api.method_signature) = "identity_provider";
33 | }
34 |
35 | // UpdateIdentityProvider updates an identity provider.
36 | rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (IdentityProvider) {
37 | option (google.api.http) = {
38 | patch: "/api/v1/{identity_provider.name=identity-providers/*}"
39 | body: "identity_provider"
40 | };
41 | option (google.api.method_signature) = "identity_provider,update_mask";
42 | }
43 |
44 | // DeleteIdentityProvider deletes an identity provider.
45 | rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (google.protobuf.Empty) {
46 | option (google.api.http) = {delete: "/api/v1/{name=identity-providers/*}"};
47 | option (google.api.method_signature) = "name";
48 | }
49 | }
50 |
51 | message IdentityProvider {
52 | option (google.api.resource) = {
53 | type: "memos.api.v1/IdentityProvider"
54 | pattern: "identity-providers/{idp}"
55 | name_field: "name"
56 | singular: "identityProvider"
57 | plural: "identityProviders"
58 | };
59 |
60 | // The resource name of the identity provider.
61 | // Format: identity-providers/{idp}
62 | string name = 1 [(google.api.field_behavior) = IDENTIFIER];
63 |
64 | // Required. The type of the identity provider.
65 | Type type = 2 [(google.api.field_behavior) = REQUIRED];
66 |
67 | // Required. The display title of the identity provider.
68 | string title = 3 [(google.api.field_behavior) = REQUIRED];
69 |
70 | // Optional. Filter applied to user identifiers.
71 | string identifier_filter = 4 [(google.api.field_behavior) = OPTIONAL];
72 |
73 | // Required. Configuration for the identity provider.
74 | IdentityProviderConfig config = 5 [(google.api.field_behavior) = REQUIRED];
75 |
76 | enum Type {
77 | TYPE_UNSPECIFIED = 0;
78 | // OAuth2 identity provider.
79 | OAUTH2 = 1;
80 | }
81 | }
82 |
83 | message IdentityProviderConfig {
84 | oneof config {
85 | OAuth2Config oauth2_config = 1;
86 | }
87 | }
88 |
89 | message FieldMapping {
90 | string identifier = 1;
91 | string display_name = 2;
92 | string email = 3;
93 | string avatar_url = 4;
94 | }
95 |
96 | message OAuth2Config {
97 | string client_id = 1;
98 | string client_secret = 2;
99 | string auth_url = 3;
100 | string token_url = 4;
101 | string user_info_url = 5;
102 | repeated string scopes = 6;
103 | FieldMapping field_mapping = 7;
104 | }
105 |
106 | message ListIdentityProvidersRequest {}
107 |
108 | message ListIdentityProvidersResponse {
109 | // The list of identity providers.
110 | repeated IdentityProvider identity_providers = 1;
111 | }
112 |
113 | message GetIdentityProviderRequest {
114 | // Required. The resource name of the identity provider to get.
115 | // Format: identity-providers/{idp}
116 | string name = 1 [
117 | (google.api.field_behavior) = REQUIRED,
118 | (google.api.resource_reference) = {type: "memos.api.v1/IdentityProvider"}
119 | ];
120 | }
121 |
122 | message CreateIdentityProviderRequest {
123 | // Required. The identity provider to create.
124 | IdentityProvider identity_provider = 1 [(google.api.field_behavior) = REQUIRED];
125 |
126 | // Optional. The ID to use for the identity provider, which will become the final component of the resource name.
127 | // If not provided, the system will generate one.
128 | string identity_provider_id = 2 [(google.api.field_behavior) = OPTIONAL];
129 | }
130 |
131 | message UpdateIdentityProviderRequest {
132 | // Required. The identity provider to update.
133 | IdentityProvider identity_provider = 1 [(google.api.field_behavior) = REQUIRED];
134 |
135 | // Required. The update mask applies to the resource. Only the top level fields of
136 | // IdentityProvider are supported.
137 | google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
138 | }
139 |
140 | message DeleteIdentityProviderRequest {
141 | // Required. The resource name of the identity provider to delete.
142 | // Format: identity-providers/{idp}
143 | string name = 1 [
144 | (google.api.field_behavior) = REQUIRED,
145 | (google.api.resource_reference) = {type: "memos.api.v1/IdentityProvider"}
146 | ];
147 | }
148 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/attachment_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "google/api/annotations.proto";
6 | import "google/api/client.proto";
7 | import "google/api/field_behavior.proto";
8 | import "google/api/httpbody.proto";
9 | import "google/api/resource.proto";
10 | import "google/protobuf/empty.proto";
11 | import "google/protobuf/field_mask.proto";
12 | import "google/protobuf/timestamp.proto";
13 |
14 | option go_package = "gen/api/v1";
15 |
16 | service AttachmentService {
17 | // CreateAttachment creates a new attachment.
18 | rpc CreateAttachment(CreateAttachmentRequest) returns (Attachment) {
19 | option (google.api.http) = {
20 | post: "/api/v1/attachments"
21 | body: "attachment"
22 | };
23 | option (google.api.method_signature) = "attachment";
24 | }
25 | // ListAttachments lists all attachments.
26 | rpc ListAttachments(ListAttachmentsRequest) returns (ListAttachmentsResponse) {
27 | option (google.api.http) = {get: "/api/v1/attachments"};
28 | }
29 | // GetAttachment returns a attachment by name.
30 | rpc GetAttachment(GetAttachmentRequest) returns (Attachment) {
31 | option (google.api.http) = {get: "/api/v1/{name=attachments/*}"};
32 | option (google.api.method_signature) = "name";
33 | }
34 | // GetAttachmentBinary returns a attachment binary by name.
35 | rpc GetAttachmentBinary(GetAttachmentBinaryRequest) returns (google.api.HttpBody) {
36 | option (google.api.http) = {get: "/file/{name=attachments/*}/{filename}"};
37 | option (google.api.method_signature) = "name,filename,thumbnail";
38 | }
39 | // UpdateAttachment updates a attachment.
40 | rpc UpdateAttachment(UpdateAttachmentRequest) returns (Attachment) {
41 | option (google.api.http) = {
42 | patch: "/api/v1/{attachment.name=attachments/*}"
43 | body: "attachment"
44 | };
45 | option (google.api.method_signature) = "attachment,update_mask";
46 | }
47 | // DeleteAttachment deletes a attachment by name.
48 | rpc DeleteAttachment(DeleteAttachmentRequest) returns (google.protobuf.Empty) {
49 | option (google.api.http) = {delete: "/api/v1/{name=attachments/*}"};
50 | option (google.api.method_signature) = "name";
51 | }
52 | }
53 |
54 | message Attachment {
55 | option (google.api.resource) = {
56 | type: "memos.api.v1/Attachment"
57 | pattern: "attachments/{attachment}"
58 | singular: "attachment"
59 | plural: "attachments"
60 | };
61 |
62 | // The name of the attachment.
63 | // Format: attachments/{attachment}
64 | string name = 1 [(google.api.field_behavior) = IDENTIFIER];
65 |
66 | // Output only. The creation timestamp.
67 | google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
68 |
69 | // The filename of the attachment.
70 | string filename = 3 [(google.api.field_behavior) = REQUIRED];
71 |
72 | // Input only. The content of the attachment.
73 | bytes content = 4 [(google.api.field_behavior) = INPUT_ONLY];
74 |
75 | // Optional. The external link of the attachment.
76 | string external_link = 5 [(google.api.field_behavior) = OPTIONAL];
77 |
78 | // The MIME type of the attachment.
79 | string type = 6 [(google.api.field_behavior) = REQUIRED];
80 |
81 | // Output only. The size of the attachment in bytes.
82 | int64 size = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
83 |
84 | // Optional. The related memo. Refer to `Memo.name`.
85 | // Format: memos/{memo}
86 | optional string memo = 8 [(google.api.field_behavior) = OPTIONAL];
87 | }
88 |
89 | message CreateAttachmentRequest {
90 | // Required. The attachment to create.
91 | Attachment attachment = 1 [(google.api.field_behavior) = REQUIRED];
92 |
93 | // Optional. The attachment ID to use for this attachment.
94 | // If empty, a unique ID will be generated.
95 | string attachment_id = 2 [(google.api.field_behavior) = OPTIONAL];
96 | }
97 |
98 | message ListAttachmentsRequest {
99 | // Optional. The maximum number of attachments to return.
100 | // The service may return fewer than this value.
101 | // If unspecified, at most 50 attachments will be returned.
102 | // The maximum value is 1000; values above 1000 will be coerced to 1000.
103 | int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
104 |
105 | // Optional. A page token, received from a previous `ListAttachments` call.
106 | // Provide this to retrieve the subsequent page.
107 | string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
108 |
109 | // Optional. Filter to apply to the list results.
110 | // Example: "type=image/png" or "filename:*.jpg"
111 | // Supported operators: =, !=, <, <=, >, >=, :
112 | // Supported fields: filename, type, size, create_time, memo
113 | string filter = 3 [(google.api.field_behavior) = OPTIONAL];
114 |
115 | // Optional. The order to sort results by.
116 | // Example: "create_time desc" or "filename asc"
117 | string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
118 | }
119 |
120 | message ListAttachmentsResponse {
121 | // The list of attachments.
122 | repeated Attachment attachments = 1;
123 |
124 | // A token that can be sent as `page_token` to retrieve the next page.
125 | // If this field is omitted, there are no subsequent pages.
126 | string next_page_token = 2;
127 |
128 | // The total count of attachments (may be approximate).
129 | int32 total_size = 3;
130 | }
131 |
132 | message GetAttachmentRequest {
133 | // Required. The attachment name of the attachment to retrieve.
134 | // Format: attachments/{attachment}
135 | string name = 1 [
136 | (google.api.field_behavior) = REQUIRED,
137 | (google.api.resource_reference) = {type: "memos.api.v1/Attachment"}
138 | ];
139 | }
140 |
141 | message GetAttachmentBinaryRequest {
142 | // Required. The attachment name of the attachment.
143 | // Format: attachments/{attachment}
144 | string name = 1 [
145 | (google.api.field_behavior) = REQUIRED,
146 | (google.api.resource_reference) = {type: "memos.api.v1/Attachment"}
147 | ];
148 |
149 | // The filename of the attachment. Mainly used for downloading.
150 | string filename = 2 [(google.api.field_behavior) = REQUIRED];
151 |
152 | // Optional. A flag indicating if the thumbnail version of the attachment should be returned.
153 | bool thumbnail = 3 [(google.api.field_behavior) = OPTIONAL];
154 | }
155 |
156 | message UpdateAttachmentRequest {
157 | // Required. The attachment which replaces the attachment on the server.
158 | Attachment attachment = 1 [(google.api.field_behavior) = REQUIRED];
159 |
160 | // Required. The list of fields to update.
161 | google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
162 | }
163 |
164 | message DeleteAttachmentRequest {
165 | // Required. The attachment name of the attachment to delete.
166 | // Format: attachments/{attachment}
167 | string name = 1 [
168 | (google.api.field_behavior) = REQUIRED,
169 | (google.api.resource_reference) = {type: "memos.api.v1/Attachment"}
170 | ];
171 | }
172 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/activity_service_grpc.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 | // versions:
3 | // - protoc-gen-go-grpc v1.5.1
4 | // - protoc (unknown)
5 | // source: api/v1/activity_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | context "context"
11 | grpc "google.golang.org/grpc"
12 | codes "google.golang.org/grpc/codes"
13 | status "google.golang.org/grpc/status"
14 | )
15 |
16 | // This is a compile-time assertion to ensure that this generated file
17 | // is compatible with the grpc package it is being compiled against.
18 | // Requires gRPC-Go v1.64.0 or later.
19 | const _ = grpc.SupportPackageIsVersion9
20 |
21 | const (
22 | ActivityService_ListActivities_FullMethodName = "/memos.api.v1.ActivityService/ListActivities"
23 | ActivityService_GetActivity_FullMethodName = "/memos.api.v1.ActivityService/GetActivity"
24 | )
25 |
26 | // ActivityServiceClient is the client API for ActivityService service.
27 | //
28 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
29 | type ActivityServiceClient interface {
30 | // ListActivities returns a list of activities.
31 | ListActivities(ctx context.Context, in *ListActivitiesRequest, opts ...grpc.CallOption) (*ListActivitiesResponse, error)
32 | // GetActivity returns the activity with the given id.
33 | GetActivity(ctx context.Context, in *GetActivityRequest, opts ...grpc.CallOption) (*Activity, error)
34 | }
35 |
36 | type activityServiceClient struct {
37 | cc grpc.ClientConnInterface
38 | }
39 |
40 | func NewActivityServiceClient(cc grpc.ClientConnInterface) ActivityServiceClient {
41 | return &activityServiceClient{cc}
42 | }
43 |
44 | func (c *activityServiceClient) ListActivities(ctx context.Context, in *ListActivitiesRequest, opts ...grpc.CallOption) (*ListActivitiesResponse, error) {
45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
46 | out := new(ListActivitiesResponse)
47 | err := c.cc.Invoke(ctx, ActivityService_ListActivities_FullMethodName, in, out, cOpts...)
48 | if err != nil {
49 | return nil, err
50 | }
51 | return out, nil
52 | }
53 |
54 | func (c *activityServiceClient) GetActivity(ctx context.Context, in *GetActivityRequest, opts ...grpc.CallOption) (*Activity, error) {
55 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
56 | out := new(Activity)
57 | err := c.cc.Invoke(ctx, ActivityService_GetActivity_FullMethodName, in, out, cOpts...)
58 | if err != nil {
59 | return nil, err
60 | }
61 | return out, nil
62 | }
63 |
64 | // ActivityServiceServer is the server API for ActivityService service.
65 | // All implementations must embed UnimplementedActivityServiceServer
66 | // for forward compatibility.
67 | type ActivityServiceServer interface {
68 | // ListActivities returns a list of activities.
69 | ListActivities(context.Context, *ListActivitiesRequest) (*ListActivitiesResponse, error)
70 | // GetActivity returns the activity with the given id.
71 | GetActivity(context.Context, *GetActivityRequest) (*Activity, error)
72 | mustEmbedUnimplementedActivityServiceServer()
73 | }
74 |
75 | // UnimplementedActivityServiceServer must be embedded to have
76 | // forward compatible implementations.
77 | //
78 | // NOTE: this should be embedded by value instead of pointer to avoid a nil
79 | // pointer dereference when methods are called.
80 | type UnimplementedActivityServiceServer struct{}
81 |
82 | func (UnimplementedActivityServiceServer) ListActivities(context.Context, *ListActivitiesRequest) (*ListActivitiesResponse, error) {
83 | return nil, status.Errorf(codes.Unimplemented, "method ListActivities not implemented")
84 | }
85 | func (UnimplementedActivityServiceServer) GetActivity(context.Context, *GetActivityRequest) (*Activity, error) {
86 | return nil, status.Errorf(codes.Unimplemented, "method GetActivity not implemented")
87 | }
88 | func (UnimplementedActivityServiceServer) mustEmbedUnimplementedActivityServiceServer() {}
89 | func (UnimplementedActivityServiceServer) testEmbeddedByValue() {}
90 |
91 | // UnsafeActivityServiceServer may be embedded to opt out of forward compatibility for this service.
92 | // Use of this interface is not recommended, as added methods to ActivityServiceServer will
93 | // result in compilation errors.
94 | type UnsafeActivityServiceServer interface {
95 | mustEmbedUnimplementedActivityServiceServer()
96 | }
97 |
98 | func RegisterActivityServiceServer(s grpc.ServiceRegistrar, srv ActivityServiceServer) {
99 | // If the following call pancis, it indicates UnimplementedActivityServiceServer was
100 | // embedded by pointer and is nil. This will cause panics if an
101 | // unimplemented method is ever invoked, so we test this at initialization
102 | // time to prevent it from happening at runtime later due to I/O.
103 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
104 | t.testEmbeddedByValue()
105 | }
106 | s.RegisterService(&ActivityService_ServiceDesc, srv)
107 | }
108 |
109 | func _ActivityService_ListActivities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
110 | in := new(ListActivitiesRequest)
111 | if err := dec(in); err != nil {
112 | return nil, err
113 | }
114 | if interceptor == nil {
115 | return srv.(ActivityServiceServer).ListActivities(ctx, in)
116 | }
117 | info := &grpc.UnaryServerInfo{
118 | Server: srv,
119 | FullMethod: ActivityService_ListActivities_FullMethodName,
120 | }
121 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
122 | return srv.(ActivityServiceServer).ListActivities(ctx, req.(*ListActivitiesRequest))
123 | }
124 | return interceptor(ctx, in, info, handler)
125 | }
126 |
127 | func _ActivityService_GetActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
128 | in := new(GetActivityRequest)
129 | if err := dec(in); err != nil {
130 | return nil, err
131 | }
132 | if interceptor == nil {
133 | return srv.(ActivityServiceServer).GetActivity(ctx, in)
134 | }
135 | info := &grpc.UnaryServerInfo{
136 | Server: srv,
137 | FullMethod: ActivityService_GetActivity_FullMethodName,
138 | }
139 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
140 | return srv.(ActivityServiceServer).GetActivity(ctx, req.(*GetActivityRequest))
141 | }
142 | return interceptor(ctx, in, info, handler)
143 | }
144 |
145 | // ActivityService_ServiceDesc is the grpc.ServiceDesc for ActivityService service.
146 | // It's only intended for direct use with grpc.RegisterService,
147 | // and not to be introspected or modified (even as a copy)
148 | var ActivityService_ServiceDesc = grpc.ServiceDesc{
149 | ServiceName: "memos.api.v1.ActivityService",
150 | HandlerType: (*ActivityServiceServer)(nil),
151 | Methods: []grpc.MethodDesc{
152 | {
153 | MethodName: "ListActivities",
154 | Handler: _ActivityService_ListActivities_Handler,
155 | },
156 | {
157 | MethodName: "GetActivity",
158 | Handler: _ActivityService_GetActivity_Handler,
159 | },
160 | },
161 | Streams: []grpc.StreamDesc{},
162 | Metadata: "api/v1/activity_service.proto",
163 | }
164 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/instance_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "google/api/annotations.proto";
6 | import "google/api/client.proto";
7 | import "google/api/field_behavior.proto";
8 | import "google/api/resource.proto";
9 | import "google/protobuf/field_mask.proto";
10 |
11 | option go_package = "gen/api/v1";
12 |
13 | service InstanceService {
14 | // Gets the instance profile.
15 | rpc GetInstanceProfile(GetInstanceProfileRequest) returns (InstanceProfile) {
16 | option (google.api.http) = {get: "/api/v1/instance/profile"};
17 | }
18 |
19 | // Gets an instance setting.
20 | rpc GetInstanceSetting(GetInstanceSettingRequest) returns (InstanceSetting) {
21 | option (google.api.http) = {get: "/api/v1/{name=instance/settings/*}"};
22 | option (google.api.method_signature) = "name";
23 | }
24 |
25 | // Updates an instance setting.
26 | rpc UpdateInstanceSetting(UpdateInstanceSettingRequest) returns (InstanceSetting) {
27 | option (google.api.http) = {
28 | patch: "/api/v1/{setting.name=instance/settings/*}"
29 | body: "setting"
30 | };
31 | option (google.api.method_signature) = "setting,update_mask";
32 | }
33 | }
34 |
35 | // Instance profile message containing basic instance information.
36 | message InstanceProfile {
37 | // The name of instance owner.
38 | // Format: users/{user}
39 | string owner = 1;
40 |
41 | // Version is the current version of instance.
42 | string version = 2;
43 |
44 | // Mode is the instance mode (e.g. "prod", "dev" or "demo").
45 | string mode = 3;
46 |
47 | // Instance URL is the URL of the instance.
48 | string instance_url = 6;
49 | }
50 |
51 | // Request for instance profile.
52 | message GetInstanceProfileRequest {}
53 |
54 | // An instance setting resource.
55 | message InstanceSetting {
56 | option (google.api.resource) = {
57 | type: "memos.api.v1/InstanceSetting"
58 | pattern: "instance/settings/{setting}"
59 | singular: "instanceSetting"
60 | plural: "instanceSettings"
61 | };
62 |
63 | // The name of the instance setting.
64 | // Format: instance/settings/{setting}
65 | string name = 1 [(google.api.field_behavior) = IDENTIFIER];
66 |
67 | oneof value {
68 | GeneralSetting general_setting = 2;
69 | StorageSetting storage_setting = 3;
70 | MemoRelatedSetting memo_related_setting = 4;
71 | }
72 |
73 | // Enumeration of instance setting keys.
74 | enum Key {
75 | KEY_UNSPECIFIED = 0;
76 | // GENERAL is the key for general settings.
77 | GENERAL = 1;
78 | // STORAGE is the key for storage settings.
79 | STORAGE = 2;
80 | // MEMO_RELATED is the key for memo related settings.
81 | MEMO_RELATED = 3;
82 | }
83 |
84 | // General instance settings configuration.
85 | message GeneralSetting {
86 | // theme is the name of the selected theme.
87 | // This references a CSS file in the web/public/themes/ directory.
88 | string theme = 1;
89 | // disallow_user_registration disallows user registration.
90 | bool disallow_user_registration = 2;
91 | // disallow_password_auth disallows password authentication.
92 | bool disallow_password_auth = 3;
93 | // additional_script is the additional script.
94 | string additional_script = 4;
95 | // additional_style is the additional style.
96 | string additional_style = 5;
97 | // custom_profile is the custom profile.
98 | CustomProfile custom_profile = 6;
99 | // week_start_day_offset is the week start day offset from Sunday.
100 | // 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
101 | // Default is Sunday.
102 | int32 week_start_day_offset = 7;
103 |
104 | // disallow_change_username disallows changing username.
105 | bool disallow_change_username = 8;
106 | // disallow_change_nickname disallows changing nickname.
107 | bool disallow_change_nickname = 9;
108 |
109 | // Custom profile configuration for instance branding.
110 | message CustomProfile {
111 | string title = 1;
112 | string description = 2;
113 | string logo_url = 3;
114 | string locale = 4;
115 | }
116 | }
117 |
118 | // Storage configuration settings for instance attachments.
119 | message StorageSetting {
120 | // Storage type enumeration for different storage backends.
121 | enum StorageType {
122 | STORAGE_TYPE_UNSPECIFIED = 0;
123 | // DATABASE is the database storage type.
124 | DATABASE = 1;
125 | // LOCAL is the local storage type.
126 | LOCAL = 2;
127 | // S3 is the S3 storage type.
128 | S3 = 3;
129 | }
130 | // storage_type is the storage type.
131 | StorageType storage_type = 1;
132 | // The template of file path.
133 | // e.g. assets/{timestamp}_{filename}
134 | string filepath_template = 2;
135 | // The max upload size in megabytes.
136 | int64 upload_size_limit_mb = 3;
137 |
138 | // S3 configuration for cloud storage backend.
139 | // Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
140 | message S3Config {
141 | string access_key_id = 1;
142 | string access_key_secret = 2;
143 | string endpoint = 3;
144 | string region = 4;
145 | string bucket = 5;
146 | bool use_path_style = 6;
147 | }
148 | // The S3 config.
149 | S3Config s3_config = 4;
150 | }
151 |
152 | // Memo-related instance settings and policies.
153 | message MemoRelatedSetting {
154 | // disallow_public_visibility disallows set memo as public visibility.
155 | bool disallow_public_visibility = 1;
156 | // display_with_update_time orders and displays memo with update time.
157 | bool display_with_update_time = 2;
158 | // content_length_limit is the limit of content length. Unit is byte.
159 | int32 content_length_limit = 3;
160 | // enable_double_click_edit enables editing on double click.
161 | bool enable_double_click_edit = 4;
162 | // enable_link_preview enables links preview.
163 | bool enable_link_preview = 5;
164 | // reactions is the list of reactions.
165 | repeated string reactions = 7;
166 | // disable_markdown_shortcuts disallow the registration of markdown shortcuts.
167 | bool disable_markdown_shortcuts = 8;
168 | // enable_blur_nsfw_content enables blurring of content marked as not safe for work (NSFW).
169 | bool enable_blur_nsfw_content = 9;
170 | // nsfw_tags is the list of tags that mark content as NSFW for blurring.
171 | repeated string nsfw_tags = 10;
172 | }
173 | }
174 |
175 | // Request message for GetInstanceSetting method.
176 | message GetInstanceSettingRequest {
177 | // The resource name of the instance setting.
178 | // Format: instance/settings/{setting}
179 | string name = 1 [
180 | (google.api.field_behavior) = REQUIRED,
181 | (google.api.resource_reference) = {type: "memos.api.v1/InstanceSetting"}
182 | ];
183 | }
184 |
185 | // Request message for UpdateInstanceSetting method.
186 | message UpdateInstanceSettingRequest {
187 | // The instance setting resource which replaces the resource on the server.
188 | InstanceSetting setting = 1 [(google.api.field_behavior) = REQUIRED];
189 |
190 | // The list of fields to update.
191 | google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
192 | }
193 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/mudkipme/mortis
2 |
3 | go 1.23.6
4 |
5 | require (
6 | github.com/bufbuild/buf v1.50.0
7 | github.com/labstack/echo/v4 v4.13.3
8 | github.com/oapi-codegen/oapi-codegen/v2 v2.4.1
9 | github.com/oapi-codegen/runtime v1.1.1
10 | github.com/pkg/errors v0.9.1
11 | github.com/puzpuzpuz/xsync/v3 v3.5.1
12 | google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b
13 | google.golang.org/grpc v1.69.4
14 | google.golang.org/protobuf v1.36.4
15 | )
16 |
17 | require (
18 | buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.3-20241031151143-70f632351282.1 // indirect
19 | buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.3-20241127180247-a33202765966.1 // indirect
20 | buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250106231242-56271afbd6ce.1 // indirect
21 | buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.3-20250106231242-56271afbd6ce.1 // indirect
22 | buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.3-20241007202033-cf42259fcbfc.1 // indirect
23 | buf.build/go/bufplugin v0.6.0 // indirect
24 | buf.build/go/protoyaml v0.3.1 // indirect
25 | buf.build/go/spdx v0.2.0 // indirect
26 | cel.dev/expr v0.19.1 // indirect
27 | connectrpc.com/connect v1.18.1 // indirect
28 | connectrpc.com/otelconnect v0.7.1 // indirect
29 | github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
30 | github.com/Microsoft/go-winio v0.6.2 // indirect
31 | github.com/Microsoft/hcsshim v0.12.9 // indirect
32 | github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
33 | github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
34 | github.com/bufbuild/protocompile v0.14.1 // indirect
35 | github.com/bufbuild/protoplugin v0.0.0-20250106231243-3a819552c9d9 // indirect
36 | github.com/bufbuild/protovalidate-go v0.8.2 // indirect
37 | github.com/containerd/cgroups/v3 v3.0.5 // indirect
38 | github.com/containerd/containerd v1.7.25 // indirect
39 | github.com/containerd/continuity v0.4.5 // indirect
40 | github.com/containerd/errdefs v1.0.0 // indirect
41 | github.com/containerd/errdefs/pkg v0.3.0 // indirect
42 | github.com/containerd/log v0.1.0 // indirect
43 | github.com/containerd/platforms v0.2.1 // indirect
44 | github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
45 | github.com/containerd/ttrpc v1.2.7 // indirect
46 | github.com/containerd/typeurl/v2 v2.2.3 // indirect
47 | github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
48 | github.com/distribution/reference v0.6.0 // indirect
49 | github.com/docker/cli v27.5.0+incompatible // indirect
50 | github.com/docker/distribution v2.8.3+incompatible // indirect
51 | github.com/docker/docker v27.5.0+incompatible // indirect
52 | github.com/docker/docker-credential-helpers v0.8.2 // indirect
53 | github.com/docker/go-connections v0.5.0 // indirect
54 | github.com/docker/go-units v0.5.0 // indirect
55 | github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
56 | github.com/felixge/fgprof v0.9.5 // indirect
57 | github.com/felixge/httpsnoop v1.0.4 // indirect
58 | github.com/getkin/kin-openapi v0.127.0 // indirect
59 | github.com/go-chi/chi/v5 v5.2.0 // indirect
60 | github.com/go-logr/logr v1.4.2 // indirect
61 | github.com/go-logr/stdr v1.2.2 // indirect
62 | github.com/go-openapi/jsonpointer v0.21.0 // indirect
63 | github.com/go-openapi/swag v0.23.0 // indirect
64 | github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
65 | github.com/gofrs/flock v0.12.1 // indirect
66 | github.com/gogo/protobuf v1.3.2 // indirect
67 | github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
68 | github.com/google/cel-go v0.22.1 // indirect
69 | github.com/google/go-containerregistry v0.20.2 // indirect
70 | github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
71 | github.com/google/uuid v1.6.0 // indirect
72 | github.com/inconshreveable/mousetrap v1.1.0 // indirect
73 | github.com/invopop/yaml v0.3.1 // indirect
74 | github.com/jdx/go-netrc v1.0.0 // indirect
75 | github.com/josharian/intern v1.0.0 // indirect
76 | github.com/klauspost/compress v1.17.11 // indirect
77 | github.com/klauspost/pgzip v1.2.6 // indirect
78 | github.com/labstack/gommon v0.4.2 // indirect
79 | github.com/mailru/easyjson v0.7.7 // indirect
80 | github.com/mattn/go-colorable v0.1.13 // indirect
81 | github.com/mattn/go-isatty v0.0.20 // indirect
82 | github.com/mitchellh/go-homedir v1.1.0 // indirect
83 | github.com/moby/docker-image-spec v1.3.1 // indirect
84 | github.com/moby/locker v1.0.1 // indirect
85 | github.com/moby/patternmatcher v0.6.0 // indirect
86 | github.com/moby/sys/mount v0.3.4 // indirect
87 | github.com/moby/sys/mountinfo v0.7.2 // indirect
88 | github.com/moby/sys/reexec v0.1.0 // indirect
89 | github.com/moby/sys/sequential v0.6.0 // indirect
90 | github.com/moby/sys/user v0.3.0 // indirect
91 | github.com/moby/sys/userns v0.1.0 // indirect
92 | github.com/moby/term v0.5.2 // indirect
93 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
94 | github.com/morikuni/aec v1.0.0 // indirect
95 | github.com/onsi/ginkgo/v2 v2.22.2 // indirect
96 | github.com/opencontainers/go-digest v1.0.0 // indirect
97 | github.com/opencontainers/image-spec v1.1.0 // indirect
98 | github.com/opencontainers/runtime-spec v1.2.0 // indirect
99 | github.com/perimeterx/marshmallow v1.1.5 // indirect
100 | github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
101 | github.com/pkg/profile v1.7.0 // indirect
102 | github.com/quic-go/qpack v0.5.1 // indirect
103 | github.com/quic-go/quic-go v0.48.2 // indirect
104 | github.com/rs/cors v1.11.1 // indirect
105 | github.com/russross/blackfriday/v2 v2.1.0 // indirect
106 | github.com/segmentio/asm v1.2.0 // indirect
107 | github.com/segmentio/encoding v0.4.1 // indirect
108 | github.com/sirupsen/logrus v1.9.3 // indirect
109 | github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect
110 | github.com/spf13/cobra v1.8.1 // indirect
111 | github.com/spf13/pflag v1.0.5 // indirect
112 | github.com/stoewer/go-strcase v1.3.0 // indirect
113 | github.com/tetratelabs/wazero v1.8.2 // indirect
114 | github.com/valyala/bytebufferpool v1.0.0 // indirect
115 | github.com/valyala/fasttemplate v1.2.2 // indirect
116 | github.com/vbatts/tar-split v0.11.6 // indirect
117 | github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
118 | go.lsp.dev/jsonrpc2 v0.10.0 // indirect
119 | go.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2 // indirect
120 | go.lsp.dev/protocol v0.12.0 // indirect
121 | go.lsp.dev/uri v0.3.0 // indirect
122 | go.opencensus.io v0.24.0 // indirect
123 | go.opentelemetry.io/auto/sdk v1.1.0 // indirect
124 | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
125 | go.opentelemetry.io/otel v1.33.0 // indirect
126 | go.opentelemetry.io/otel/metric v1.33.0 // indirect
127 | go.opentelemetry.io/otel/trace v1.33.0 // indirect
128 | go.uber.org/mock v0.5.0 // indirect
129 | go.uber.org/multierr v1.11.0 // indirect
130 | go.uber.org/zap v1.27.0 // indirect
131 | go.uber.org/zap/exp v0.3.0 // indirect
132 | golang.org/x/crypto v0.32.0 // indirect
133 | golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
134 | golang.org/x/mod v0.22.0 // indirect
135 | golang.org/x/net v0.34.0 // indirect
136 | golang.org/x/sync v0.10.0 // indirect
137 | golang.org/x/sys v0.29.0 // indirect
138 | golang.org/x/term v0.28.0 // indirect
139 | golang.org/x/text v0.21.0 // indirect
140 | golang.org/x/tools v0.29.0 // indirect
141 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 // indirect
142 | gopkg.in/yaml.v2 v2.4.0 // indirect
143 | gopkg.in/yaml.v3 v3.0.1 // indirect
144 | pluginrpc.com/pluginrpc v0.5.0 // indirect
145 | )
146 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/common.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go. DO NOT EDIT.
2 | // versions:
3 | // protoc-gen-go v1.36.10
4 | // protoc (unknown)
5 | // source: api/v1/common.proto
6 |
7 | package v1
8 |
9 | import (
10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12 | reflect "reflect"
13 | sync "sync"
14 | unsafe "unsafe"
15 | )
16 |
17 | const (
18 | // Verify that this generated code is sufficiently up-to-date.
19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
20 | // Verify that runtime/protoimpl is sufficiently up-to-date.
21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
22 | )
23 |
24 | type State int32
25 |
26 | const (
27 | State_STATE_UNSPECIFIED State = 0
28 | State_NORMAL State = 1
29 | State_ARCHIVED State = 2
30 | )
31 |
32 | // Enum value maps for State.
33 | var (
34 | State_name = map[int32]string{
35 | 0: "STATE_UNSPECIFIED",
36 | 1: "NORMAL",
37 | 2: "ARCHIVED",
38 | }
39 | State_value = map[string]int32{
40 | "STATE_UNSPECIFIED": 0,
41 | "NORMAL": 1,
42 | "ARCHIVED": 2,
43 | }
44 | )
45 |
46 | func (x State) Enum() *State {
47 | p := new(State)
48 | *p = x
49 | return p
50 | }
51 |
52 | func (x State) String() string {
53 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
54 | }
55 |
56 | func (State) Descriptor() protoreflect.EnumDescriptor {
57 | return file_api_v1_common_proto_enumTypes[0].Descriptor()
58 | }
59 |
60 | func (State) Type() protoreflect.EnumType {
61 | return &file_api_v1_common_proto_enumTypes[0]
62 | }
63 |
64 | func (x State) Number() protoreflect.EnumNumber {
65 | return protoreflect.EnumNumber(x)
66 | }
67 |
68 | // Deprecated: Use State.Descriptor instead.
69 | func (State) EnumDescriptor() ([]byte, []int) {
70 | return file_api_v1_common_proto_rawDescGZIP(), []int{0}
71 | }
72 |
73 | type Direction int32
74 |
75 | const (
76 | Direction_DIRECTION_UNSPECIFIED Direction = 0
77 | Direction_ASC Direction = 1
78 | Direction_DESC Direction = 2
79 | )
80 |
81 | // Enum value maps for Direction.
82 | var (
83 | Direction_name = map[int32]string{
84 | 0: "DIRECTION_UNSPECIFIED",
85 | 1: "ASC",
86 | 2: "DESC",
87 | }
88 | Direction_value = map[string]int32{
89 | "DIRECTION_UNSPECIFIED": 0,
90 | "ASC": 1,
91 | "DESC": 2,
92 | }
93 | )
94 |
95 | func (x Direction) Enum() *Direction {
96 | p := new(Direction)
97 | *p = x
98 | return p
99 | }
100 |
101 | func (x Direction) String() string {
102 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
103 | }
104 |
105 | func (Direction) Descriptor() protoreflect.EnumDescriptor {
106 | return file_api_v1_common_proto_enumTypes[1].Descriptor()
107 | }
108 |
109 | func (Direction) Type() protoreflect.EnumType {
110 | return &file_api_v1_common_proto_enumTypes[1]
111 | }
112 |
113 | func (x Direction) Number() protoreflect.EnumNumber {
114 | return protoreflect.EnumNumber(x)
115 | }
116 |
117 | // Deprecated: Use Direction.Descriptor instead.
118 | func (Direction) EnumDescriptor() ([]byte, []int) {
119 | return file_api_v1_common_proto_rawDescGZIP(), []int{1}
120 | }
121 |
122 | // Used internally for obfuscating the page token.
123 | type PageToken struct {
124 | state protoimpl.MessageState `protogen:"open.v1"`
125 | Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
126 | Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
127 | unknownFields protoimpl.UnknownFields
128 | sizeCache protoimpl.SizeCache
129 | }
130 |
131 | func (x *PageToken) Reset() {
132 | *x = PageToken{}
133 | mi := &file_api_v1_common_proto_msgTypes[0]
134 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
135 | ms.StoreMessageInfo(mi)
136 | }
137 |
138 | func (x *PageToken) String() string {
139 | return protoimpl.X.MessageStringOf(x)
140 | }
141 |
142 | func (*PageToken) ProtoMessage() {}
143 |
144 | func (x *PageToken) ProtoReflect() protoreflect.Message {
145 | mi := &file_api_v1_common_proto_msgTypes[0]
146 | if x != nil {
147 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
148 | if ms.LoadMessageInfo() == nil {
149 | ms.StoreMessageInfo(mi)
150 | }
151 | return ms
152 | }
153 | return mi.MessageOf(x)
154 | }
155 |
156 | // Deprecated: Use PageToken.ProtoReflect.Descriptor instead.
157 | func (*PageToken) Descriptor() ([]byte, []int) {
158 | return file_api_v1_common_proto_rawDescGZIP(), []int{0}
159 | }
160 |
161 | func (x *PageToken) GetLimit() int32 {
162 | if x != nil {
163 | return x.Limit
164 | }
165 | return 0
166 | }
167 |
168 | func (x *PageToken) GetOffset() int32 {
169 | if x != nil {
170 | return x.Offset
171 | }
172 | return 0
173 | }
174 |
175 | var File_api_v1_common_proto protoreflect.FileDescriptor
176 |
177 | const file_api_v1_common_proto_rawDesc = "" +
178 | "\n" +
179 | "\x13api/v1/common.proto\x12\fmemos.api.v1\"9\n" +
180 | "\tPageToken\x12\x14\n" +
181 | "\x05limit\x18\x01 \x01(\x05R\x05limit\x12\x16\n" +
182 | "\x06offset\x18\x02 \x01(\x05R\x06offset*8\n" +
183 | "\x05State\x12\x15\n" +
184 | "\x11STATE_UNSPECIFIED\x10\x00\x12\n" +
185 | "\n" +
186 | "\x06NORMAL\x10\x01\x12\f\n" +
187 | "\bARCHIVED\x10\x02*9\n" +
188 | "\tDirection\x12\x19\n" +
189 | "\x15DIRECTION_UNSPECIFIED\x10\x00\x12\a\n" +
190 | "\x03ASC\x10\x01\x12\b\n" +
191 | "\x04DESC\x10\x02B\fZ\n" +
192 | "gen/api/v1b\x06proto3"
193 |
194 | var (
195 | file_api_v1_common_proto_rawDescOnce sync.Once
196 | file_api_v1_common_proto_rawDescData []byte
197 | )
198 |
199 | func file_api_v1_common_proto_rawDescGZIP() []byte {
200 | file_api_v1_common_proto_rawDescOnce.Do(func() {
201 | file_api_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_v1_common_proto_rawDesc), len(file_api_v1_common_proto_rawDesc)))
202 | })
203 | return file_api_v1_common_proto_rawDescData
204 | }
205 |
206 | var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
207 | var file_api_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
208 | var file_api_v1_common_proto_goTypes = []any{
209 | (State)(0), // 0: memos.api.v1.State
210 | (Direction)(0), // 1: memos.api.v1.Direction
211 | (*PageToken)(nil), // 2: memos.api.v1.PageToken
212 | }
213 | var file_api_v1_common_proto_depIdxs = []int32{
214 | 0, // [0:0] is the sub-list for method output_type
215 | 0, // [0:0] is the sub-list for method input_type
216 | 0, // [0:0] is the sub-list for extension type_name
217 | 0, // [0:0] is the sub-list for extension extendee
218 | 0, // [0:0] is the sub-list for field type_name
219 | }
220 |
221 | func init() { file_api_v1_common_proto_init() }
222 | func file_api_v1_common_proto_init() {
223 | if File_api_v1_common_proto != nil {
224 | return
225 | }
226 | type x struct{}
227 | out := protoimpl.TypeBuilder{
228 | File: protoimpl.DescBuilder{
229 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
230 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_common_proto_rawDesc), len(file_api_v1_common_proto_rawDesc)),
231 | NumEnums: 2,
232 | NumMessages: 1,
233 | NumExtensions: 0,
234 | NumServices: 0,
235 | },
236 | GoTypes: file_api_v1_common_proto_goTypes,
237 | DependencyIndexes: file_api_v1_common_proto_depIdxs,
238 | EnumInfos: file_api_v1_common_proto_enumTypes,
239 | MessageInfos: file_api_v1_common_proto_msgTypes,
240 | }.Build()
241 | File_api_v1_common_proto = out.File
242 | file_api_v1_common_proto_goTypes = nil
243 | file_api_v1_common_proto_depIdxs = nil
244 | }
245 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/instance_service_grpc.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 | // versions:
3 | // - protoc-gen-go-grpc v1.5.1
4 | // - protoc (unknown)
5 | // source: api/v1/instance_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | context "context"
11 | grpc "google.golang.org/grpc"
12 | codes "google.golang.org/grpc/codes"
13 | status "google.golang.org/grpc/status"
14 | )
15 |
16 | // This is a compile-time assertion to ensure that this generated file
17 | // is compatible with the grpc package it is being compiled against.
18 | // Requires gRPC-Go v1.64.0 or later.
19 | const _ = grpc.SupportPackageIsVersion9
20 |
21 | const (
22 | InstanceService_GetInstanceProfile_FullMethodName = "/memos.api.v1.InstanceService/GetInstanceProfile"
23 | InstanceService_GetInstanceSetting_FullMethodName = "/memos.api.v1.InstanceService/GetInstanceSetting"
24 | InstanceService_UpdateInstanceSetting_FullMethodName = "/memos.api.v1.InstanceService/UpdateInstanceSetting"
25 | )
26 |
27 | // InstanceServiceClient is the client API for InstanceService service.
28 | //
29 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
30 | type InstanceServiceClient interface {
31 | // Gets the instance profile.
32 | GetInstanceProfile(ctx context.Context, in *GetInstanceProfileRequest, opts ...grpc.CallOption) (*InstanceProfile, error)
33 | // Gets an instance setting.
34 | GetInstanceSetting(ctx context.Context, in *GetInstanceSettingRequest, opts ...grpc.CallOption) (*InstanceSetting, error)
35 | // Updates an instance setting.
36 | UpdateInstanceSetting(ctx context.Context, in *UpdateInstanceSettingRequest, opts ...grpc.CallOption) (*InstanceSetting, error)
37 | }
38 |
39 | type instanceServiceClient struct {
40 | cc grpc.ClientConnInterface
41 | }
42 |
43 | func NewInstanceServiceClient(cc grpc.ClientConnInterface) InstanceServiceClient {
44 | return &instanceServiceClient{cc}
45 | }
46 |
47 | func (c *instanceServiceClient) GetInstanceProfile(ctx context.Context, in *GetInstanceProfileRequest, opts ...grpc.CallOption) (*InstanceProfile, error) {
48 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
49 | out := new(InstanceProfile)
50 | err := c.cc.Invoke(ctx, InstanceService_GetInstanceProfile_FullMethodName, in, out, cOpts...)
51 | if err != nil {
52 | return nil, err
53 | }
54 | return out, nil
55 | }
56 |
57 | func (c *instanceServiceClient) GetInstanceSetting(ctx context.Context, in *GetInstanceSettingRequest, opts ...grpc.CallOption) (*InstanceSetting, error) {
58 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
59 | out := new(InstanceSetting)
60 | err := c.cc.Invoke(ctx, InstanceService_GetInstanceSetting_FullMethodName, in, out, cOpts...)
61 | if err != nil {
62 | return nil, err
63 | }
64 | return out, nil
65 | }
66 |
67 | func (c *instanceServiceClient) UpdateInstanceSetting(ctx context.Context, in *UpdateInstanceSettingRequest, opts ...grpc.CallOption) (*InstanceSetting, error) {
68 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
69 | out := new(InstanceSetting)
70 | err := c.cc.Invoke(ctx, InstanceService_UpdateInstanceSetting_FullMethodName, in, out, cOpts...)
71 | if err != nil {
72 | return nil, err
73 | }
74 | return out, nil
75 | }
76 |
77 | // InstanceServiceServer is the server API for InstanceService service.
78 | // All implementations must embed UnimplementedInstanceServiceServer
79 | // for forward compatibility.
80 | type InstanceServiceServer interface {
81 | // Gets the instance profile.
82 | GetInstanceProfile(context.Context, *GetInstanceProfileRequest) (*InstanceProfile, error)
83 | // Gets an instance setting.
84 | GetInstanceSetting(context.Context, *GetInstanceSettingRequest) (*InstanceSetting, error)
85 | // Updates an instance setting.
86 | UpdateInstanceSetting(context.Context, *UpdateInstanceSettingRequest) (*InstanceSetting, error)
87 | mustEmbedUnimplementedInstanceServiceServer()
88 | }
89 |
90 | // UnimplementedInstanceServiceServer must be embedded to have
91 | // forward compatible implementations.
92 | //
93 | // NOTE: this should be embedded by value instead of pointer to avoid a nil
94 | // pointer dereference when methods are called.
95 | type UnimplementedInstanceServiceServer struct{}
96 |
97 | func (UnimplementedInstanceServiceServer) GetInstanceProfile(context.Context, *GetInstanceProfileRequest) (*InstanceProfile, error) {
98 | return nil, status.Errorf(codes.Unimplemented, "method GetInstanceProfile not implemented")
99 | }
100 | func (UnimplementedInstanceServiceServer) GetInstanceSetting(context.Context, *GetInstanceSettingRequest) (*InstanceSetting, error) {
101 | return nil, status.Errorf(codes.Unimplemented, "method GetInstanceSetting not implemented")
102 | }
103 | func (UnimplementedInstanceServiceServer) UpdateInstanceSetting(context.Context, *UpdateInstanceSettingRequest) (*InstanceSetting, error) {
104 | return nil, status.Errorf(codes.Unimplemented, "method UpdateInstanceSetting not implemented")
105 | }
106 | func (UnimplementedInstanceServiceServer) mustEmbedUnimplementedInstanceServiceServer() {}
107 | func (UnimplementedInstanceServiceServer) testEmbeddedByValue() {}
108 |
109 | // UnsafeInstanceServiceServer may be embedded to opt out of forward compatibility for this service.
110 | // Use of this interface is not recommended, as added methods to InstanceServiceServer will
111 | // result in compilation errors.
112 | type UnsafeInstanceServiceServer interface {
113 | mustEmbedUnimplementedInstanceServiceServer()
114 | }
115 |
116 | func RegisterInstanceServiceServer(s grpc.ServiceRegistrar, srv InstanceServiceServer) {
117 | // If the following call pancis, it indicates UnimplementedInstanceServiceServer was
118 | // embedded by pointer and is nil. This will cause panics if an
119 | // unimplemented method is ever invoked, so we test this at initialization
120 | // time to prevent it from happening at runtime later due to I/O.
121 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
122 | t.testEmbeddedByValue()
123 | }
124 | s.RegisterService(&InstanceService_ServiceDesc, srv)
125 | }
126 |
127 | func _InstanceService_GetInstanceProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
128 | in := new(GetInstanceProfileRequest)
129 | if err := dec(in); err != nil {
130 | return nil, err
131 | }
132 | if interceptor == nil {
133 | return srv.(InstanceServiceServer).GetInstanceProfile(ctx, in)
134 | }
135 | info := &grpc.UnaryServerInfo{
136 | Server: srv,
137 | FullMethod: InstanceService_GetInstanceProfile_FullMethodName,
138 | }
139 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
140 | return srv.(InstanceServiceServer).GetInstanceProfile(ctx, req.(*GetInstanceProfileRequest))
141 | }
142 | return interceptor(ctx, in, info, handler)
143 | }
144 |
145 | func _InstanceService_GetInstanceSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
146 | in := new(GetInstanceSettingRequest)
147 | if err := dec(in); err != nil {
148 | return nil, err
149 | }
150 | if interceptor == nil {
151 | return srv.(InstanceServiceServer).GetInstanceSetting(ctx, in)
152 | }
153 | info := &grpc.UnaryServerInfo{
154 | Server: srv,
155 | FullMethod: InstanceService_GetInstanceSetting_FullMethodName,
156 | }
157 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
158 | return srv.(InstanceServiceServer).GetInstanceSetting(ctx, req.(*GetInstanceSettingRequest))
159 | }
160 | return interceptor(ctx, in, info, handler)
161 | }
162 |
163 | func _InstanceService_UpdateInstanceSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
164 | in := new(UpdateInstanceSettingRequest)
165 | if err := dec(in); err != nil {
166 | return nil, err
167 | }
168 | if interceptor == nil {
169 | return srv.(InstanceServiceServer).UpdateInstanceSetting(ctx, in)
170 | }
171 | info := &grpc.UnaryServerInfo{
172 | Server: srv,
173 | FullMethod: InstanceService_UpdateInstanceSetting_FullMethodName,
174 | }
175 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
176 | return srv.(InstanceServiceServer).UpdateInstanceSetting(ctx, req.(*UpdateInstanceSettingRequest))
177 | }
178 | return interceptor(ctx, in, info, handler)
179 | }
180 |
181 | // InstanceService_ServiceDesc is the grpc.ServiceDesc for InstanceService service.
182 | // It's only intended for direct use with grpc.RegisterService,
183 | // and not to be introspected or modified (even as a copy)
184 | var InstanceService_ServiceDesc = grpc.ServiceDesc{
185 | ServiceName: "memos.api.v1.InstanceService",
186 | HandlerType: (*InstanceServiceServer)(nil),
187 | Methods: []grpc.MethodDesc{
188 | {
189 | MethodName: "GetInstanceProfile",
190 | Handler: _InstanceService_GetInstanceProfile_Handler,
191 | },
192 | {
193 | MethodName: "GetInstanceSetting",
194 | Handler: _InstanceService_GetInstanceSetting_Handler,
195 | },
196 | {
197 | MethodName: "UpdateInstanceSetting",
198 | Handler: _InstanceService_UpdateInstanceSetting_Handler,
199 | },
200 | },
201 | Streams: []grpc.StreamDesc{},
202 | Metadata: "api/v1/instance_service.proto",
203 | }
204 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/auth_service_grpc.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 | // versions:
3 | // - protoc-gen-go-grpc v1.5.1
4 | // - protoc (unknown)
5 | // source: api/v1/auth_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | context "context"
11 | grpc "google.golang.org/grpc"
12 | codes "google.golang.org/grpc/codes"
13 | status "google.golang.org/grpc/status"
14 | emptypb "google.golang.org/protobuf/types/known/emptypb"
15 | )
16 |
17 | // This is a compile-time assertion to ensure that this generated file
18 | // is compatible with the grpc package it is being compiled against.
19 | // Requires gRPC-Go v1.64.0 or later.
20 | const _ = grpc.SupportPackageIsVersion9
21 |
22 | const (
23 | AuthService_GetCurrentSession_FullMethodName = "/memos.api.v1.AuthService/GetCurrentSession"
24 | AuthService_CreateSession_FullMethodName = "/memos.api.v1.AuthService/CreateSession"
25 | AuthService_DeleteSession_FullMethodName = "/memos.api.v1.AuthService/DeleteSession"
26 | )
27 |
28 | // AuthServiceClient is the client API for AuthService service.
29 | //
30 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
31 | type AuthServiceClient interface {
32 | // GetCurrentSession returns the current active session information.
33 | // This method is idempotent and safe, suitable for checking current session state.
34 | GetCurrentSession(ctx context.Context, in *GetCurrentSessionRequest, opts ...grpc.CallOption) (*GetCurrentSessionResponse, error)
35 | // CreateSession authenticates a user and creates a new session.
36 | // Returns the authenticated user information upon successful authentication.
37 | CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*CreateSessionResponse, error)
38 | // DeleteSession terminates the current user session.
39 | // This is an idempotent operation that invalidates the user's authentication.
40 | DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
41 | }
42 |
43 | type authServiceClient struct {
44 | cc grpc.ClientConnInterface
45 | }
46 |
47 | func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
48 | return &authServiceClient{cc}
49 | }
50 |
51 | func (c *authServiceClient) GetCurrentSession(ctx context.Context, in *GetCurrentSessionRequest, opts ...grpc.CallOption) (*GetCurrentSessionResponse, error) {
52 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
53 | out := new(GetCurrentSessionResponse)
54 | err := c.cc.Invoke(ctx, AuthService_GetCurrentSession_FullMethodName, in, out, cOpts...)
55 | if err != nil {
56 | return nil, err
57 | }
58 | return out, nil
59 | }
60 |
61 | func (c *authServiceClient) CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*CreateSessionResponse, error) {
62 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
63 | out := new(CreateSessionResponse)
64 | err := c.cc.Invoke(ctx, AuthService_CreateSession_FullMethodName, in, out, cOpts...)
65 | if err != nil {
66 | return nil, err
67 | }
68 | return out, nil
69 | }
70 |
71 | func (c *authServiceClient) DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
72 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
73 | out := new(emptypb.Empty)
74 | err := c.cc.Invoke(ctx, AuthService_DeleteSession_FullMethodName, in, out, cOpts...)
75 | if err != nil {
76 | return nil, err
77 | }
78 | return out, nil
79 | }
80 |
81 | // AuthServiceServer is the server API for AuthService service.
82 | // All implementations must embed UnimplementedAuthServiceServer
83 | // for forward compatibility.
84 | type AuthServiceServer interface {
85 | // GetCurrentSession returns the current active session information.
86 | // This method is idempotent and safe, suitable for checking current session state.
87 | GetCurrentSession(context.Context, *GetCurrentSessionRequest) (*GetCurrentSessionResponse, error)
88 | // CreateSession authenticates a user and creates a new session.
89 | // Returns the authenticated user information upon successful authentication.
90 | CreateSession(context.Context, *CreateSessionRequest) (*CreateSessionResponse, error)
91 | // DeleteSession terminates the current user session.
92 | // This is an idempotent operation that invalidates the user's authentication.
93 | DeleteSession(context.Context, *DeleteSessionRequest) (*emptypb.Empty, error)
94 | mustEmbedUnimplementedAuthServiceServer()
95 | }
96 |
97 | // UnimplementedAuthServiceServer must be embedded to have
98 | // forward compatible implementations.
99 | //
100 | // NOTE: this should be embedded by value instead of pointer to avoid a nil
101 | // pointer dereference when methods are called.
102 | type UnimplementedAuthServiceServer struct{}
103 |
104 | func (UnimplementedAuthServiceServer) GetCurrentSession(context.Context, *GetCurrentSessionRequest) (*GetCurrentSessionResponse, error) {
105 | return nil, status.Errorf(codes.Unimplemented, "method GetCurrentSession not implemented")
106 | }
107 | func (UnimplementedAuthServiceServer) CreateSession(context.Context, *CreateSessionRequest) (*CreateSessionResponse, error) {
108 | return nil, status.Errorf(codes.Unimplemented, "method CreateSession not implemented")
109 | }
110 | func (UnimplementedAuthServiceServer) DeleteSession(context.Context, *DeleteSessionRequest) (*emptypb.Empty, error) {
111 | return nil, status.Errorf(codes.Unimplemented, "method DeleteSession not implemented")
112 | }
113 | func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
114 | func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
115 |
116 | // UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
117 | // Use of this interface is not recommended, as added methods to AuthServiceServer will
118 | // result in compilation errors.
119 | type UnsafeAuthServiceServer interface {
120 | mustEmbedUnimplementedAuthServiceServer()
121 | }
122 |
123 | func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
124 | // If the following call pancis, it indicates UnimplementedAuthServiceServer was
125 | // embedded by pointer and is nil. This will cause panics if an
126 | // unimplemented method is ever invoked, so we test this at initialization
127 | // time to prevent it from happening at runtime later due to I/O.
128 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
129 | t.testEmbeddedByValue()
130 | }
131 | s.RegisterService(&AuthService_ServiceDesc, srv)
132 | }
133 |
134 | func _AuthService_GetCurrentSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
135 | in := new(GetCurrentSessionRequest)
136 | if err := dec(in); err != nil {
137 | return nil, err
138 | }
139 | if interceptor == nil {
140 | return srv.(AuthServiceServer).GetCurrentSession(ctx, in)
141 | }
142 | info := &grpc.UnaryServerInfo{
143 | Server: srv,
144 | FullMethod: AuthService_GetCurrentSession_FullMethodName,
145 | }
146 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
147 | return srv.(AuthServiceServer).GetCurrentSession(ctx, req.(*GetCurrentSessionRequest))
148 | }
149 | return interceptor(ctx, in, info, handler)
150 | }
151 |
152 | func _AuthService_CreateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
153 | in := new(CreateSessionRequest)
154 | if err := dec(in); err != nil {
155 | return nil, err
156 | }
157 | if interceptor == nil {
158 | return srv.(AuthServiceServer).CreateSession(ctx, in)
159 | }
160 | info := &grpc.UnaryServerInfo{
161 | Server: srv,
162 | FullMethod: AuthService_CreateSession_FullMethodName,
163 | }
164 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
165 | return srv.(AuthServiceServer).CreateSession(ctx, req.(*CreateSessionRequest))
166 | }
167 | return interceptor(ctx, in, info, handler)
168 | }
169 |
170 | func _AuthService_DeleteSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
171 | in := new(DeleteSessionRequest)
172 | if err := dec(in); err != nil {
173 | return nil, err
174 | }
175 | if interceptor == nil {
176 | return srv.(AuthServiceServer).DeleteSession(ctx, in)
177 | }
178 | info := &grpc.UnaryServerInfo{
179 | Server: srv,
180 | FullMethod: AuthService_DeleteSession_FullMethodName,
181 | }
182 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
183 | return srv.(AuthServiceServer).DeleteSession(ctx, req.(*DeleteSessionRequest))
184 | }
185 | return interceptor(ctx, in, info, handler)
186 | }
187 |
188 | // AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
189 | // It's only intended for direct use with grpc.RegisterService,
190 | // and not to be introspected or modified (even as a copy)
191 | var AuthService_ServiceDesc = grpc.ServiceDesc{
192 | ServiceName: "memos.api.v1.AuthService",
193 | HandlerType: (*AuthServiceServer)(nil),
194 | Methods: []grpc.MethodDesc{
195 | {
196 | MethodName: "GetCurrentSession",
197 | Handler: _AuthService_GetCurrentSession_Handler,
198 | },
199 | {
200 | MethodName: "CreateSession",
201 | Handler: _AuthService_CreateSession_Handler,
202 | },
203 | {
204 | MethodName: "DeleteSession",
205 | Handler: _AuthService_DeleteSession_Handler,
206 | },
207 | },
208 | Streams: []grpc.StreamDesc{},
209 | Metadata: "api/v1/auth_service.proto",
210 | }
211 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/shortcut_service_grpc.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 | // versions:
3 | // - protoc-gen-go-grpc v1.5.1
4 | // - protoc (unknown)
5 | // source: api/v1/shortcut_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | context "context"
11 | grpc "google.golang.org/grpc"
12 | codes "google.golang.org/grpc/codes"
13 | status "google.golang.org/grpc/status"
14 | emptypb "google.golang.org/protobuf/types/known/emptypb"
15 | )
16 |
17 | // This is a compile-time assertion to ensure that this generated file
18 | // is compatible with the grpc package it is being compiled against.
19 | // Requires gRPC-Go v1.64.0 or later.
20 | const _ = grpc.SupportPackageIsVersion9
21 |
22 | const (
23 | ShortcutService_ListShortcuts_FullMethodName = "/memos.api.v1.ShortcutService/ListShortcuts"
24 | ShortcutService_GetShortcut_FullMethodName = "/memos.api.v1.ShortcutService/GetShortcut"
25 | ShortcutService_CreateShortcut_FullMethodName = "/memos.api.v1.ShortcutService/CreateShortcut"
26 | ShortcutService_UpdateShortcut_FullMethodName = "/memos.api.v1.ShortcutService/UpdateShortcut"
27 | ShortcutService_DeleteShortcut_FullMethodName = "/memos.api.v1.ShortcutService/DeleteShortcut"
28 | )
29 |
30 | // ShortcutServiceClient is the client API for ShortcutService service.
31 | //
32 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
33 | type ShortcutServiceClient interface {
34 | // ListShortcuts returns a list of shortcuts for a user.
35 | ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error)
36 | // GetShortcut gets a shortcut by name.
37 | GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
38 | // CreateShortcut creates a new shortcut for a user.
39 | CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
40 | // UpdateShortcut updates a shortcut for a user.
41 | UpdateShortcut(ctx context.Context, in *UpdateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
42 | // DeleteShortcut deletes a shortcut for a user.
43 | DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
44 | }
45 |
46 | type shortcutServiceClient struct {
47 | cc grpc.ClientConnInterface
48 | }
49 |
50 | func NewShortcutServiceClient(cc grpc.ClientConnInterface) ShortcutServiceClient {
51 | return &shortcutServiceClient{cc}
52 | }
53 |
54 | func (c *shortcutServiceClient) ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error) {
55 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
56 | out := new(ListShortcutsResponse)
57 | err := c.cc.Invoke(ctx, ShortcutService_ListShortcuts_FullMethodName, in, out, cOpts...)
58 | if err != nil {
59 | return nil, err
60 | }
61 | return out, nil
62 | }
63 |
64 | func (c *shortcutServiceClient) GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
65 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
66 | out := new(Shortcut)
67 | err := c.cc.Invoke(ctx, ShortcutService_GetShortcut_FullMethodName, in, out, cOpts...)
68 | if err != nil {
69 | return nil, err
70 | }
71 | return out, nil
72 | }
73 |
74 | func (c *shortcutServiceClient) CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
75 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
76 | out := new(Shortcut)
77 | err := c.cc.Invoke(ctx, ShortcutService_CreateShortcut_FullMethodName, in, out, cOpts...)
78 | if err != nil {
79 | return nil, err
80 | }
81 | return out, nil
82 | }
83 |
84 | func (c *shortcutServiceClient) UpdateShortcut(ctx context.Context, in *UpdateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
85 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
86 | out := new(Shortcut)
87 | err := c.cc.Invoke(ctx, ShortcutService_UpdateShortcut_FullMethodName, in, out, cOpts...)
88 | if err != nil {
89 | return nil, err
90 | }
91 | return out, nil
92 | }
93 |
94 | func (c *shortcutServiceClient) DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
95 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
96 | out := new(emptypb.Empty)
97 | err := c.cc.Invoke(ctx, ShortcutService_DeleteShortcut_FullMethodName, in, out, cOpts...)
98 | if err != nil {
99 | return nil, err
100 | }
101 | return out, nil
102 | }
103 |
104 | // ShortcutServiceServer is the server API for ShortcutService service.
105 | // All implementations must embed UnimplementedShortcutServiceServer
106 | // for forward compatibility.
107 | type ShortcutServiceServer interface {
108 | // ListShortcuts returns a list of shortcuts for a user.
109 | ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error)
110 | // GetShortcut gets a shortcut by name.
111 | GetShortcut(context.Context, *GetShortcutRequest) (*Shortcut, error)
112 | // CreateShortcut creates a new shortcut for a user.
113 | CreateShortcut(context.Context, *CreateShortcutRequest) (*Shortcut, error)
114 | // UpdateShortcut updates a shortcut for a user.
115 | UpdateShortcut(context.Context, *UpdateShortcutRequest) (*Shortcut, error)
116 | // DeleteShortcut deletes a shortcut for a user.
117 | DeleteShortcut(context.Context, *DeleteShortcutRequest) (*emptypb.Empty, error)
118 | mustEmbedUnimplementedShortcutServiceServer()
119 | }
120 |
121 | // UnimplementedShortcutServiceServer must be embedded to have
122 | // forward compatible implementations.
123 | //
124 | // NOTE: this should be embedded by value instead of pointer to avoid a nil
125 | // pointer dereference when methods are called.
126 | type UnimplementedShortcutServiceServer struct{}
127 |
128 | func (UnimplementedShortcutServiceServer) ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error) {
129 | return nil, status.Errorf(codes.Unimplemented, "method ListShortcuts not implemented")
130 | }
131 | func (UnimplementedShortcutServiceServer) GetShortcut(context.Context, *GetShortcutRequest) (*Shortcut, error) {
132 | return nil, status.Errorf(codes.Unimplemented, "method GetShortcut not implemented")
133 | }
134 | func (UnimplementedShortcutServiceServer) CreateShortcut(context.Context, *CreateShortcutRequest) (*Shortcut, error) {
135 | return nil, status.Errorf(codes.Unimplemented, "method CreateShortcut not implemented")
136 | }
137 | func (UnimplementedShortcutServiceServer) UpdateShortcut(context.Context, *UpdateShortcutRequest) (*Shortcut, error) {
138 | return nil, status.Errorf(codes.Unimplemented, "method UpdateShortcut not implemented")
139 | }
140 | func (UnimplementedShortcutServiceServer) DeleteShortcut(context.Context, *DeleteShortcutRequest) (*emptypb.Empty, error) {
141 | return nil, status.Errorf(codes.Unimplemented, "method DeleteShortcut not implemented")
142 | }
143 | func (UnimplementedShortcutServiceServer) mustEmbedUnimplementedShortcutServiceServer() {}
144 | func (UnimplementedShortcutServiceServer) testEmbeddedByValue() {}
145 |
146 | // UnsafeShortcutServiceServer may be embedded to opt out of forward compatibility for this service.
147 | // Use of this interface is not recommended, as added methods to ShortcutServiceServer will
148 | // result in compilation errors.
149 | type UnsafeShortcutServiceServer interface {
150 | mustEmbedUnimplementedShortcutServiceServer()
151 | }
152 |
153 | func RegisterShortcutServiceServer(s grpc.ServiceRegistrar, srv ShortcutServiceServer) {
154 | // If the following call pancis, it indicates UnimplementedShortcutServiceServer was
155 | // embedded by pointer and is nil. This will cause panics if an
156 | // unimplemented method is ever invoked, so we test this at initialization
157 | // time to prevent it from happening at runtime later due to I/O.
158 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
159 | t.testEmbeddedByValue()
160 | }
161 | s.RegisterService(&ShortcutService_ServiceDesc, srv)
162 | }
163 |
164 | func _ShortcutService_ListShortcuts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
165 | in := new(ListShortcutsRequest)
166 | if err := dec(in); err != nil {
167 | return nil, err
168 | }
169 | if interceptor == nil {
170 | return srv.(ShortcutServiceServer).ListShortcuts(ctx, in)
171 | }
172 | info := &grpc.UnaryServerInfo{
173 | Server: srv,
174 | FullMethod: ShortcutService_ListShortcuts_FullMethodName,
175 | }
176 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
177 | return srv.(ShortcutServiceServer).ListShortcuts(ctx, req.(*ListShortcutsRequest))
178 | }
179 | return interceptor(ctx, in, info, handler)
180 | }
181 |
182 | func _ShortcutService_GetShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
183 | in := new(GetShortcutRequest)
184 | if err := dec(in); err != nil {
185 | return nil, err
186 | }
187 | if interceptor == nil {
188 | return srv.(ShortcutServiceServer).GetShortcut(ctx, in)
189 | }
190 | info := &grpc.UnaryServerInfo{
191 | Server: srv,
192 | FullMethod: ShortcutService_GetShortcut_FullMethodName,
193 | }
194 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
195 | return srv.(ShortcutServiceServer).GetShortcut(ctx, req.(*GetShortcutRequest))
196 | }
197 | return interceptor(ctx, in, info, handler)
198 | }
199 |
200 | func _ShortcutService_CreateShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
201 | in := new(CreateShortcutRequest)
202 | if err := dec(in); err != nil {
203 | return nil, err
204 | }
205 | if interceptor == nil {
206 | return srv.(ShortcutServiceServer).CreateShortcut(ctx, in)
207 | }
208 | info := &grpc.UnaryServerInfo{
209 | Server: srv,
210 | FullMethod: ShortcutService_CreateShortcut_FullMethodName,
211 | }
212 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
213 | return srv.(ShortcutServiceServer).CreateShortcut(ctx, req.(*CreateShortcutRequest))
214 | }
215 | return interceptor(ctx, in, info, handler)
216 | }
217 |
218 | func _ShortcutService_UpdateShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
219 | in := new(UpdateShortcutRequest)
220 | if err := dec(in); err != nil {
221 | return nil, err
222 | }
223 | if interceptor == nil {
224 | return srv.(ShortcutServiceServer).UpdateShortcut(ctx, in)
225 | }
226 | info := &grpc.UnaryServerInfo{
227 | Server: srv,
228 | FullMethod: ShortcutService_UpdateShortcut_FullMethodName,
229 | }
230 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
231 | return srv.(ShortcutServiceServer).UpdateShortcut(ctx, req.(*UpdateShortcutRequest))
232 | }
233 | return interceptor(ctx, in, info, handler)
234 | }
235 |
236 | func _ShortcutService_DeleteShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
237 | in := new(DeleteShortcutRequest)
238 | if err := dec(in); err != nil {
239 | return nil, err
240 | }
241 | if interceptor == nil {
242 | return srv.(ShortcutServiceServer).DeleteShortcut(ctx, in)
243 | }
244 | info := &grpc.UnaryServerInfo{
245 | Server: srv,
246 | FullMethod: ShortcutService_DeleteShortcut_FullMethodName,
247 | }
248 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
249 | return srv.(ShortcutServiceServer).DeleteShortcut(ctx, req.(*DeleteShortcutRequest))
250 | }
251 | return interceptor(ctx, in, info, handler)
252 | }
253 |
254 | // ShortcutService_ServiceDesc is the grpc.ServiceDesc for ShortcutService service.
255 | // It's only intended for direct use with grpc.RegisterService,
256 | // and not to be introspected or modified (even as a copy)
257 | var ShortcutService_ServiceDesc = grpc.ServiceDesc{
258 | ServiceName: "memos.api.v1.ShortcutService",
259 | HandlerType: (*ShortcutServiceServer)(nil),
260 | Methods: []grpc.MethodDesc{
261 | {
262 | MethodName: "ListShortcuts",
263 | Handler: _ShortcutService_ListShortcuts_Handler,
264 | },
265 | {
266 | MethodName: "GetShortcut",
267 | Handler: _ShortcutService_GetShortcut_Handler,
268 | },
269 | {
270 | MethodName: "CreateShortcut",
271 | Handler: _ShortcutService_CreateShortcut_Handler,
272 | },
273 | {
274 | MethodName: "UpdateShortcut",
275 | Handler: _ShortcutService_UpdateShortcut_Handler,
276 | },
277 | {
278 | MethodName: "DeleteShortcut",
279 | Handler: _ShortcutService_DeleteShortcut_Handler,
280 | },
281 | },
282 | Streams: []grpc.StreamDesc{},
283 | Metadata: "api/v1/shortcut_service.proto",
284 | }
285 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/idp_service_grpc.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 | // versions:
3 | // - protoc-gen-go-grpc v1.5.1
4 | // - protoc (unknown)
5 | // source: api/v1/idp_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | context "context"
11 | grpc "google.golang.org/grpc"
12 | codes "google.golang.org/grpc/codes"
13 | status "google.golang.org/grpc/status"
14 | emptypb "google.golang.org/protobuf/types/known/emptypb"
15 | )
16 |
17 | // This is a compile-time assertion to ensure that this generated file
18 | // is compatible with the grpc package it is being compiled against.
19 | // Requires gRPC-Go v1.64.0 or later.
20 | const _ = grpc.SupportPackageIsVersion9
21 |
22 | const (
23 | IdentityProviderService_ListIdentityProviders_FullMethodName = "/memos.api.v1.IdentityProviderService/ListIdentityProviders"
24 | IdentityProviderService_GetIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/GetIdentityProvider"
25 | IdentityProviderService_CreateIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/CreateIdentityProvider"
26 | IdentityProviderService_UpdateIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider"
27 | IdentityProviderService_DeleteIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider"
28 | )
29 |
30 | // IdentityProviderServiceClient is the client API for IdentityProviderService service.
31 | //
32 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
33 | type IdentityProviderServiceClient interface {
34 | // ListIdentityProviders lists identity providers.
35 | ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error)
36 | // GetIdentityProvider gets an identity provider.
37 | GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error)
38 | // CreateIdentityProvider creates an identity provider.
39 | CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error)
40 | // UpdateIdentityProvider updates an identity provider.
41 | UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error)
42 | // DeleteIdentityProvider deletes an identity provider.
43 | DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
44 | }
45 |
46 | type identityProviderServiceClient struct {
47 | cc grpc.ClientConnInterface
48 | }
49 |
50 | func NewIdentityProviderServiceClient(cc grpc.ClientConnInterface) IdentityProviderServiceClient {
51 | return &identityProviderServiceClient{cc}
52 | }
53 |
54 | func (c *identityProviderServiceClient) ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error) {
55 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
56 | out := new(ListIdentityProvidersResponse)
57 | err := c.cc.Invoke(ctx, IdentityProviderService_ListIdentityProviders_FullMethodName, in, out, cOpts...)
58 | if err != nil {
59 | return nil, err
60 | }
61 | return out, nil
62 | }
63 |
64 | func (c *identityProviderServiceClient) GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error) {
65 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
66 | out := new(IdentityProvider)
67 | err := c.cc.Invoke(ctx, IdentityProviderService_GetIdentityProvider_FullMethodName, in, out, cOpts...)
68 | if err != nil {
69 | return nil, err
70 | }
71 | return out, nil
72 | }
73 |
74 | func (c *identityProviderServiceClient) CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error) {
75 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
76 | out := new(IdentityProvider)
77 | err := c.cc.Invoke(ctx, IdentityProviderService_CreateIdentityProvider_FullMethodName, in, out, cOpts...)
78 | if err != nil {
79 | return nil, err
80 | }
81 | return out, nil
82 | }
83 |
84 | func (c *identityProviderServiceClient) UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error) {
85 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
86 | out := new(IdentityProvider)
87 | err := c.cc.Invoke(ctx, IdentityProviderService_UpdateIdentityProvider_FullMethodName, in, out, cOpts...)
88 | if err != nil {
89 | return nil, err
90 | }
91 | return out, nil
92 | }
93 |
94 | func (c *identityProviderServiceClient) DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
95 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
96 | out := new(emptypb.Empty)
97 | err := c.cc.Invoke(ctx, IdentityProviderService_DeleteIdentityProvider_FullMethodName, in, out, cOpts...)
98 | if err != nil {
99 | return nil, err
100 | }
101 | return out, nil
102 | }
103 |
104 | // IdentityProviderServiceServer is the server API for IdentityProviderService service.
105 | // All implementations must embed UnimplementedIdentityProviderServiceServer
106 | // for forward compatibility.
107 | type IdentityProviderServiceServer interface {
108 | // ListIdentityProviders lists identity providers.
109 | ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error)
110 | // GetIdentityProvider gets an identity provider.
111 | GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*IdentityProvider, error)
112 | // CreateIdentityProvider creates an identity provider.
113 | CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*IdentityProvider, error)
114 | // UpdateIdentityProvider updates an identity provider.
115 | UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*IdentityProvider, error)
116 | // DeleteIdentityProvider deletes an identity provider.
117 | DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*emptypb.Empty, error)
118 | mustEmbedUnimplementedIdentityProviderServiceServer()
119 | }
120 |
121 | // UnimplementedIdentityProviderServiceServer must be embedded to have
122 | // forward compatible implementations.
123 | //
124 | // NOTE: this should be embedded by value instead of pointer to avoid a nil
125 | // pointer dereference when methods are called.
126 | type UnimplementedIdentityProviderServiceServer struct{}
127 |
128 | func (UnimplementedIdentityProviderServiceServer) ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error) {
129 | return nil, status.Errorf(codes.Unimplemented, "method ListIdentityProviders not implemented")
130 | }
131 | func (UnimplementedIdentityProviderServiceServer) GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*IdentityProvider, error) {
132 | return nil, status.Errorf(codes.Unimplemented, "method GetIdentityProvider not implemented")
133 | }
134 | func (UnimplementedIdentityProviderServiceServer) CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*IdentityProvider, error) {
135 | return nil, status.Errorf(codes.Unimplemented, "method CreateIdentityProvider not implemented")
136 | }
137 | func (UnimplementedIdentityProviderServiceServer) UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*IdentityProvider, error) {
138 | return nil, status.Errorf(codes.Unimplemented, "method UpdateIdentityProvider not implemented")
139 | }
140 | func (UnimplementedIdentityProviderServiceServer) DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*emptypb.Empty, error) {
141 | return nil, status.Errorf(codes.Unimplemented, "method DeleteIdentityProvider not implemented")
142 | }
143 | func (UnimplementedIdentityProviderServiceServer) mustEmbedUnimplementedIdentityProviderServiceServer() {
144 | }
145 | func (UnimplementedIdentityProviderServiceServer) testEmbeddedByValue() {}
146 |
147 | // UnsafeIdentityProviderServiceServer may be embedded to opt out of forward compatibility for this service.
148 | // Use of this interface is not recommended, as added methods to IdentityProviderServiceServer will
149 | // result in compilation errors.
150 | type UnsafeIdentityProviderServiceServer interface {
151 | mustEmbedUnimplementedIdentityProviderServiceServer()
152 | }
153 |
154 | func RegisterIdentityProviderServiceServer(s grpc.ServiceRegistrar, srv IdentityProviderServiceServer) {
155 | // If the following call pancis, it indicates UnimplementedIdentityProviderServiceServer was
156 | // embedded by pointer and is nil. This will cause panics if an
157 | // unimplemented method is ever invoked, so we test this at initialization
158 | // time to prevent it from happening at runtime later due to I/O.
159 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
160 | t.testEmbeddedByValue()
161 | }
162 | s.RegisterService(&IdentityProviderService_ServiceDesc, srv)
163 | }
164 |
165 | func _IdentityProviderService_ListIdentityProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
166 | in := new(ListIdentityProvidersRequest)
167 | if err := dec(in); err != nil {
168 | return nil, err
169 | }
170 | if interceptor == nil {
171 | return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, in)
172 | }
173 | info := &grpc.UnaryServerInfo{
174 | Server: srv,
175 | FullMethod: IdentityProviderService_ListIdentityProviders_FullMethodName,
176 | }
177 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
178 | return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, req.(*ListIdentityProvidersRequest))
179 | }
180 | return interceptor(ctx, in, info, handler)
181 | }
182 |
183 | func _IdentityProviderService_GetIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
184 | in := new(GetIdentityProviderRequest)
185 | if err := dec(in); err != nil {
186 | return nil, err
187 | }
188 | if interceptor == nil {
189 | return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, in)
190 | }
191 | info := &grpc.UnaryServerInfo{
192 | Server: srv,
193 | FullMethod: IdentityProviderService_GetIdentityProvider_FullMethodName,
194 | }
195 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
196 | return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, req.(*GetIdentityProviderRequest))
197 | }
198 | return interceptor(ctx, in, info, handler)
199 | }
200 |
201 | func _IdentityProviderService_CreateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
202 | in := new(CreateIdentityProviderRequest)
203 | if err := dec(in); err != nil {
204 | return nil, err
205 | }
206 | if interceptor == nil {
207 | return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, in)
208 | }
209 | info := &grpc.UnaryServerInfo{
210 | Server: srv,
211 | FullMethod: IdentityProviderService_CreateIdentityProvider_FullMethodName,
212 | }
213 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
214 | return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, req.(*CreateIdentityProviderRequest))
215 | }
216 | return interceptor(ctx, in, info, handler)
217 | }
218 |
219 | func _IdentityProviderService_UpdateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
220 | in := new(UpdateIdentityProviderRequest)
221 | if err := dec(in); err != nil {
222 | return nil, err
223 | }
224 | if interceptor == nil {
225 | return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, in)
226 | }
227 | info := &grpc.UnaryServerInfo{
228 | Server: srv,
229 | FullMethod: IdentityProviderService_UpdateIdentityProvider_FullMethodName,
230 | }
231 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
232 | return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, req.(*UpdateIdentityProviderRequest))
233 | }
234 | return interceptor(ctx, in, info, handler)
235 | }
236 |
237 | func _IdentityProviderService_DeleteIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
238 | in := new(DeleteIdentityProviderRequest)
239 | if err := dec(in); err != nil {
240 | return nil, err
241 | }
242 | if interceptor == nil {
243 | return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, in)
244 | }
245 | info := &grpc.UnaryServerInfo{
246 | Server: srv,
247 | FullMethod: IdentityProviderService_DeleteIdentityProvider_FullMethodName,
248 | }
249 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
250 | return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, req.(*DeleteIdentityProviderRequest))
251 | }
252 | return interceptor(ctx, in, info, handler)
253 | }
254 |
255 | // IdentityProviderService_ServiceDesc is the grpc.ServiceDesc for IdentityProviderService service.
256 | // It's only intended for direct use with grpc.RegisterService,
257 | // and not to be introspected or modified (even as a copy)
258 | var IdentityProviderService_ServiceDesc = grpc.ServiceDesc{
259 | ServiceName: "memos.api.v1.IdentityProviderService",
260 | HandlerType: (*IdentityProviderServiceServer)(nil),
261 | Methods: []grpc.MethodDesc{
262 | {
263 | MethodName: "ListIdentityProviders",
264 | Handler: _IdentityProviderService_ListIdentityProviders_Handler,
265 | },
266 | {
267 | MethodName: "GetIdentityProvider",
268 | Handler: _IdentityProviderService_GetIdentityProvider_Handler,
269 | },
270 | {
271 | MethodName: "CreateIdentityProvider",
272 | Handler: _IdentityProviderService_CreateIdentityProvider_Handler,
273 | },
274 | {
275 | MethodName: "UpdateIdentityProvider",
276 | Handler: _IdentityProviderService_UpdateIdentityProvider_Handler,
277 | },
278 | {
279 | MethodName: "DeleteIdentityProvider",
280 | Handler: _IdentityProviderService_DeleteIdentityProvider_Handler,
281 | },
282 | },
283 | Streams: []grpc.StreamDesc{},
284 | Metadata: "api/v1/idp_service.proto",
285 | }
286 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/attachment_service_grpc.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 | // versions:
3 | // - protoc-gen-go-grpc v1.5.1
4 | // - protoc (unknown)
5 | // source: api/v1/attachment_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | context "context"
11 | httpbody "google.golang.org/genproto/googleapis/api/httpbody"
12 | grpc "google.golang.org/grpc"
13 | codes "google.golang.org/grpc/codes"
14 | status "google.golang.org/grpc/status"
15 | emptypb "google.golang.org/protobuf/types/known/emptypb"
16 | )
17 |
18 | // This is a compile-time assertion to ensure that this generated file
19 | // is compatible with the grpc package it is being compiled against.
20 | // Requires gRPC-Go v1.64.0 or later.
21 | const _ = grpc.SupportPackageIsVersion9
22 |
23 | const (
24 | AttachmentService_CreateAttachment_FullMethodName = "/memos.api.v1.AttachmentService/CreateAttachment"
25 | AttachmentService_ListAttachments_FullMethodName = "/memos.api.v1.AttachmentService/ListAttachments"
26 | AttachmentService_GetAttachment_FullMethodName = "/memos.api.v1.AttachmentService/GetAttachment"
27 | AttachmentService_GetAttachmentBinary_FullMethodName = "/memos.api.v1.AttachmentService/GetAttachmentBinary"
28 | AttachmentService_UpdateAttachment_FullMethodName = "/memos.api.v1.AttachmentService/UpdateAttachment"
29 | AttachmentService_DeleteAttachment_FullMethodName = "/memos.api.v1.AttachmentService/DeleteAttachment"
30 | )
31 |
32 | // AttachmentServiceClient is the client API for AttachmentService service.
33 | //
34 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
35 | type AttachmentServiceClient interface {
36 | // CreateAttachment creates a new attachment.
37 | CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error)
38 | // ListAttachments lists all attachments.
39 | ListAttachments(ctx context.Context, in *ListAttachmentsRequest, opts ...grpc.CallOption) (*ListAttachmentsResponse, error)
40 | // GetAttachment returns a attachment by name.
41 | GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error)
42 | // GetAttachmentBinary returns a attachment binary by name.
43 | GetAttachmentBinary(ctx context.Context, in *GetAttachmentBinaryRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
44 | // UpdateAttachment updates a attachment.
45 | UpdateAttachment(ctx context.Context, in *UpdateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error)
46 | // DeleteAttachment deletes a attachment by name.
47 | DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
48 | }
49 |
50 | type attachmentServiceClient struct {
51 | cc grpc.ClientConnInterface
52 | }
53 |
54 | func NewAttachmentServiceClient(cc grpc.ClientConnInterface) AttachmentServiceClient {
55 | return &attachmentServiceClient{cc}
56 | }
57 |
58 | func (c *attachmentServiceClient) CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) {
59 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
60 | out := new(Attachment)
61 | err := c.cc.Invoke(ctx, AttachmentService_CreateAttachment_FullMethodName, in, out, cOpts...)
62 | if err != nil {
63 | return nil, err
64 | }
65 | return out, nil
66 | }
67 |
68 | func (c *attachmentServiceClient) ListAttachments(ctx context.Context, in *ListAttachmentsRequest, opts ...grpc.CallOption) (*ListAttachmentsResponse, error) {
69 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
70 | out := new(ListAttachmentsResponse)
71 | err := c.cc.Invoke(ctx, AttachmentService_ListAttachments_FullMethodName, in, out, cOpts...)
72 | if err != nil {
73 | return nil, err
74 | }
75 | return out, nil
76 | }
77 |
78 | func (c *attachmentServiceClient) GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) {
79 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
80 | out := new(Attachment)
81 | err := c.cc.Invoke(ctx, AttachmentService_GetAttachment_FullMethodName, in, out, cOpts...)
82 | if err != nil {
83 | return nil, err
84 | }
85 | return out, nil
86 | }
87 |
88 | func (c *attachmentServiceClient) GetAttachmentBinary(ctx context.Context, in *GetAttachmentBinaryRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
89 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
90 | out := new(httpbody.HttpBody)
91 | err := c.cc.Invoke(ctx, AttachmentService_GetAttachmentBinary_FullMethodName, in, out, cOpts...)
92 | if err != nil {
93 | return nil, err
94 | }
95 | return out, nil
96 | }
97 |
98 | func (c *attachmentServiceClient) UpdateAttachment(ctx context.Context, in *UpdateAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) {
99 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
100 | out := new(Attachment)
101 | err := c.cc.Invoke(ctx, AttachmentService_UpdateAttachment_FullMethodName, in, out, cOpts...)
102 | if err != nil {
103 | return nil, err
104 | }
105 | return out, nil
106 | }
107 |
108 | func (c *attachmentServiceClient) DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
109 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
110 | out := new(emptypb.Empty)
111 | err := c.cc.Invoke(ctx, AttachmentService_DeleteAttachment_FullMethodName, in, out, cOpts...)
112 | if err != nil {
113 | return nil, err
114 | }
115 | return out, nil
116 | }
117 |
118 | // AttachmentServiceServer is the server API for AttachmentService service.
119 | // All implementations must embed UnimplementedAttachmentServiceServer
120 | // for forward compatibility.
121 | type AttachmentServiceServer interface {
122 | // CreateAttachment creates a new attachment.
123 | CreateAttachment(context.Context, *CreateAttachmentRequest) (*Attachment, error)
124 | // ListAttachments lists all attachments.
125 | ListAttachments(context.Context, *ListAttachmentsRequest) (*ListAttachmentsResponse, error)
126 | // GetAttachment returns a attachment by name.
127 | GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error)
128 | // GetAttachmentBinary returns a attachment binary by name.
129 | GetAttachmentBinary(context.Context, *GetAttachmentBinaryRequest) (*httpbody.HttpBody, error)
130 | // UpdateAttachment updates a attachment.
131 | UpdateAttachment(context.Context, *UpdateAttachmentRequest) (*Attachment, error)
132 | // DeleteAttachment deletes a attachment by name.
133 | DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error)
134 | mustEmbedUnimplementedAttachmentServiceServer()
135 | }
136 |
137 | // UnimplementedAttachmentServiceServer must be embedded to have
138 | // forward compatible implementations.
139 | //
140 | // NOTE: this should be embedded by value instead of pointer to avoid a nil
141 | // pointer dereference when methods are called.
142 | type UnimplementedAttachmentServiceServer struct{}
143 |
144 | func (UnimplementedAttachmentServiceServer) CreateAttachment(context.Context, *CreateAttachmentRequest) (*Attachment, error) {
145 | return nil, status.Errorf(codes.Unimplemented, "method CreateAttachment not implemented")
146 | }
147 | func (UnimplementedAttachmentServiceServer) ListAttachments(context.Context, *ListAttachmentsRequest) (*ListAttachmentsResponse, error) {
148 | return nil, status.Errorf(codes.Unimplemented, "method ListAttachments not implemented")
149 | }
150 | func (UnimplementedAttachmentServiceServer) GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error) {
151 | return nil, status.Errorf(codes.Unimplemented, "method GetAttachment not implemented")
152 | }
153 | func (UnimplementedAttachmentServiceServer) GetAttachmentBinary(context.Context, *GetAttachmentBinaryRequest) (*httpbody.HttpBody, error) {
154 | return nil, status.Errorf(codes.Unimplemented, "method GetAttachmentBinary not implemented")
155 | }
156 | func (UnimplementedAttachmentServiceServer) UpdateAttachment(context.Context, *UpdateAttachmentRequest) (*Attachment, error) {
157 | return nil, status.Errorf(codes.Unimplemented, "method UpdateAttachment not implemented")
158 | }
159 | func (UnimplementedAttachmentServiceServer) DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error) {
160 | return nil, status.Errorf(codes.Unimplemented, "method DeleteAttachment not implemented")
161 | }
162 | func (UnimplementedAttachmentServiceServer) mustEmbedUnimplementedAttachmentServiceServer() {}
163 | func (UnimplementedAttachmentServiceServer) testEmbeddedByValue() {}
164 |
165 | // UnsafeAttachmentServiceServer may be embedded to opt out of forward compatibility for this service.
166 | // Use of this interface is not recommended, as added methods to AttachmentServiceServer will
167 | // result in compilation errors.
168 | type UnsafeAttachmentServiceServer interface {
169 | mustEmbedUnimplementedAttachmentServiceServer()
170 | }
171 |
172 | func RegisterAttachmentServiceServer(s grpc.ServiceRegistrar, srv AttachmentServiceServer) {
173 | // If the following call pancis, it indicates UnimplementedAttachmentServiceServer was
174 | // embedded by pointer and is nil. This will cause panics if an
175 | // unimplemented method is ever invoked, so we test this at initialization
176 | // time to prevent it from happening at runtime later due to I/O.
177 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
178 | t.testEmbeddedByValue()
179 | }
180 | s.RegisterService(&AttachmentService_ServiceDesc, srv)
181 | }
182 |
183 | func _AttachmentService_CreateAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
184 | in := new(CreateAttachmentRequest)
185 | if err := dec(in); err != nil {
186 | return nil, err
187 | }
188 | if interceptor == nil {
189 | return srv.(AttachmentServiceServer).CreateAttachment(ctx, in)
190 | }
191 | info := &grpc.UnaryServerInfo{
192 | Server: srv,
193 | FullMethod: AttachmentService_CreateAttachment_FullMethodName,
194 | }
195 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
196 | return srv.(AttachmentServiceServer).CreateAttachment(ctx, req.(*CreateAttachmentRequest))
197 | }
198 | return interceptor(ctx, in, info, handler)
199 | }
200 |
201 | func _AttachmentService_ListAttachments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
202 | in := new(ListAttachmentsRequest)
203 | if err := dec(in); err != nil {
204 | return nil, err
205 | }
206 | if interceptor == nil {
207 | return srv.(AttachmentServiceServer).ListAttachments(ctx, in)
208 | }
209 | info := &grpc.UnaryServerInfo{
210 | Server: srv,
211 | FullMethod: AttachmentService_ListAttachments_FullMethodName,
212 | }
213 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
214 | return srv.(AttachmentServiceServer).ListAttachments(ctx, req.(*ListAttachmentsRequest))
215 | }
216 | return interceptor(ctx, in, info, handler)
217 | }
218 |
219 | func _AttachmentService_GetAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
220 | in := new(GetAttachmentRequest)
221 | if err := dec(in); err != nil {
222 | return nil, err
223 | }
224 | if interceptor == nil {
225 | return srv.(AttachmentServiceServer).GetAttachment(ctx, in)
226 | }
227 | info := &grpc.UnaryServerInfo{
228 | Server: srv,
229 | FullMethod: AttachmentService_GetAttachment_FullMethodName,
230 | }
231 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
232 | return srv.(AttachmentServiceServer).GetAttachment(ctx, req.(*GetAttachmentRequest))
233 | }
234 | return interceptor(ctx, in, info, handler)
235 | }
236 |
237 | func _AttachmentService_GetAttachmentBinary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
238 | in := new(GetAttachmentBinaryRequest)
239 | if err := dec(in); err != nil {
240 | return nil, err
241 | }
242 | if interceptor == nil {
243 | return srv.(AttachmentServiceServer).GetAttachmentBinary(ctx, in)
244 | }
245 | info := &grpc.UnaryServerInfo{
246 | Server: srv,
247 | FullMethod: AttachmentService_GetAttachmentBinary_FullMethodName,
248 | }
249 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
250 | return srv.(AttachmentServiceServer).GetAttachmentBinary(ctx, req.(*GetAttachmentBinaryRequest))
251 | }
252 | return interceptor(ctx, in, info, handler)
253 | }
254 |
255 | func _AttachmentService_UpdateAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
256 | in := new(UpdateAttachmentRequest)
257 | if err := dec(in); err != nil {
258 | return nil, err
259 | }
260 | if interceptor == nil {
261 | return srv.(AttachmentServiceServer).UpdateAttachment(ctx, in)
262 | }
263 | info := &grpc.UnaryServerInfo{
264 | Server: srv,
265 | FullMethod: AttachmentService_UpdateAttachment_FullMethodName,
266 | }
267 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
268 | return srv.(AttachmentServiceServer).UpdateAttachment(ctx, req.(*UpdateAttachmentRequest))
269 | }
270 | return interceptor(ctx, in, info, handler)
271 | }
272 |
273 | func _AttachmentService_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
274 | in := new(DeleteAttachmentRequest)
275 | if err := dec(in); err != nil {
276 | return nil, err
277 | }
278 | if interceptor == nil {
279 | return srv.(AttachmentServiceServer).DeleteAttachment(ctx, in)
280 | }
281 | info := &grpc.UnaryServerInfo{
282 | Server: srv,
283 | FullMethod: AttachmentService_DeleteAttachment_FullMethodName,
284 | }
285 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
286 | return srv.(AttachmentServiceServer).DeleteAttachment(ctx, req.(*DeleteAttachmentRequest))
287 | }
288 | return interceptor(ctx, in, info, handler)
289 | }
290 |
291 | // AttachmentService_ServiceDesc is the grpc.ServiceDesc for AttachmentService service.
292 | // It's only intended for direct use with grpc.RegisterService,
293 | // and not to be introspected or modified (even as a copy)
294 | var AttachmentService_ServiceDesc = grpc.ServiceDesc{
295 | ServiceName: "memos.api.v1.AttachmentService",
296 | HandlerType: (*AttachmentServiceServer)(nil),
297 | Methods: []grpc.MethodDesc{
298 | {
299 | MethodName: "CreateAttachment",
300 | Handler: _AttachmentService_CreateAttachment_Handler,
301 | },
302 | {
303 | MethodName: "ListAttachments",
304 | Handler: _AttachmentService_ListAttachments_Handler,
305 | },
306 | {
307 | MethodName: "GetAttachment",
308 | Handler: _AttachmentService_GetAttachment_Handler,
309 | },
310 | {
311 | MethodName: "GetAttachmentBinary",
312 | Handler: _AttachmentService_GetAttachmentBinary_Handler,
313 | },
314 | {
315 | MethodName: "UpdateAttachment",
316 | Handler: _AttachmentService_UpdateAttachment_Handler,
317 | },
318 | {
319 | MethodName: "DeleteAttachment",
320 | Handler: _AttachmentService_DeleteAttachment_Handler,
321 | },
322 | },
323 | Streams: []grpc.StreamDesc{},
324 | Metadata: "api/v1/attachment_service.proto",
325 | }
326 |
--------------------------------------------------------------------------------
/server/memos/proto/api/v1/memo_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package memos.api.v1;
4 |
5 | import "api/v1/attachment_service.proto";
6 | import "api/v1/common.proto";
7 | import "google/api/annotations.proto";
8 | import "google/api/client.proto";
9 | import "google/api/field_behavior.proto";
10 | import "google/api/resource.proto";
11 | import "google/protobuf/empty.proto";
12 | import "google/protobuf/field_mask.proto";
13 | import "google/protobuf/timestamp.proto";
14 |
15 | option go_package = "gen/api/v1";
16 |
17 | service MemoService {
18 | // CreateMemo creates a memo.
19 | rpc CreateMemo(CreateMemoRequest) returns (Memo) {
20 | option (google.api.http) = {
21 | post: "/api/v1/memos"
22 | body: "memo"
23 | };
24 | option (google.api.method_signature) = "memo";
25 | }
26 | // ListMemos lists memos with pagination and filter.
27 | rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
28 | option (google.api.http) = {get: "/api/v1/memos"};
29 | option (google.api.method_signature) = "";
30 | }
31 | // GetMemo gets a memo.
32 | rpc GetMemo(GetMemoRequest) returns (Memo) {
33 | option (google.api.http) = {get: "/api/v1/{name=memos/*}"};
34 | option (google.api.method_signature) = "name";
35 | }
36 | // UpdateMemo updates a memo.
37 | rpc UpdateMemo(UpdateMemoRequest) returns (Memo) {
38 | option (google.api.http) = {
39 | patch: "/api/v1/{memo.name=memos/*}"
40 | body: "memo"
41 | };
42 | option (google.api.method_signature) = "memo,update_mask";
43 | }
44 | // DeleteMemo deletes a memo.
45 | rpc DeleteMemo(DeleteMemoRequest) returns (google.protobuf.Empty) {
46 | option (google.api.http) = {delete: "/api/v1/{name=memos/*}"};
47 | option (google.api.method_signature) = "name";
48 | }
49 | // SetMemoAttachments sets attachments for a memo.
50 | rpc SetMemoAttachments(SetMemoAttachmentsRequest) returns (google.protobuf.Empty) {
51 | option (google.api.http) = {
52 | patch: "/api/v1/{name=memos/*}/attachments"
53 | body: "*"
54 | };
55 | option (google.api.method_signature) = "name";
56 | }
57 | // ListMemoAttachments lists attachments for a memo.
58 | rpc ListMemoAttachments(ListMemoAttachmentsRequest) returns (ListMemoAttachmentsResponse) {
59 | option (google.api.http) = {get: "/api/v1/{name=memos/*}/attachments"};
60 | option (google.api.method_signature) = "name";
61 | }
62 | // SetMemoRelations sets relations for a memo.
63 | rpc SetMemoRelations(SetMemoRelationsRequest) returns (google.protobuf.Empty) {
64 | option (google.api.http) = {
65 | patch: "/api/v1/{name=memos/*}/relations"
66 | body: "*"
67 | };
68 | option (google.api.method_signature) = "name";
69 | }
70 | // ListMemoRelations lists relations for a memo.
71 | rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) {
72 | option (google.api.http) = {get: "/api/v1/{name=memos/*}/relations"};
73 | option (google.api.method_signature) = "name";
74 | }
75 | // CreateMemoComment creates a comment for a memo.
76 | rpc CreateMemoComment(CreateMemoCommentRequest) returns (Memo) {
77 | option (google.api.http) = {
78 | post: "/api/v1/{name=memos/*}/comments"
79 | body: "comment"
80 | };
81 | option (google.api.method_signature) = "name,comment";
82 | }
83 | // ListMemoComments lists comments for a memo.
84 | rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) {
85 | option (google.api.http) = {get: "/api/v1/{name=memos/*}/comments"};
86 | option (google.api.method_signature) = "name";
87 | }
88 | // ListMemoReactions lists reactions for a memo.
89 | rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) {
90 | option (google.api.http) = {get: "/api/v1/{name=memos/*}/reactions"};
91 | option (google.api.method_signature) = "name";
92 | }
93 | // UpsertMemoReaction upserts a reaction for a memo.
94 | rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (Reaction) {
95 | option (google.api.http) = {
96 | post: "/api/v1/{name=memos/*}/reactions"
97 | body: "*"
98 | };
99 | option (google.api.method_signature) = "name";
100 | }
101 | // DeleteMemoReaction deletes a reaction for a memo.
102 | rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (google.protobuf.Empty) {
103 | option (google.api.http) = {delete: "/api/v1/{name=reactions/*}"};
104 | option (google.api.method_signature) = "name";
105 | }
106 | }
107 |
108 | enum Visibility {
109 | VISIBILITY_UNSPECIFIED = 0;
110 | PRIVATE = 1;
111 | PROTECTED = 2;
112 | PUBLIC = 3;
113 | }
114 |
115 | message Reaction {
116 | option (google.api.resource) = {
117 | type: "memos.api.v1/Reaction"
118 | pattern: "reactions/{reaction}"
119 | name_field: "name"
120 | singular: "reaction"
121 | plural: "reactions"
122 | };
123 |
124 | // The resource name of the reaction.
125 | // Format: reactions/{reaction}
126 | string name = 1 [
127 | (google.api.field_behavior) = OUTPUT_ONLY,
128 | (google.api.field_behavior) = IDENTIFIER
129 | ];
130 |
131 | // The resource name of the creator.
132 | // Format: users/{user}
133 | string creator = 2 [
134 | (google.api.field_behavior) = OUTPUT_ONLY,
135 | (google.api.resource_reference) = {type: "memos.api.v1/User"}
136 | ];
137 |
138 | // The resource name of the content.
139 | // For memo reactions, this should be the memo's resource name.
140 | // Format: memos/{memo}
141 | string content_id = 3 [
142 | (google.api.field_behavior) = REQUIRED,
143 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
144 | ];
145 |
146 | // Required. The type of reaction (e.g., "👍", "❤️", "😄").
147 | string reaction_type = 4 [(google.api.field_behavior) = REQUIRED];
148 |
149 | // Output only. The creation timestamp.
150 | google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
151 | }
152 |
153 | message Memo {
154 | option (google.api.resource) = {
155 | type: "memos.api.v1/Memo"
156 | pattern: "memos/{memo}"
157 | name_field: "name"
158 | singular: "memo"
159 | plural: "memos"
160 | };
161 |
162 | // The resource name of the memo.
163 | // Format: memos/{memo}, memo is the user defined id or uuid.
164 | string name = 1 [(google.api.field_behavior) = IDENTIFIER];
165 |
166 | // The state of the memo.
167 | State state = 2 [(google.api.field_behavior) = REQUIRED];
168 |
169 | // The name of the creator.
170 | // Format: users/{user}
171 | string creator = 3 [
172 | (google.api.field_behavior) = OUTPUT_ONLY,
173 | (google.api.resource_reference) = {type: "memos.api.v1/User"}
174 | ];
175 |
176 | // Output only. The creation timestamp.
177 | google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
178 |
179 | // Output only. The last update timestamp.
180 | google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
181 |
182 | // The display timestamp of the memo.
183 | google.protobuf.Timestamp display_time = 6 [(google.api.field_behavior) = OPTIONAL];
184 |
185 | // Required. The content of the memo in Markdown format.
186 | string content = 7 [(google.api.field_behavior) = REQUIRED];
187 |
188 | // The visibility of the memo.
189 | Visibility visibility = 9 [(google.api.field_behavior) = REQUIRED];
190 |
191 | // Output only. The tags extracted from the content.
192 | repeated string tags = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
193 |
194 | // Whether the memo is pinned.
195 | bool pinned = 11 [(google.api.field_behavior) = OPTIONAL];
196 |
197 | // Optional. The attachments of the memo.
198 | repeated Attachment attachments = 12 [(google.api.field_behavior) = OPTIONAL];
199 |
200 | // Optional. The relations of the memo.
201 | repeated MemoRelation relations = 13 [(google.api.field_behavior) = OPTIONAL];
202 |
203 | // Output only. The reactions to the memo.
204 | repeated Reaction reactions = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
205 |
206 | // Output only. The computed properties of the memo.
207 | Property property = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
208 |
209 | // Output only. The name of the parent memo.
210 | // Format: memos/{memo}
211 | optional string parent = 16 [
212 | (google.api.field_behavior) = OUTPUT_ONLY,
213 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
214 | ];
215 |
216 | // Output only. The snippet of the memo content. Plain text only.
217 | string snippet = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
218 |
219 | // Optional. The location of the memo.
220 | optional Location location = 18 [(google.api.field_behavior) = OPTIONAL];
221 |
222 | // Computed properties of a memo.
223 | message Property {
224 | bool has_link = 1;
225 | bool has_task_list = 2;
226 | bool has_code = 3;
227 | bool has_incomplete_tasks = 4;
228 | }
229 | }
230 |
231 | message Location {
232 | // A placeholder text for the location.
233 | string placeholder = 1 [(google.api.field_behavior) = OPTIONAL];
234 |
235 | // The latitude of the location.
236 | double latitude = 2 [(google.api.field_behavior) = OPTIONAL];
237 |
238 | // The longitude of the location.
239 | double longitude = 3 [(google.api.field_behavior) = OPTIONAL];
240 | }
241 |
242 | message CreateMemoRequest {
243 | // Required. The memo to create.
244 | Memo memo = 1 [(google.api.field_behavior) = REQUIRED];
245 |
246 | // Optional. The memo ID to use for this memo.
247 | // If empty, a unique ID will be generated.
248 | string memo_id = 2 [(google.api.field_behavior) = OPTIONAL];
249 | }
250 |
251 | message ListMemosRequest {
252 | // Optional. The maximum number of memos to return.
253 | // The service may return fewer than this value.
254 | // If unspecified, at most 50 memos will be returned.
255 | // The maximum value is 1000; values above 1000 will be coerced to 1000.
256 | int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
257 |
258 | // Optional. A page token, received from a previous `ListMemos` call.
259 | // Provide this to retrieve the subsequent page.
260 | string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
261 |
262 | // Optional. The state of the memos to list.
263 | // Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
264 | State state = 3 [(google.api.field_behavior) = OPTIONAL];
265 |
266 | // Optional. The order to sort results by.
267 | // Default to "display_time desc".
268 | // Supports comma-separated list of fields following AIP-132.
269 | // Example: "pinned desc, display_time desc" or "create_time asc"
270 | // Supported fields: pinned, display_time, create_time, update_time, name
271 | string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
272 |
273 | // Optional. Filter to apply to the list results.
274 | // Filter is a CEL expression to filter memos.
275 | // Refer to `Shortcut.filter`.
276 | string filter = 5 [(google.api.field_behavior) = OPTIONAL];
277 |
278 | // Optional. If true, show deleted memos in the response.
279 | bool show_deleted = 6 [(google.api.field_behavior) = OPTIONAL];
280 | }
281 |
282 | message ListMemosResponse {
283 | // The list of memos.
284 | repeated Memo memos = 1;
285 |
286 | // A token that can be sent as `page_token` to retrieve the next page.
287 | // If this field is omitted, there are no subsequent pages.
288 | string next_page_token = 2;
289 | }
290 |
291 | message GetMemoRequest {
292 | // Required. The resource name of the memo.
293 | // Format: memos/{memo}
294 | string name = 1 [
295 | (google.api.field_behavior) = REQUIRED,
296 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
297 | ];
298 | }
299 |
300 | message UpdateMemoRequest {
301 | // Required. The memo to update.
302 | // The `name` field is required.
303 | Memo memo = 1 [(google.api.field_behavior) = REQUIRED];
304 |
305 | // Required. The list of fields to update.
306 | google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
307 | }
308 |
309 | message DeleteMemoRequest {
310 | // Required. The resource name of the memo to delete.
311 | // Format: memos/{memo}
312 | string name = 1 [
313 | (google.api.field_behavior) = REQUIRED,
314 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
315 | ];
316 |
317 | // Optional. If set to true, the memo will be deleted even if it has associated data.
318 | bool force = 2 [(google.api.field_behavior) = OPTIONAL];
319 | }
320 |
321 | message SetMemoAttachmentsRequest {
322 | // Required. The resource name of the memo.
323 | // Format: memos/{memo}
324 | string name = 1 [
325 | (google.api.field_behavior) = REQUIRED,
326 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
327 | ];
328 |
329 | // Required. The attachments to set for the memo.
330 | repeated Attachment attachments = 2 [(google.api.field_behavior) = REQUIRED];
331 | }
332 |
333 | message ListMemoAttachmentsRequest {
334 | // Required. The resource name of the memo.
335 | // Format: memos/{memo}
336 | string name = 1 [
337 | (google.api.field_behavior) = REQUIRED,
338 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
339 | ];
340 |
341 | // Optional. The maximum number of attachments to return.
342 | int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
343 |
344 | // Optional. A page token for pagination.
345 | string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
346 | }
347 |
348 | message ListMemoAttachmentsResponse {
349 | // The list of attachments.
350 | repeated Attachment attachments = 1;
351 |
352 | // A token for the next page of results.
353 | string next_page_token = 2;
354 | }
355 |
356 | message MemoRelation {
357 | // The memo in the relation.
358 | Memo memo = 1 [(google.api.field_behavior) = REQUIRED];
359 |
360 | // The related memo.
361 | Memo related_memo = 2 [(google.api.field_behavior) = REQUIRED];
362 |
363 | // The type of the relation.
364 | enum Type {
365 | TYPE_UNSPECIFIED = 0;
366 | REFERENCE = 1;
367 | COMMENT = 2;
368 | }
369 | Type type = 3 [(google.api.field_behavior) = REQUIRED];
370 |
371 | // Memo reference in relations.
372 | message Memo {
373 | // The resource name of the memo.
374 | // Format: memos/{memo}
375 | string name = 1 [
376 | (google.api.field_behavior) = REQUIRED,
377 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
378 | ];
379 |
380 | // Output only. The snippet of the memo content. Plain text only.
381 | string snippet = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
382 | }
383 | }
384 |
385 | message SetMemoRelationsRequest {
386 | // Required. The resource name of the memo.
387 | // Format: memos/{memo}
388 | string name = 1 [
389 | (google.api.field_behavior) = REQUIRED,
390 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
391 | ];
392 |
393 | // Required. The relations to set for the memo.
394 | repeated MemoRelation relations = 2 [(google.api.field_behavior) = REQUIRED];
395 | }
396 |
397 | message ListMemoRelationsRequest {
398 | // Required. The resource name of the memo.
399 | // Format: memos/{memo}
400 | string name = 1 [
401 | (google.api.field_behavior) = REQUIRED,
402 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
403 | ];
404 |
405 | // Optional. The maximum number of relations to return.
406 | int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
407 |
408 | // Optional. A page token for pagination.
409 | string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
410 | }
411 |
412 | message ListMemoRelationsResponse {
413 | // The list of relations.
414 | repeated MemoRelation relations = 1;
415 |
416 | // A token for the next page of results.
417 | string next_page_token = 2;
418 | }
419 |
420 | message CreateMemoCommentRequest {
421 | // Required. The resource name of the memo.
422 | // Format: memos/{memo}
423 | string name = 1 [
424 | (google.api.field_behavior) = REQUIRED,
425 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
426 | ];
427 |
428 | // Required. The comment to create.
429 | Memo comment = 2 [(google.api.field_behavior) = REQUIRED];
430 |
431 | // Optional. The comment ID to use.
432 | string comment_id = 3 [(google.api.field_behavior) = OPTIONAL];
433 | }
434 |
435 | message ListMemoCommentsRequest {
436 | // Required. The resource name of the memo.
437 | // Format: memos/{memo}
438 | string name = 1 [
439 | (google.api.field_behavior) = REQUIRED,
440 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
441 | ];
442 |
443 | // Optional. The maximum number of comments to return.
444 | int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
445 |
446 | // Optional. A page token for pagination.
447 | string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
448 |
449 | // Optional. The order to sort results by.
450 | string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
451 | }
452 |
453 | message ListMemoCommentsResponse {
454 | // The list of comment memos.
455 | repeated Memo memos = 1;
456 |
457 | // A token for the next page of results.
458 | string next_page_token = 2;
459 |
460 | // The total count of comments.
461 | int32 total_size = 3;
462 | }
463 |
464 | message ListMemoReactionsRequest {
465 | // Required. The resource name of the memo.
466 | // Format: memos/{memo}
467 | string name = 1 [
468 | (google.api.field_behavior) = REQUIRED,
469 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
470 | ];
471 |
472 | // Optional. The maximum number of reactions to return.
473 | int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
474 |
475 | // Optional. A page token for pagination.
476 | string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
477 | }
478 |
479 | message ListMemoReactionsResponse {
480 | // The list of reactions.
481 | repeated Reaction reactions = 1;
482 |
483 | // A token for the next page of results.
484 | string next_page_token = 2;
485 |
486 | // The total count of reactions.
487 | int32 total_size = 3;
488 | }
489 |
490 | message UpsertMemoReactionRequest {
491 | // Required. The resource name of the memo.
492 | // Format: memos/{memo}
493 | string name = 1 [
494 | (google.api.field_behavior) = REQUIRED,
495 | (google.api.resource_reference) = {type: "memos.api.v1/Memo"}
496 | ];
497 |
498 | // Required. The reaction to upsert.
499 | Reaction reaction = 2 [(google.api.field_behavior) = REQUIRED];
500 | }
501 |
502 | message DeleteMemoReactionRequest {
503 | // Required. The resource name of the reaction to delete.
504 | // Format: reactions/{reaction}
505 | string name = 1 [
506 | (google.api.field_behavior) = REQUIRED,
507 | (google.api.resource_reference) = {type: "memos.api.v1/Reaction"}
508 | ];
509 | }
510 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/shortcut_service.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go. DO NOT EDIT.
2 | // versions:
3 | // protoc-gen-go v1.36.10
4 | // protoc (unknown)
5 | // source: api/v1/shortcut_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | _ "google.golang.org/genproto/googleapis/api/annotations"
11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect"
12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl"
13 | emptypb "google.golang.org/protobuf/types/known/emptypb"
14 | fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
15 | reflect "reflect"
16 | sync "sync"
17 | unsafe "unsafe"
18 | )
19 |
20 | const (
21 | // Verify that this generated code is sufficiently up-to-date.
22 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
23 | // Verify that runtime/protoimpl is sufficiently up-to-date.
24 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
25 | )
26 |
27 | type Shortcut struct {
28 | state protoimpl.MessageState `protogen:"open.v1"`
29 | // The resource name of the shortcut.
30 | // Format: users/{user}/shortcuts/{shortcut}
31 | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
32 | // The title of the shortcut.
33 | Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
34 | // The filter expression for the shortcut.
35 | Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
36 | unknownFields protoimpl.UnknownFields
37 | sizeCache protoimpl.SizeCache
38 | }
39 |
40 | func (x *Shortcut) Reset() {
41 | *x = Shortcut{}
42 | mi := &file_api_v1_shortcut_service_proto_msgTypes[0]
43 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
44 | ms.StoreMessageInfo(mi)
45 | }
46 |
47 | func (x *Shortcut) String() string {
48 | return protoimpl.X.MessageStringOf(x)
49 | }
50 |
51 | func (*Shortcut) ProtoMessage() {}
52 |
53 | func (x *Shortcut) ProtoReflect() protoreflect.Message {
54 | mi := &file_api_v1_shortcut_service_proto_msgTypes[0]
55 | if x != nil {
56 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
57 | if ms.LoadMessageInfo() == nil {
58 | ms.StoreMessageInfo(mi)
59 | }
60 | return ms
61 | }
62 | return mi.MessageOf(x)
63 | }
64 |
65 | // Deprecated: Use Shortcut.ProtoReflect.Descriptor instead.
66 | func (*Shortcut) Descriptor() ([]byte, []int) {
67 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{0}
68 | }
69 |
70 | func (x *Shortcut) GetName() string {
71 | if x != nil {
72 | return x.Name
73 | }
74 | return ""
75 | }
76 |
77 | func (x *Shortcut) GetTitle() string {
78 | if x != nil {
79 | return x.Title
80 | }
81 | return ""
82 | }
83 |
84 | func (x *Shortcut) GetFilter() string {
85 | if x != nil {
86 | return x.Filter
87 | }
88 | return ""
89 | }
90 |
91 | type ListShortcutsRequest struct {
92 | state protoimpl.MessageState `protogen:"open.v1"`
93 | // Required. The parent resource where shortcuts are listed.
94 | // Format: users/{user}
95 | Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
96 | unknownFields protoimpl.UnknownFields
97 | sizeCache protoimpl.SizeCache
98 | }
99 |
100 | func (x *ListShortcutsRequest) Reset() {
101 | *x = ListShortcutsRequest{}
102 | mi := &file_api_v1_shortcut_service_proto_msgTypes[1]
103 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
104 | ms.StoreMessageInfo(mi)
105 | }
106 |
107 | func (x *ListShortcutsRequest) String() string {
108 | return protoimpl.X.MessageStringOf(x)
109 | }
110 |
111 | func (*ListShortcutsRequest) ProtoMessage() {}
112 |
113 | func (x *ListShortcutsRequest) ProtoReflect() protoreflect.Message {
114 | mi := &file_api_v1_shortcut_service_proto_msgTypes[1]
115 | if x != nil {
116 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
117 | if ms.LoadMessageInfo() == nil {
118 | ms.StoreMessageInfo(mi)
119 | }
120 | return ms
121 | }
122 | return mi.MessageOf(x)
123 | }
124 |
125 | // Deprecated: Use ListShortcutsRequest.ProtoReflect.Descriptor instead.
126 | func (*ListShortcutsRequest) Descriptor() ([]byte, []int) {
127 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{1}
128 | }
129 |
130 | func (x *ListShortcutsRequest) GetParent() string {
131 | if x != nil {
132 | return x.Parent
133 | }
134 | return ""
135 | }
136 |
137 | type ListShortcutsResponse struct {
138 | state protoimpl.MessageState `protogen:"open.v1"`
139 | // The list of shortcuts.
140 | Shortcuts []*Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"`
141 | unknownFields protoimpl.UnknownFields
142 | sizeCache protoimpl.SizeCache
143 | }
144 |
145 | func (x *ListShortcutsResponse) Reset() {
146 | *x = ListShortcutsResponse{}
147 | mi := &file_api_v1_shortcut_service_proto_msgTypes[2]
148 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
149 | ms.StoreMessageInfo(mi)
150 | }
151 |
152 | func (x *ListShortcutsResponse) String() string {
153 | return protoimpl.X.MessageStringOf(x)
154 | }
155 |
156 | func (*ListShortcutsResponse) ProtoMessage() {}
157 |
158 | func (x *ListShortcutsResponse) ProtoReflect() protoreflect.Message {
159 | mi := &file_api_v1_shortcut_service_proto_msgTypes[2]
160 | if x != nil {
161 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
162 | if ms.LoadMessageInfo() == nil {
163 | ms.StoreMessageInfo(mi)
164 | }
165 | return ms
166 | }
167 | return mi.MessageOf(x)
168 | }
169 |
170 | // Deprecated: Use ListShortcutsResponse.ProtoReflect.Descriptor instead.
171 | func (*ListShortcutsResponse) Descriptor() ([]byte, []int) {
172 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{2}
173 | }
174 |
175 | func (x *ListShortcutsResponse) GetShortcuts() []*Shortcut {
176 | if x != nil {
177 | return x.Shortcuts
178 | }
179 | return nil
180 | }
181 |
182 | type GetShortcutRequest struct {
183 | state protoimpl.MessageState `protogen:"open.v1"`
184 | // Required. The resource name of the shortcut to retrieve.
185 | // Format: users/{user}/shortcuts/{shortcut}
186 | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
187 | unknownFields protoimpl.UnknownFields
188 | sizeCache protoimpl.SizeCache
189 | }
190 |
191 | func (x *GetShortcutRequest) Reset() {
192 | *x = GetShortcutRequest{}
193 | mi := &file_api_v1_shortcut_service_proto_msgTypes[3]
194 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
195 | ms.StoreMessageInfo(mi)
196 | }
197 |
198 | func (x *GetShortcutRequest) String() string {
199 | return protoimpl.X.MessageStringOf(x)
200 | }
201 |
202 | func (*GetShortcutRequest) ProtoMessage() {}
203 |
204 | func (x *GetShortcutRequest) ProtoReflect() protoreflect.Message {
205 | mi := &file_api_v1_shortcut_service_proto_msgTypes[3]
206 | if x != nil {
207 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
208 | if ms.LoadMessageInfo() == nil {
209 | ms.StoreMessageInfo(mi)
210 | }
211 | return ms
212 | }
213 | return mi.MessageOf(x)
214 | }
215 |
216 | // Deprecated: Use GetShortcutRequest.ProtoReflect.Descriptor instead.
217 | func (*GetShortcutRequest) Descriptor() ([]byte, []int) {
218 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{3}
219 | }
220 |
221 | func (x *GetShortcutRequest) GetName() string {
222 | if x != nil {
223 | return x.Name
224 | }
225 | return ""
226 | }
227 |
228 | type CreateShortcutRequest struct {
229 | state protoimpl.MessageState `protogen:"open.v1"`
230 | // Required. The parent resource where this shortcut will be created.
231 | // Format: users/{user}
232 | Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
233 | // Required. The shortcut to create.
234 | Shortcut *Shortcut `protobuf:"bytes,2,opt,name=shortcut,proto3" json:"shortcut,omitempty"`
235 | // Optional. If set, validate the request, but do not actually create the shortcut.
236 | ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"`
237 | unknownFields protoimpl.UnknownFields
238 | sizeCache protoimpl.SizeCache
239 | }
240 |
241 | func (x *CreateShortcutRequest) Reset() {
242 | *x = CreateShortcutRequest{}
243 | mi := &file_api_v1_shortcut_service_proto_msgTypes[4]
244 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
245 | ms.StoreMessageInfo(mi)
246 | }
247 |
248 | func (x *CreateShortcutRequest) String() string {
249 | return protoimpl.X.MessageStringOf(x)
250 | }
251 |
252 | func (*CreateShortcutRequest) ProtoMessage() {}
253 |
254 | func (x *CreateShortcutRequest) ProtoReflect() protoreflect.Message {
255 | mi := &file_api_v1_shortcut_service_proto_msgTypes[4]
256 | if x != nil {
257 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
258 | if ms.LoadMessageInfo() == nil {
259 | ms.StoreMessageInfo(mi)
260 | }
261 | return ms
262 | }
263 | return mi.MessageOf(x)
264 | }
265 |
266 | // Deprecated: Use CreateShortcutRequest.ProtoReflect.Descriptor instead.
267 | func (*CreateShortcutRequest) Descriptor() ([]byte, []int) {
268 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{4}
269 | }
270 |
271 | func (x *CreateShortcutRequest) GetParent() string {
272 | if x != nil {
273 | return x.Parent
274 | }
275 | return ""
276 | }
277 |
278 | func (x *CreateShortcutRequest) GetShortcut() *Shortcut {
279 | if x != nil {
280 | return x.Shortcut
281 | }
282 | return nil
283 | }
284 |
285 | func (x *CreateShortcutRequest) GetValidateOnly() bool {
286 | if x != nil {
287 | return x.ValidateOnly
288 | }
289 | return false
290 | }
291 |
292 | type UpdateShortcutRequest struct {
293 | state protoimpl.MessageState `protogen:"open.v1"`
294 | // Required. The shortcut resource which replaces the resource on the server.
295 | Shortcut *Shortcut `protobuf:"bytes,1,opt,name=shortcut,proto3" json:"shortcut,omitempty"`
296 | // Optional. The list of fields to update.
297 | UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
298 | unknownFields protoimpl.UnknownFields
299 | sizeCache protoimpl.SizeCache
300 | }
301 |
302 | func (x *UpdateShortcutRequest) Reset() {
303 | *x = UpdateShortcutRequest{}
304 | mi := &file_api_v1_shortcut_service_proto_msgTypes[5]
305 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
306 | ms.StoreMessageInfo(mi)
307 | }
308 |
309 | func (x *UpdateShortcutRequest) String() string {
310 | return protoimpl.X.MessageStringOf(x)
311 | }
312 |
313 | func (*UpdateShortcutRequest) ProtoMessage() {}
314 |
315 | func (x *UpdateShortcutRequest) ProtoReflect() protoreflect.Message {
316 | mi := &file_api_v1_shortcut_service_proto_msgTypes[5]
317 | if x != nil {
318 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
319 | if ms.LoadMessageInfo() == nil {
320 | ms.StoreMessageInfo(mi)
321 | }
322 | return ms
323 | }
324 | return mi.MessageOf(x)
325 | }
326 |
327 | // Deprecated: Use UpdateShortcutRequest.ProtoReflect.Descriptor instead.
328 | func (*UpdateShortcutRequest) Descriptor() ([]byte, []int) {
329 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{5}
330 | }
331 |
332 | func (x *UpdateShortcutRequest) GetShortcut() *Shortcut {
333 | if x != nil {
334 | return x.Shortcut
335 | }
336 | return nil
337 | }
338 |
339 | func (x *UpdateShortcutRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
340 | if x != nil {
341 | return x.UpdateMask
342 | }
343 | return nil
344 | }
345 |
346 | type DeleteShortcutRequest struct {
347 | state protoimpl.MessageState `protogen:"open.v1"`
348 | // Required. The resource name of the shortcut to delete.
349 | // Format: users/{user}/shortcuts/{shortcut}
350 | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
351 | unknownFields protoimpl.UnknownFields
352 | sizeCache protoimpl.SizeCache
353 | }
354 |
355 | func (x *DeleteShortcutRequest) Reset() {
356 | *x = DeleteShortcutRequest{}
357 | mi := &file_api_v1_shortcut_service_proto_msgTypes[6]
358 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
359 | ms.StoreMessageInfo(mi)
360 | }
361 |
362 | func (x *DeleteShortcutRequest) String() string {
363 | return protoimpl.X.MessageStringOf(x)
364 | }
365 |
366 | func (*DeleteShortcutRequest) ProtoMessage() {}
367 |
368 | func (x *DeleteShortcutRequest) ProtoReflect() protoreflect.Message {
369 | mi := &file_api_v1_shortcut_service_proto_msgTypes[6]
370 | if x != nil {
371 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
372 | if ms.LoadMessageInfo() == nil {
373 | ms.StoreMessageInfo(mi)
374 | }
375 | return ms
376 | }
377 | return mi.MessageOf(x)
378 | }
379 |
380 | // Deprecated: Use DeleteShortcutRequest.ProtoReflect.Descriptor instead.
381 | func (*DeleteShortcutRequest) Descriptor() ([]byte, []int) {
382 | return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{6}
383 | }
384 |
385 | func (x *DeleteShortcutRequest) GetName() string {
386 | if x != nil {
387 | return x.Name
388 | }
389 | return ""
390 | }
391 |
392 | var File_api_v1_shortcut_service_proto protoreflect.FileDescriptor
393 |
394 | const file_api_v1_shortcut_service_proto_rawDesc = "" +
395 | "\n" +
396 | "\x1dapi/v1/shortcut_service.proto\x12\fmemos.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xaf\x01\n" +
397 | "\bShortcut\x12\x17\n" +
398 | "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12\x19\n" +
399 | "\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x1b\n" +
400 | "\x06filter\x18\x03 \x01(\tB\x03\xe0A\x01R\x06filter:R\xeaAO\n" +
401 | "\x15memos.api.v1/Shortcut\x12!users/{user}/shortcuts/{shortcut}*\tshortcuts2\bshortcut\"M\n" +
402 | "\x14ListShortcutsRequest\x125\n" +
403 | "\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/ShortcutR\x06parent\"M\n" +
404 | "\x15ListShortcutsResponse\x124\n" +
405 | "\tshortcuts\x18\x01 \x03(\v2\x16.memos.api.v1.ShortcutR\tshortcuts\"G\n" +
406 | "\x12GetShortcutRequest\x121\n" +
407 | "\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
408 | "\x15memos.api.v1/ShortcutR\x04name\"\xb1\x01\n" +
409 | "\x15CreateShortcutRequest\x125\n" +
410 | "\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/ShortcutR\x06parent\x127\n" +
411 | "\bshortcut\x18\x02 \x01(\v2\x16.memos.api.v1.ShortcutB\x03\xe0A\x02R\bshortcut\x12(\n" +
412 | "\rvalidate_only\x18\x03 \x01(\bB\x03\xe0A\x01R\fvalidateOnly\"\x92\x01\n" +
413 | "\x15UpdateShortcutRequest\x127\n" +
414 | "\bshortcut\x18\x01 \x01(\v2\x16.memos.api.v1.ShortcutB\x03\xe0A\x02R\bshortcut\x12@\n" +
415 | "\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x01R\n" +
416 | "updateMask\"J\n" +
417 | "\x15DeleteShortcutRequest\x121\n" +
418 | "\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
419 | "\x15memos.api.v1/ShortcutR\x04name2\xde\x05\n" +
420 | "\x0fShortcutService\x12\x8d\x01\n" +
421 | "\rListShortcuts\x12\".memos.api.v1.ListShortcutsRequest\x1a#.memos.api.v1.ListShortcutsResponse\"3\xdaA\x06parent\x82\xd3\xe4\x93\x02$\x12\"/api/v1/{parent=users/*}/shortcuts\x12z\n" +
422 | "\vGetShortcut\x12 .memos.api.v1.GetShortcutRequest\x1a\x16.memos.api.v1.Shortcut\"1\xdaA\x04name\x82\xd3\xe4\x93\x02$\x12\"/api/v1/{name=users/*/shortcuts/*}\x12\x95\x01\n" +
423 | "\x0eCreateShortcut\x12#.memos.api.v1.CreateShortcutRequest\x1a\x16.memos.api.v1.Shortcut\"F\xdaA\x0fparent,shortcut\x82\xd3\xe4\x93\x02.:\bshortcut\"\"/api/v1/{parent=users/*}/shortcuts\x12\xa3\x01\n" +
424 | "\x0eUpdateShortcut\x12#.memos.api.v1.UpdateShortcutRequest\x1a\x16.memos.api.v1.Shortcut\"T\xdaA\x14shortcut,update_mask\x82\xd3\xe4\x93\x027:\bshortcut2+/api/v1/{shortcut.name=users/*/shortcuts/*}\x12\x80\x01\n" +
425 | "\x0eDeleteShortcut\x12#.memos.api.v1.DeleteShortcutRequest\x1a\x16.google.protobuf.Empty\"1\xdaA\x04name\x82\xd3\xe4\x93\x02$*\"/api/v1/{name=users/*/shortcuts/*}B\fZ\n" +
426 | "gen/api/v1b\x06proto3"
427 |
428 | var (
429 | file_api_v1_shortcut_service_proto_rawDescOnce sync.Once
430 | file_api_v1_shortcut_service_proto_rawDescData []byte
431 | )
432 |
433 | func file_api_v1_shortcut_service_proto_rawDescGZIP() []byte {
434 | file_api_v1_shortcut_service_proto_rawDescOnce.Do(func() {
435 | file_api_v1_shortcut_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_v1_shortcut_service_proto_rawDesc), len(file_api_v1_shortcut_service_proto_rawDesc)))
436 | })
437 | return file_api_v1_shortcut_service_proto_rawDescData
438 | }
439 |
440 | var file_api_v1_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
441 | var file_api_v1_shortcut_service_proto_goTypes = []any{
442 | (*Shortcut)(nil), // 0: memos.api.v1.Shortcut
443 | (*ListShortcutsRequest)(nil), // 1: memos.api.v1.ListShortcutsRequest
444 | (*ListShortcutsResponse)(nil), // 2: memos.api.v1.ListShortcutsResponse
445 | (*GetShortcutRequest)(nil), // 3: memos.api.v1.GetShortcutRequest
446 | (*CreateShortcutRequest)(nil), // 4: memos.api.v1.CreateShortcutRequest
447 | (*UpdateShortcutRequest)(nil), // 5: memos.api.v1.UpdateShortcutRequest
448 | (*DeleteShortcutRequest)(nil), // 6: memos.api.v1.DeleteShortcutRequest
449 | (*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
450 | (*emptypb.Empty)(nil), // 8: google.protobuf.Empty
451 | }
452 | var file_api_v1_shortcut_service_proto_depIdxs = []int32{
453 | 0, // 0: memos.api.v1.ListShortcutsResponse.shortcuts:type_name -> memos.api.v1.Shortcut
454 | 0, // 1: memos.api.v1.CreateShortcutRequest.shortcut:type_name -> memos.api.v1.Shortcut
455 | 0, // 2: memos.api.v1.UpdateShortcutRequest.shortcut:type_name -> memos.api.v1.Shortcut
456 | 7, // 3: memos.api.v1.UpdateShortcutRequest.update_mask:type_name -> google.protobuf.FieldMask
457 | 1, // 4: memos.api.v1.ShortcutService.ListShortcuts:input_type -> memos.api.v1.ListShortcutsRequest
458 | 3, // 5: memos.api.v1.ShortcutService.GetShortcut:input_type -> memos.api.v1.GetShortcutRequest
459 | 4, // 6: memos.api.v1.ShortcutService.CreateShortcut:input_type -> memos.api.v1.CreateShortcutRequest
460 | 5, // 7: memos.api.v1.ShortcutService.UpdateShortcut:input_type -> memos.api.v1.UpdateShortcutRequest
461 | 6, // 8: memos.api.v1.ShortcutService.DeleteShortcut:input_type -> memos.api.v1.DeleteShortcutRequest
462 | 2, // 9: memos.api.v1.ShortcutService.ListShortcuts:output_type -> memos.api.v1.ListShortcutsResponse
463 | 0, // 10: memos.api.v1.ShortcutService.GetShortcut:output_type -> memos.api.v1.Shortcut
464 | 0, // 11: memos.api.v1.ShortcutService.CreateShortcut:output_type -> memos.api.v1.Shortcut
465 | 0, // 12: memos.api.v1.ShortcutService.UpdateShortcut:output_type -> memos.api.v1.Shortcut
466 | 8, // 13: memos.api.v1.ShortcutService.DeleteShortcut:output_type -> google.protobuf.Empty
467 | 9, // [9:14] is the sub-list for method output_type
468 | 4, // [4:9] is the sub-list for method input_type
469 | 4, // [4:4] is the sub-list for extension type_name
470 | 4, // [4:4] is the sub-list for extension extendee
471 | 0, // [0:4] is the sub-list for field type_name
472 | }
473 |
474 | func init() { file_api_v1_shortcut_service_proto_init() }
475 | func file_api_v1_shortcut_service_proto_init() {
476 | if File_api_v1_shortcut_service_proto != nil {
477 | return
478 | }
479 | type x struct{}
480 | out := protoimpl.TypeBuilder{
481 | File: protoimpl.DescBuilder{
482 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
483 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_shortcut_service_proto_rawDesc), len(file_api_v1_shortcut_service_proto_rawDesc)),
484 | NumEnums: 0,
485 | NumMessages: 7,
486 | NumExtensions: 0,
487 | NumServices: 1,
488 | },
489 | GoTypes: file_api_v1_shortcut_service_proto_goTypes,
490 | DependencyIndexes: file_api_v1_shortcut_service_proto_depIdxs,
491 | MessageInfos: file_api_v1_shortcut_service_proto_msgTypes,
492 | }.Build()
493 | File_api_v1_shortcut_service_proto = out.File
494 | file_api_v1_shortcut_service_proto_goTypes = nil
495 | file_api_v1_shortcut_service_proto_depIdxs = nil
496 | }
497 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/auth_service.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go. DO NOT EDIT.
2 | // versions:
3 | // protoc-gen-go v1.36.10
4 | // protoc (unknown)
5 | // source: api/v1/auth_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | _ "google.golang.org/genproto/googleapis/api/annotations"
11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect"
12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl"
13 | emptypb "google.golang.org/protobuf/types/known/emptypb"
14 | timestamppb "google.golang.org/protobuf/types/known/timestamppb"
15 | reflect "reflect"
16 | sync "sync"
17 | unsafe "unsafe"
18 | )
19 |
20 | const (
21 | // Verify that this generated code is sufficiently up-to-date.
22 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
23 | // Verify that runtime/protoimpl is sufficiently up-to-date.
24 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
25 | )
26 |
27 | type GetCurrentSessionRequest struct {
28 | state protoimpl.MessageState `protogen:"open.v1"`
29 | unknownFields protoimpl.UnknownFields
30 | sizeCache protoimpl.SizeCache
31 | }
32 |
33 | func (x *GetCurrentSessionRequest) Reset() {
34 | *x = GetCurrentSessionRequest{}
35 | mi := &file_api_v1_auth_service_proto_msgTypes[0]
36 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
37 | ms.StoreMessageInfo(mi)
38 | }
39 |
40 | func (x *GetCurrentSessionRequest) String() string {
41 | return protoimpl.X.MessageStringOf(x)
42 | }
43 |
44 | func (*GetCurrentSessionRequest) ProtoMessage() {}
45 |
46 | func (x *GetCurrentSessionRequest) ProtoReflect() protoreflect.Message {
47 | mi := &file_api_v1_auth_service_proto_msgTypes[0]
48 | if x != nil {
49 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
50 | if ms.LoadMessageInfo() == nil {
51 | ms.StoreMessageInfo(mi)
52 | }
53 | return ms
54 | }
55 | return mi.MessageOf(x)
56 | }
57 |
58 | // Deprecated: Use GetCurrentSessionRequest.ProtoReflect.Descriptor instead.
59 | func (*GetCurrentSessionRequest) Descriptor() ([]byte, []int) {
60 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{0}
61 | }
62 |
63 | type GetCurrentSessionResponse struct {
64 | state protoimpl.MessageState `protogen:"open.v1"`
65 | User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
66 | // Last time the session was accessed.
67 | // Used for sliding expiration calculation (last_accessed_time + 2 weeks).
68 | LastAccessedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_accessed_at,json=lastAccessedAt,proto3" json:"last_accessed_at,omitempty"`
69 | unknownFields protoimpl.UnknownFields
70 | sizeCache protoimpl.SizeCache
71 | }
72 |
73 | func (x *GetCurrentSessionResponse) Reset() {
74 | *x = GetCurrentSessionResponse{}
75 | mi := &file_api_v1_auth_service_proto_msgTypes[1]
76 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
77 | ms.StoreMessageInfo(mi)
78 | }
79 |
80 | func (x *GetCurrentSessionResponse) String() string {
81 | return protoimpl.X.MessageStringOf(x)
82 | }
83 |
84 | func (*GetCurrentSessionResponse) ProtoMessage() {}
85 |
86 | func (x *GetCurrentSessionResponse) ProtoReflect() protoreflect.Message {
87 | mi := &file_api_v1_auth_service_proto_msgTypes[1]
88 | if x != nil {
89 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
90 | if ms.LoadMessageInfo() == nil {
91 | ms.StoreMessageInfo(mi)
92 | }
93 | return ms
94 | }
95 | return mi.MessageOf(x)
96 | }
97 |
98 | // Deprecated: Use GetCurrentSessionResponse.ProtoReflect.Descriptor instead.
99 | func (*GetCurrentSessionResponse) Descriptor() ([]byte, []int) {
100 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{1}
101 | }
102 |
103 | func (x *GetCurrentSessionResponse) GetUser() *User {
104 | if x != nil {
105 | return x.User
106 | }
107 | return nil
108 | }
109 |
110 | func (x *GetCurrentSessionResponse) GetLastAccessedAt() *timestamppb.Timestamp {
111 | if x != nil {
112 | return x.LastAccessedAt
113 | }
114 | return nil
115 | }
116 |
117 | type CreateSessionRequest struct {
118 | state protoimpl.MessageState `protogen:"open.v1"`
119 | // Provide one authentication method (username/password or SSO).
120 | // Required field to specify the authentication method.
121 | //
122 | // Types that are valid to be assigned to Credentials:
123 | //
124 | // *CreateSessionRequest_PasswordCredentials_
125 | // *CreateSessionRequest_SsoCredentials
126 | Credentials isCreateSessionRequest_Credentials `protobuf_oneof:"credentials"`
127 | unknownFields protoimpl.UnknownFields
128 | sizeCache protoimpl.SizeCache
129 | }
130 |
131 | func (x *CreateSessionRequest) Reset() {
132 | *x = CreateSessionRequest{}
133 | mi := &file_api_v1_auth_service_proto_msgTypes[2]
134 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
135 | ms.StoreMessageInfo(mi)
136 | }
137 |
138 | func (x *CreateSessionRequest) String() string {
139 | return protoimpl.X.MessageStringOf(x)
140 | }
141 |
142 | func (*CreateSessionRequest) ProtoMessage() {}
143 |
144 | func (x *CreateSessionRequest) ProtoReflect() protoreflect.Message {
145 | mi := &file_api_v1_auth_service_proto_msgTypes[2]
146 | if x != nil {
147 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
148 | if ms.LoadMessageInfo() == nil {
149 | ms.StoreMessageInfo(mi)
150 | }
151 | return ms
152 | }
153 | return mi.MessageOf(x)
154 | }
155 |
156 | // Deprecated: Use CreateSessionRequest.ProtoReflect.Descriptor instead.
157 | func (*CreateSessionRequest) Descriptor() ([]byte, []int) {
158 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{2}
159 | }
160 |
161 | func (x *CreateSessionRequest) GetCredentials() isCreateSessionRequest_Credentials {
162 | if x != nil {
163 | return x.Credentials
164 | }
165 | return nil
166 | }
167 |
168 | func (x *CreateSessionRequest) GetPasswordCredentials() *CreateSessionRequest_PasswordCredentials {
169 | if x != nil {
170 | if x, ok := x.Credentials.(*CreateSessionRequest_PasswordCredentials_); ok {
171 | return x.PasswordCredentials
172 | }
173 | }
174 | return nil
175 | }
176 |
177 | func (x *CreateSessionRequest) GetSsoCredentials() *CreateSessionRequest_SSOCredentials {
178 | if x != nil {
179 | if x, ok := x.Credentials.(*CreateSessionRequest_SsoCredentials); ok {
180 | return x.SsoCredentials
181 | }
182 | }
183 | return nil
184 | }
185 |
186 | type isCreateSessionRequest_Credentials interface {
187 | isCreateSessionRequest_Credentials()
188 | }
189 |
190 | type CreateSessionRequest_PasswordCredentials_ struct {
191 | // Username and password authentication method.
192 | PasswordCredentials *CreateSessionRequest_PasswordCredentials `protobuf:"bytes,1,opt,name=password_credentials,json=passwordCredentials,proto3,oneof"`
193 | }
194 |
195 | type CreateSessionRequest_SsoCredentials struct {
196 | // SSO provider authentication method.
197 | SsoCredentials *CreateSessionRequest_SSOCredentials `protobuf:"bytes,2,opt,name=sso_credentials,json=ssoCredentials,proto3,oneof"`
198 | }
199 |
200 | func (*CreateSessionRequest_PasswordCredentials_) isCreateSessionRequest_Credentials() {}
201 |
202 | func (*CreateSessionRequest_SsoCredentials) isCreateSessionRequest_Credentials() {}
203 |
204 | type CreateSessionResponse struct {
205 | state protoimpl.MessageState `protogen:"open.v1"`
206 | // The authenticated user information.
207 | User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
208 | // Last time the session was accessed.
209 | // Used for sliding expiration calculation (last_accessed_time + 2 weeks).
210 | LastAccessedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_accessed_at,json=lastAccessedAt,proto3" json:"last_accessed_at,omitempty"`
211 | unknownFields protoimpl.UnknownFields
212 | sizeCache protoimpl.SizeCache
213 | }
214 |
215 | func (x *CreateSessionResponse) Reset() {
216 | *x = CreateSessionResponse{}
217 | mi := &file_api_v1_auth_service_proto_msgTypes[3]
218 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
219 | ms.StoreMessageInfo(mi)
220 | }
221 |
222 | func (x *CreateSessionResponse) String() string {
223 | return protoimpl.X.MessageStringOf(x)
224 | }
225 |
226 | func (*CreateSessionResponse) ProtoMessage() {}
227 |
228 | func (x *CreateSessionResponse) ProtoReflect() protoreflect.Message {
229 | mi := &file_api_v1_auth_service_proto_msgTypes[3]
230 | if x != nil {
231 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
232 | if ms.LoadMessageInfo() == nil {
233 | ms.StoreMessageInfo(mi)
234 | }
235 | return ms
236 | }
237 | return mi.MessageOf(x)
238 | }
239 |
240 | // Deprecated: Use CreateSessionResponse.ProtoReflect.Descriptor instead.
241 | func (*CreateSessionResponse) Descriptor() ([]byte, []int) {
242 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{3}
243 | }
244 |
245 | func (x *CreateSessionResponse) GetUser() *User {
246 | if x != nil {
247 | return x.User
248 | }
249 | return nil
250 | }
251 |
252 | func (x *CreateSessionResponse) GetLastAccessedAt() *timestamppb.Timestamp {
253 | if x != nil {
254 | return x.LastAccessedAt
255 | }
256 | return nil
257 | }
258 |
259 | type DeleteSessionRequest struct {
260 | state protoimpl.MessageState `protogen:"open.v1"`
261 | unknownFields protoimpl.UnknownFields
262 | sizeCache protoimpl.SizeCache
263 | }
264 |
265 | func (x *DeleteSessionRequest) Reset() {
266 | *x = DeleteSessionRequest{}
267 | mi := &file_api_v1_auth_service_proto_msgTypes[4]
268 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
269 | ms.StoreMessageInfo(mi)
270 | }
271 |
272 | func (x *DeleteSessionRequest) String() string {
273 | return protoimpl.X.MessageStringOf(x)
274 | }
275 |
276 | func (*DeleteSessionRequest) ProtoMessage() {}
277 |
278 | func (x *DeleteSessionRequest) ProtoReflect() protoreflect.Message {
279 | mi := &file_api_v1_auth_service_proto_msgTypes[4]
280 | if x != nil {
281 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
282 | if ms.LoadMessageInfo() == nil {
283 | ms.StoreMessageInfo(mi)
284 | }
285 | return ms
286 | }
287 | return mi.MessageOf(x)
288 | }
289 |
290 | // Deprecated: Use DeleteSessionRequest.ProtoReflect.Descriptor instead.
291 | func (*DeleteSessionRequest) Descriptor() ([]byte, []int) {
292 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{4}
293 | }
294 |
295 | // Nested message for password-based authentication credentials.
296 | type CreateSessionRequest_PasswordCredentials struct {
297 | state protoimpl.MessageState `protogen:"open.v1"`
298 | // The username to sign in with.
299 | // Required field for password-based authentication.
300 | Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
301 | // The password to sign in with.
302 | // Required field for password-based authentication.
303 | Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
304 | unknownFields protoimpl.UnknownFields
305 | sizeCache protoimpl.SizeCache
306 | }
307 |
308 | func (x *CreateSessionRequest_PasswordCredentials) Reset() {
309 | *x = CreateSessionRequest_PasswordCredentials{}
310 | mi := &file_api_v1_auth_service_proto_msgTypes[5]
311 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
312 | ms.StoreMessageInfo(mi)
313 | }
314 |
315 | func (x *CreateSessionRequest_PasswordCredentials) String() string {
316 | return protoimpl.X.MessageStringOf(x)
317 | }
318 |
319 | func (*CreateSessionRequest_PasswordCredentials) ProtoMessage() {}
320 |
321 | func (x *CreateSessionRequest_PasswordCredentials) ProtoReflect() protoreflect.Message {
322 | mi := &file_api_v1_auth_service_proto_msgTypes[5]
323 | if x != nil {
324 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
325 | if ms.LoadMessageInfo() == nil {
326 | ms.StoreMessageInfo(mi)
327 | }
328 | return ms
329 | }
330 | return mi.MessageOf(x)
331 | }
332 |
333 | // Deprecated: Use CreateSessionRequest_PasswordCredentials.ProtoReflect.Descriptor instead.
334 | func (*CreateSessionRequest_PasswordCredentials) Descriptor() ([]byte, []int) {
335 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{2, 0}
336 | }
337 |
338 | func (x *CreateSessionRequest_PasswordCredentials) GetUsername() string {
339 | if x != nil {
340 | return x.Username
341 | }
342 | return ""
343 | }
344 |
345 | func (x *CreateSessionRequest_PasswordCredentials) GetPassword() string {
346 | if x != nil {
347 | return x.Password
348 | }
349 | return ""
350 | }
351 |
352 | // Nested message for SSO authentication credentials.
353 | type CreateSessionRequest_SSOCredentials struct {
354 | state protoimpl.MessageState `protogen:"open.v1"`
355 | // The ID of the SSO provider.
356 | // Required field to identify the SSO provider.
357 | IdpId int32 `protobuf:"varint,1,opt,name=idp_id,json=idpId,proto3" json:"idp_id,omitempty"`
358 | // The authorization code from the SSO provider.
359 | // Required field for completing the SSO flow.
360 | Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
361 | // The redirect URI used in the SSO flow.
362 | // Required field for security validation.
363 | RedirectUri string `protobuf:"bytes,3,opt,name=redirect_uri,json=redirectUri,proto3" json:"redirect_uri,omitempty"`
364 | unknownFields protoimpl.UnknownFields
365 | sizeCache protoimpl.SizeCache
366 | }
367 |
368 | func (x *CreateSessionRequest_SSOCredentials) Reset() {
369 | *x = CreateSessionRequest_SSOCredentials{}
370 | mi := &file_api_v1_auth_service_proto_msgTypes[6]
371 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
372 | ms.StoreMessageInfo(mi)
373 | }
374 |
375 | func (x *CreateSessionRequest_SSOCredentials) String() string {
376 | return protoimpl.X.MessageStringOf(x)
377 | }
378 |
379 | func (*CreateSessionRequest_SSOCredentials) ProtoMessage() {}
380 |
381 | func (x *CreateSessionRequest_SSOCredentials) ProtoReflect() protoreflect.Message {
382 | mi := &file_api_v1_auth_service_proto_msgTypes[6]
383 | if x != nil {
384 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
385 | if ms.LoadMessageInfo() == nil {
386 | ms.StoreMessageInfo(mi)
387 | }
388 | return ms
389 | }
390 | return mi.MessageOf(x)
391 | }
392 |
393 | // Deprecated: Use CreateSessionRequest_SSOCredentials.ProtoReflect.Descriptor instead.
394 | func (*CreateSessionRequest_SSOCredentials) Descriptor() ([]byte, []int) {
395 | return file_api_v1_auth_service_proto_rawDescGZIP(), []int{2, 1}
396 | }
397 |
398 | func (x *CreateSessionRequest_SSOCredentials) GetIdpId() int32 {
399 | if x != nil {
400 | return x.IdpId
401 | }
402 | return 0
403 | }
404 |
405 | func (x *CreateSessionRequest_SSOCredentials) GetCode() string {
406 | if x != nil {
407 | return x.Code
408 | }
409 | return ""
410 | }
411 |
412 | func (x *CreateSessionRequest_SSOCredentials) GetRedirectUri() string {
413 | if x != nil {
414 | return x.RedirectUri
415 | }
416 | return ""
417 | }
418 |
419 | var File_api_v1_auth_service_proto protoreflect.FileDescriptor
420 |
421 | const file_api_v1_auth_service_proto_rawDesc = "" +
422 | "\n" +
423 | "\x19api/v1/auth_service.proto\x12\fmemos.api.v1\x1a\x19api/v1/user_service.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1a\n" +
424 | "\x18GetCurrentSessionRequest\"\x89\x01\n" +
425 | "\x19GetCurrentSessionResponse\x12&\n" +
426 | "\x04user\x18\x01 \x01(\v2\x12.memos.api.v1.UserR\x04user\x12D\n" +
427 | "\x10last_accessed_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x0elastAccessedAt\"\xb8\x03\n" +
428 | "\x14CreateSessionRequest\x12k\n" +
429 | "\x14password_credentials\x18\x01 \x01(\v26.memos.api.v1.CreateSessionRequest.PasswordCredentialsH\x00R\x13passwordCredentials\x12\\\n" +
430 | "\x0fsso_credentials\x18\x02 \x01(\v21.memos.api.v1.CreateSessionRequest.SSOCredentialsH\x00R\x0essoCredentials\x1aW\n" +
431 | "\x13PasswordCredentials\x12\x1f\n" +
432 | "\busername\x18\x01 \x01(\tB\x03\xe0A\x02R\busername\x12\x1f\n" +
433 | "\bpassword\x18\x02 \x01(\tB\x03\xe0A\x02R\bpassword\x1am\n" +
434 | "\x0eSSOCredentials\x12\x1a\n" +
435 | "\x06idp_id\x18\x01 \x01(\x05B\x03\xe0A\x02R\x05idpId\x12\x17\n" +
436 | "\x04code\x18\x02 \x01(\tB\x03\xe0A\x02R\x04code\x12&\n" +
437 | "\fredirect_uri\x18\x03 \x01(\tB\x03\xe0A\x02R\vredirectUriB\r\n" +
438 | "\vcredentials\"\x85\x01\n" +
439 | "\x15CreateSessionResponse\x12&\n" +
440 | "\x04user\x18\x01 \x01(\v2\x12.memos.api.v1.UserR\x04user\x12D\n" +
441 | "\x10last_accessed_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x0elastAccessedAt\"\x16\n" +
442 | "\x14DeleteSessionRequest2\x8b\x03\n" +
443 | "\vAuthService\x12\x8b\x01\n" +
444 | "\x11GetCurrentSession\x12&.memos.api.v1.GetCurrentSessionRequest\x1a'.memos.api.v1.GetCurrentSessionResponse\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/auth/sessions/current\x12z\n" +
445 | "\rCreateSession\x12\".memos.api.v1.CreateSessionRequest\x1a#.memos.api.v1.CreateSessionResponse\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/api/v1/auth/sessions\x12r\n" +
446 | "\rDeleteSession\x12\".memos.api.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"%\x82\xd3\xe4\x93\x02\x1f*\x1d/api/v1/auth/sessions/currentB\fZ\n" +
447 | "gen/api/v1b\x06proto3"
448 |
449 | var (
450 | file_api_v1_auth_service_proto_rawDescOnce sync.Once
451 | file_api_v1_auth_service_proto_rawDescData []byte
452 | )
453 |
454 | func file_api_v1_auth_service_proto_rawDescGZIP() []byte {
455 | file_api_v1_auth_service_proto_rawDescOnce.Do(func() {
456 | file_api_v1_auth_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_v1_auth_service_proto_rawDesc), len(file_api_v1_auth_service_proto_rawDesc)))
457 | })
458 | return file_api_v1_auth_service_proto_rawDescData
459 | }
460 |
461 | var file_api_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
462 | var file_api_v1_auth_service_proto_goTypes = []any{
463 | (*GetCurrentSessionRequest)(nil), // 0: memos.api.v1.GetCurrentSessionRequest
464 | (*GetCurrentSessionResponse)(nil), // 1: memos.api.v1.GetCurrentSessionResponse
465 | (*CreateSessionRequest)(nil), // 2: memos.api.v1.CreateSessionRequest
466 | (*CreateSessionResponse)(nil), // 3: memos.api.v1.CreateSessionResponse
467 | (*DeleteSessionRequest)(nil), // 4: memos.api.v1.DeleteSessionRequest
468 | (*CreateSessionRequest_PasswordCredentials)(nil), // 5: memos.api.v1.CreateSessionRequest.PasswordCredentials
469 | (*CreateSessionRequest_SSOCredentials)(nil), // 6: memos.api.v1.CreateSessionRequest.SSOCredentials
470 | (*User)(nil), // 7: memos.api.v1.User
471 | (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
472 | (*emptypb.Empty)(nil), // 9: google.protobuf.Empty
473 | }
474 | var file_api_v1_auth_service_proto_depIdxs = []int32{
475 | 7, // 0: memos.api.v1.GetCurrentSessionResponse.user:type_name -> memos.api.v1.User
476 | 8, // 1: memos.api.v1.GetCurrentSessionResponse.last_accessed_at:type_name -> google.protobuf.Timestamp
477 | 5, // 2: memos.api.v1.CreateSessionRequest.password_credentials:type_name -> memos.api.v1.CreateSessionRequest.PasswordCredentials
478 | 6, // 3: memos.api.v1.CreateSessionRequest.sso_credentials:type_name -> memos.api.v1.CreateSessionRequest.SSOCredentials
479 | 7, // 4: memos.api.v1.CreateSessionResponse.user:type_name -> memos.api.v1.User
480 | 8, // 5: memos.api.v1.CreateSessionResponse.last_accessed_at:type_name -> google.protobuf.Timestamp
481 | 0, // 6: memos.api.v1.AuthService.GetCurrentSession:input_type -> memos.api.v1.GetCurrentSessionRequest
482 | 2, // 7: memos.api.v1.AuthService.CreateSession:input_type -> memos.api.v1.CreateSessionRequest
483 | 4, // 8: memos.api.v1.AuthService.DeleteSession:input_type -> memos.api.v1.DeleteSessionRequest
484 | 1, // 9: memos.api.v1.AuthService.GetCurrentSession:output_type -> memos.api.v1.GetCurrentSessionResponse
485 | 3, // 10: memos.api.v1.AuthService.CreateSession:output_type -> memos.api.v1.CreateSessionResponse
486 | 9, // 11: memos.api.v1.AuthService.DeleteSession:output_type -> google.protobuf.Empty
487 | 9, // [9:12] is the sub-list for method output_type
488 | 6, // [6:9] is the sub-list for method input_type
489 | 6, // [6:6] is the sub-list for extension type_name
490 | 6, // [6:6] is the sub-list for extension extendee
491 | 0, // [0:6] is the sub-list for field type_name
492 | }
493 |
494 | func init() { file_api_v1_auth_service_proto_init() }
495 | func file_api_v1_auth_service_proto_init() {
496 | if File_api_v1_auth_service_proto != nil {
497 | return
498 | }
499 | file_api_v1_user_service_proto_init()
500 | file_api_v1_auth_service_proto_msgTypes[2].OneofWrappers = []any{
501 | (*CreateSessionRequest_PasswordCredentials_)(nil),
502 | (*CreateSessionRequest_SsoCredentials)(nil),
503 | }
504 | type x struct{}
505 | out := protoimpl.TypeBuilder{
506 | File: protoimpl.DescBuilder{
507 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
508 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_auth_service_proto_rawDesc), len(file_api_v1_auth_service_proto_rawDesc)),
509 | NumEnums: 0,
510 | NumMessages: 7,
511 | NumExtensions: 0,
512 | NumServices: 1,
513 | },
514 | GoTypes: file_api_v1_auth_service_proto_goTypes,
515 | DependencyIndexes: file_api_v1_auth_service_proto_depIdxs,
516 | MessageInfos: file_api_v1_auth_service_proto_msgTypes,
517 | }.Build()
518 | File_api_v1_auth_service_proto = out.File
519 | file_api_v1_auth_service_proto_goTypes = nil
520 | file_api_v1_auth_service_proto_depIdxs = nil
521 | }
522 |
--------------------------------------------------------------------------------
/server/memos/proto/gen/api/v1/activity_service.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go. DO NOT EDIT.
2 | // versions:
3 | // protoc-gen-go v1.36.10
4 | // protoc (unknown)
5 | // source: api/v1/activity_service.proto
6 |
7 | package v1
8 |
9 | import (
10 | _ "google.golang.org/genproto/googleapis/api/annotations"
11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect"
12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl"
13 | timestamppb "google.golang.org/protobuf/types/known/timestamppb"
14 | reflect "reflect"
15 | sync "sync"
16 | unsafe "unsafe"
17 | )
18 |
19 | const (
20 | // Verify that this generated code is sufficiently up-to-date.
21 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
22 | // Verify that runtime/protoimpl is sufficiently up-to-date.
23 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
24 | )
25 |
26 | // Activity types.
27 | type Activity_Type int32
28 |
29 | const (
30 | // Unspecified type.
31 | Activity_TYPE_UNSPECIFIED Activity_Type = 0
32 | // Memo comment activity.
33 | Activity_MEMO_COMMENT Activity_Type = 1
34 | )
35 |
36 | // Enum value maps for Activity_Type.
37 | var (
38 | Activity_Type_name = map[int32]string{
39 | 0: "TYPE_UNSPECIFIED",
40 | 1: "MEMO_COMMENT",
41 | }
42 | Activity_Type_value = map[string]int32{
43 | "TYPE_UNSPECIFIED": 0,
44 | "MEMO_COMMENT": 1,
45 | }
46 | )
47 |
48 | func (x Activity_Type) Enum() *Activity_Type {
49 | p := new(Activity_Type)
50 | *p = x
51 | return p
52 | }
53 |
54 | func (x Activity_Type) String() string {
55 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
56 | }
57 |
58 | func (Activity_Type) Descriptor() protoreflect.EnumDescriptor {
59 | return file_api_v1_activity_service_proto_enumTypes[0].Descriptor()
60 | }
61 |
62 | func (Activity_Type) Type() protoreflect.EnumType {
63 | return &file_api_v1_activity_service_proto_enumTypes[0]
64 | }
65 |
66 | func (x Activity_Type) Number() protoreflect.EnumNumber {
67 | return protoreflect.EnumNumber(x)
68 | }
69 |
70 | // Deprecated: Use Activity_Type.Descriptor instead.
71 | func (Activity_Type) EnumDescriptor() ([]byte, []int) {
72 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{0, 0}
73 | }
74 |
75 | // Activity levels.
76 | type Activity_Level int32
77 |
78 | const (
79 | // Unspecified level.
80 | Activity_LEVEL_UNSPECIFIED Activity_Level = 0
81 | // Info level.
82 | Activity_INFO Activity_Level = 1
83 | // Warn level.
84 | Activity_WARN Activity_Level = 2
85 | // Error level.
86 | Activity_ERROR Activity_Level = 3
87 | )
88 |
89 | // Enum value maps for Activity_Level.
90 | var (
91 | Activity_Level_name = map[int32]string{
92 | 0: "LEVEL_UNSPECIFIED",
93 | 1: "INFO",
94 | 2: "WARN",
95 | 3: "ERROR",
96 | }
97 | Activity_Level_value = map[string]int32{
98 | "LEVEL_UNSPECIFIED": 0,
99 | "INFO": 1,
100 | "WARN": 2,
101 | "ERROR": 3,
102 | }
103 | )
104 |
105 | func (x Activity_Level) Enum() *Activity_Level {
106 | p := new(Activity_Level)
107 | *p = x
108 | return p
109 | }
110 |
111 | func (x Activity_Level) String() string {
112 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
113 | }
114 |
115 | func (Activity_Level) Descriptor() protoreflect.EnumDescriptor {
116 | return file_api_v1_activity_service_proto_enumTypes[1].Descriptor()
117 | }
118 |
119 | func (Activity_Level) Type() protoreflect.EnumType {
120 | return &file_api_v1_activity_service_proto_enumTypes[1]
121 | }
122 |
123 | func (x Activity_Level) Number() protoreflect.EnumNumber {
124 | return protoreflect.EnumNumber(x)
125 | }
126 |
127 | // Deprecated: Use Activity_Level.Descriptor instead.
128 | func (Activity_Level) EnumDescriptor() ([]byte, []int) {
129 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{0, 1}
130 | }
131 |
132 | type Activity struct {
133 | state protoimpl.MessageState `protogen:"open.v1"`
134 | // The name of the activity.
135 | // Format: activities/{id}
136 | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
137 | // The name of the creator.
138 | // Format: users/{user}
139 | Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
140 | // The type of the activity.
141 | Type Activity_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.api.v1.Activity_Type" json:"type,omitempty"`
142 | // The level of the activity.
143 | Level Activity_Level `protobuf:"varint,4,opt,name=level,proto3,enum=memos.api.v1.Activity_Level" json:"level,omitempty"`
144 | // The create time of the activity.
145 | CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
146 | // The payload of the activity.
147 | Payload *ActivityPayload `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
148 | unknownFields protoimpl.UnknownFields
149 | sizeCache protoimpl.SizeCache
150 | }
151 |
152 | func (x *Activity) Reset() {
153 | *x = Activity{}
154 | mi := &file_api_v1_activity_service_proto_msgTypes[0]
155 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
156 | ms.StoreMessageInfo(mi)
157 | }
158 |
159 | func (x *Activity) String() string {
160 | return protoimpl.X.MessageStringOf(x)
161 | }
162 |
163 | func (*Activity) ProtoMessage() {}
164 |
165 | func (x *Activity) ProtoReflect() protoreflect.Message {
166 | mi := &file_api_v1_activity_service_proto_msgTypes[0]
167 | if x != nil {
168 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
169 | if ms.LoadMessageInfo() == nil {
170 | ms.StoreMessageInfo(mi)
171 | }
172 | return ms
173 | }
174 | return mi.MessageOf(x)
175 | }
176 |
177 | // Deprecated: Use Activity.ProtoReflect.Descriptor instead.
178 | func (*Activity) Descriptor() ([]byte, []int) {
179 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{0}
180 | }
181 |
182 | func (x *Activity) GetName() string {
183 | if x != nil {
184 | return x.Name
185 | }
186 | return ""
187 | }
188 |
189 | func (x *Activity) GetCreator() string {
190 | if x != nil {
191 | return x.Creator
192 | }
193 | return ""
194 | }
195 |
196 | func (x *Activity) GetType() Activity_Type {
197 | if x != nil {
198 | return x.Type
199 | }
200 | return Activity_TYPE_UNSPECIFIED
201 | }
202 |
203 | func (x *Activity) GetLevel() Activity_Level {
204 | if x != nil {
205 | return x.Level
206 | }
207 | return Activity_LEVEL_UNSPECIFIED
208 | }
209 |
210 | func (x *Activity) GetCreateTime() *timestamppb.Timestamp {
211 | if x != nil {
212 | return x.CreateTime
213 | }
214 | return nil
215 | }
216 |
217 | func (x *Activity) GetPayload() *ActivityPayload {
218 | if x != nil {
219 | return x.Payload
220 | }
221 | return nil
222 | }
223 |
224 | type ActivityPayload struct {
225 | state protoimpl.MessageState `protogen:"open.v1"`
226 | // Types that are valid to be assigned to Payload:
227 | //
228 | // *ActivityPayload_MemoComment
229 | Payload isActivityPayload_Payload `protobuf_oneof:"payload"`
230 | unknownFields protoimpl.UnknownFields
231 | sizeCache protoimpl.SizeCache
232 | }
233 |
234 | func (x *ActivityPayload) Reset() {
235 | *x = ActivityPayload{}
236 | mi := &file_api_v1_activity_service_proto_msgTypes[1]
237 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
238 | ms.StoreMessageInfo(mi)
239 | }
240 |
241 | func (x *ActivityPayload) String() string {
242 | return protoimpl.X.MessageStringOf(x)
243 | }
244 |
245 | func (*ActivityPayload) ProtoMessage() {}
246 |
247 | func (x *ActivityPayload) ProtoReflect() protoreflect.Message {
248 | mi := &file_api_v1_activity_service_proto_msgTypes[1]
249 | if x != nil {
250 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
251 | if ms.LoadMessageInfo() == nil {
252 | ms.StoreMessageInfo(mi)
253 | }
254 | return ms
255 | }
256 | return mi.MessageOf(x)
257 | }
258 |
259 | // Deprecated: Use ActivityPayload.ProtoReflect.Descriptor instead.
260 | func (*ActivityPayload) Descriptor() ([]byte, []int) {
261 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{1}
262 | }
263 |
264 | func (x *ActivityPayload) GetPayload() isActivityPayload_Payload {
265 | if x != nil {
266 | return x.Payload
267 | }
268 | return nil
269 | }
270 |
271 | func (x *ActivityPayload) GetMemoComment() *ActivityMemoCommentPayload {
272 | if x != nil {
273 | if x, ok := x.Payload.(*ActivityPayload_MemoComment); ok {
274 | return x.MemoComment
275 | }
276 | }
277 | return nil
278 | }
279 |
280 | type isActivityPayload_Payload interface {
281 | isActivityPayload_Payload()
282 | }
283 |
284 | type ActivityPayload_MemoComment struct {
285 | // Memo comment activity payload.
286 | MemoComment *ActivityMemoCommentPayload `protobuf:"bytes,1,opt,name=memo_comment,json=memoComment,proto3,oneof"`
287 | }
288 |
289 | func (*ActivityPayload_MemoComment) isActivityPayload_Payload() {}
290 |
291 | // ActivityMemoCommentPayload represents the payload of a memo comment activity.
292 | type ActivityMemoCommentPayload struct {
293 | state protoimpl.MessageState `protogen:"open.v1"`
294 | // The memo name of comment.
295 | // Format: memos/{memo}
296 | Memo string `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"`
297 | // The name of related memo.
298 | // Format: memos/{memo}
299 | RelatedMemo string `protobuf:"bytes,2,opt,name=related_memo,json=relatedMemo,proto3" json:"related_memo,omitempty"`
300 | unknownFields protoimpl.UnknownFields
301 | sizeCache protoimpl.SizeCache
302 | }
303 |
304 | func (x *ActivityMemoCommentPayload) Reset() {
305 | *x = ActivityMemoCommentPayload{}
306 | mi := &file_api_v1_activity_service_proto_msgTypes[2]
307 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
308 | ms.StoreMessageInfo(mi)
309 | }
310 |
311 | func (x *ActivityMemoCommentPayload) String() string {
312 | return protoimpl.X.MessageStringOf(x)
313 | }
314 |
315 | func (*ActivityMemoCommentPayload) ProtoMessage() {}
316 |
317 | func (x *ActivityMemoCommentPayload) ProtoReflect() protoreflect.Message {
318 | mi := &file_api_v1_activity_service_proto_msgTypes[2]
319 | if x != nil {
320 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
321 | if ms.LoadMessageInfo() == nil {
322 | ms.StoreMessageInfo(mi)
323 | }
324 | return ms
325 | }
326 | return mi.MessageOf(x)
327 | }
328 |
329 | // Deprecated: Use ActivityMemoCommentPayload.ProtoReflect.Descriptor instead.
330 | func (*ActivityMemoCommentPayload) Descriptor() ([]byte, []int) {
331 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{2}
332 | }
333 |
334 | func (x *ActivityMemoCommentPayload) GetMemo() string {
335 | if x != nil {
336 | return x.Memo
337 | }
338 | return ""
339 | }
340 |
341 | func (x *ActivityMemoCommentPayload) GetRelatedMemo() string {
342 | if x != nil {
343 | return x.RelatedMemo
344 | }
345 | return ""
346 | }
347 |
348 | type ListActivitiesRequest struct {
349 | state protoimpl.MessageState `protogen:"open.v1"`
350 | // The maximum number of activities to return.
351 | // The service may return fewer than this value.
352 | // If unspecified, at most 100 activities will be returned.
353 | // The maximum value is 1000; values above 1000 will be coerced to 1000.
354 | PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
355 | // A page token, received from a previous `ListActivities` call.
356 | // Provide this to retrieve the subsequent page.
357 | PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
358 | unknownFields protoimpl.UnknownFields
359 | sizeCache protoimpl.SizeCache
360 | }
361 |
362 | func (x *ListActivitiesRequest) Reset() {
363 | *x = ListActivitiesRequest{}
364 | mi := &file_api_v1_activity_service_proto_msgTypes[3]
365 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
366 | ms.StoreMessageInfo(mi)
367 | }
368 |
369 | func (x *ListActivitiesRequest) String() string {
370 | return protoimpl.X.MessageStringOf(x)
371 | }
372 |
373 | func (*ListActivitiesRequest) ProtoMessage() {}
374 |
375 | func (x *ListActivitiesRequest) ProtoReflect() protoreflect.Message {
376 | mi := &file_api_v1_activity_service_proto_msgTypes[3]
377 | if x != nil {
378 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
379 | if ms.LoadMessageInfo() == nil {
380 | ms.StoreMessageInfo(mi)
381 | }
382 | return ms
383 | }
384 | return mi.MessageOf(x)
385 | }
386 |
387 | // Deprecated: Use ListActivitiesRequest.ProtoReflect.Descriptor instead.
388 | func (*ListActivitiesRequest) Descriptor() ([]byte, []int) {
389 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{3}
390 | }
391 |
392 | func (x *ListActivitiesRequest) GetPageSize() int32 {
393 | if x != nil {
394 | return x.PageSize
395 | }
396 | return 0
397 | }
398 |
399 | func (x *ListActivitiesRequest) GetPageToken() string {
400 | if x != nil {
401 | return x.PageToken
402 | }
403 | return ""
404 | }
405 |
406 | type ListActivitiesResponse struct {
407 | state protoimpl.MessageState `protogen:"open.v1"`
408 | // The activities.
409 | Activities []*Activity `protobuf:"bytes,1,rep,name=activities,proto3" json:"activities,omitempty"`
410 | // A token to retrieve the next page of results.
411 | // Pass this value in the page_token field in the subsequent call to `ListActivities`
412 | // method to retrieve the next page of results.
413 | NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
414 | unknownFields protoimpl.UnknownFields
415 | sizeCache protoimpl.SizeCache
416 | }
417 |
418 | func (x *ListActivitiesResponse) Reset() {
419 | *x = ListActivitiesResponse{}
420 | mi := &file_api_v1_activity_service_proto_msgTypes[4]
421 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
422 | ms.StoreMessageInfo(mi)
423 | }
424 |
425 | func (x *ListActivitiesResponse) String() string {
426 | return protoimpl.X.MessageStringOf(x)
427 | }
428 |
429 | func (*ListActivitiesResponse) ProtoMessage() {}
430 |
431 | func (x *ListActivitiesResponse) ProtoReflect() protoreflect.Message {
432 | mi := &file_api_v1_activity_service_proto_msgTypes[4]
433 | if x != nil {
434 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
435 | if ms.LoadMessageInfo() == nil {
436 | ms.StoreMessageInfo(mi)
437 | }
438 | return ms
439 | }
440 | return mi.MessageOf(x)
441 | }
442 |
443 | // Deprecated: Use ListActivitiesResponse.ProtoReflect.Descriptor instead.
444 | func (*ListActivitiesResponse) Descriptor() ([]byte, []int) {
445 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{4}
446 | }
447 |
448 | func (x *ListActivitiesResponse) GetActivities() []*Activity {
449 | if x != nil {
450 | return x.Activities
451 | }
452 | return nil
453 | }
454 |
455 | func (x *ListActivitiesResponse) GetNextPageToken() string {
456 | if x != nil {
457 | return x.NextPageToken
458 | }
459 | return ""
460 | }
461 |
462 | type GetActivityRequest struct {
463 | state protoimpl.MessageState `protogen:"open.v1"`
464 | // The name of the activity.
465 | // Format: activities/{id}, id is the system generated auto-incremented id.
466 | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
467 | unknownFields protoimpl.UnknownFields
468 | sizeCache protoimpl.SizeCache
469 | }
470 |
471 | func (x *GetActivityRequest) Reset() {
472 | *x = GetActivityRequest{}
473 | mi := &file_api_v1_activity_service_proto_msgTypes[5]
474 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
475 | ms.StoreMessageInfo(mi)
476 | }
477 |
478 | func (x *GetActivityRequest) String() string {
479 | return protoimpl.X.MessageStringOf(x)
480 | }
481 |
482 | func (*GetActivityRequest) ProtoMessage() {}
483 |
484 | func (x *GetActivityRequest) ProtoReflect() protoreflect.Message {
485 | mi := &file_api_v1_activity_service_proto_msgTypes[5]
486 | if x != nil {
487 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
488 | if ms.LoadMessageInfo() == nil {
489 | ms.StoreMessageInfo(mi)
490 | }
491 | return ms
492 | }
493 | return mi.MessageOf(x)
494 | }
495 |
496 | // Deprecated: Use GetActivityRequest.ProtoReflect.Descriptor instead.
497 | func (*GetActivityRequest) Descriptor() ([]byte, []int) {
498 | return file_api_v1_activity_service_proto_rawDescGZIP(), []int{5}
499 | }
500 |
501 | func (x *GetActivityRequest) GetName() string {
502 | if x != nil {
503 | return x.Name
504 | }
505 | return ""
506 | }
507 |
508 | var File_api_v1_activity_service_proto protoreflect.FileDescriptor
509 |
510 | const file_api_v1_activity_service_proto_rawDesc = "" +
511 | "\n" +
512 | "\x1dapi/v1/activity_service.proto\x12\fmemos.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x03\n" +
513 | "\bActivity\x12\x1a\n" +
514 | "\x04name\x18\x01 \x01(\tB\x06\xe0A\x03\xe0A\bR\x04name\x12\x1d\n" +
515 | "\acreator\x18\x02 \x01(\tB\x03\xe0A\x03R\acreator\x124\n" +
516 | "\x04type\x18\x03 \x01(\x0e2\x1b.memos.api.v1.Activity.TypeB\x03\xe0A\x03R\x04type\x127\n" +
517 | "\x05level\x18\x04 \x01(\x0e2\x1c.memos.api.v1.Activity.LevelB\x03\xe0A\x03R\x05level\x12@\n" +
518 | "\vcreate_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +
519 | "createTime\x12<\n" +
520 | "\apayload\x18\x06 \x01(\v2\x1d.memos.api.v1.ActivityPayloadB\x03\xe0A\x03R\apayload\".\n" +
521 | "\x04Type\x12\x14\n" +
522 | "\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n" +
523 | "\fMEMO_COMMENT\x10\x01\"=\n" +
524 | "\x05Level\x12\x15\n" +
525 | "\x11LEVEL_UNSPECIFIED\x10\x00\x12\b\n" +
526 | "\x04INFO\x10\x01\x12\b\n" +
527 | "\x04WARN\x10\x02\x12\t\n" +
528 | "\x05ERROR\x10\x03:M\xeaAJ\n" +
529 | "\x15memos.api.v1/Activity\x12\x15activities/{activity}\x1a\x04name*\n" +
530 | "activities2\bactivity\"k\n" +
531 | "\x0fActivityPayload\x12M\n" +
532 | "\fmemo_comment\x18\x01 \x01(\v2(.memos.api.v1.ActivityMemoCommentPayloadH\x00R\vmemoCommentB\t\n" +
533 | "\apayload\"S\n" +
534 | "\x1aActivityMemoCommentPayload\x12\x12\n" +
535 | "\x04memo\x18\x01 \x01(\tR\x04memo\x12!\n" +
536 | "\frelated_memo\x18\x02 \x01(\tR\vrelatedMemo\"S\n" +
537 | "\x15ListActivitiesRequest\x12\x1b\n" +
538 | "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
539 | "\n" +
540 | "page_token\x18\x02 \x01(\tR\tpageToken\"x\n" +
541 | "\x16ListActivitiesResponse\x126\n" +
542 | "\n" +
543 | "activities\x18\x01 \x03(\v2\x16.memos.api.v1.ActivityR\n" +
544 | "activities\x12&\n" +
545 | "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"G\n" +
546 | "\x12GetActivityRequest\x121\n" +
547 | "\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
548 | "\x15memos.api.v1/ActivityR\x04name2\xff\x01\n" +
549 | "\x0fActivityService\x12w\n" +
550 | "\x0eListActivities\x12#.memos.api.v1.ListActivitiesRequest\x1a$.memos.api.v1.ListActivitiesResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/api/v1/activities\x12s\n" +
551 | "\vGetActivity\x12 .memos.api.v1.GetActivityRequest\x1a\x16.memos.api.v1.Activity\"*\xdaA\x04name\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v1/{name=activities/*}B\fZ\n" +
552 | "gen/api/v1b\x06proto3"
553 |
554 | var (
555 | file_api_v1_activity_service_proto_rawDescOnce sync.Once
556 | file_api_v1_activity_service_proto_rawDescData []byte
557 | )
558 |
559 | func file_api_v1_activity_service_proto_rawDescGZIP() []byte {
560 | file_api_v1_activity_service_proto_rawDescOnce.Do(func() {
561 | file_api_v1_activity_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_v1_activity_service_proto_rawDesc), len(file_api_v1_activity_service_proto_rawDesc)))
562 | })
563 | return file_api_v1_activity_service_proto_rawDescData
564 | }
565 |
566 | var file_api_v1_activity_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
567 | var file_api_v1_activity_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
568 | var file_api_v1_activity_service_proto_goTypes = []any{
569 | (Activity_Type)(0), // 0: memos.api.v1.Activity.Type
570 | (Activity_Level)(0), // 1: memos.api.v1.Activity.Level
571 | (*Activity)(nil), // 2: memos.api.v1.Activity
572 | (*ActivityPayload)(nil), // 3: memos.api.v1.ActivityPayload
573 | (*ActivityMemoCommentPayload)(nil), // 4: memos.api.v1.ActivityMemoCommentPayload
574 | (*ListActivitiesRequest)(nil), // 5: memos.api.v1.ListActivitiesRequest
575 | (*ListActivitiesResponse)(nil), // 6: memos.api.v1.ListActivitiesResponse
576 | (*GetActivityRequest)(nil), // 7: memos.api.v1.GetActivityRequest
577 | (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
578 | }
579 | var file_api_v1_activity_service_proto_depIdxs = []int32{
580 | 0, // 0: memos.api.v1.Activity.type:type_name -> memos.api.v1.Activity.Type
581 | 1, // 1: memos.api.v1.Activity.level:type_name -> memos.api.v1.Activity.Level
582 | 8, // 2: memos.api.v1.Activity.create_time:type_name -> google.protobuf.Timestamp
583 | 3, // 3: memos.api.v1.Activity.payload:type_name -> memos.api.v1.ActivityPayload
584 | 4, // 4: memos.api.v1.ActivityPayload.memo_comment:type_name -> memos.api.v1.ActivityMemoCommentPayload
585 | 2, // 5: memos.api.v1.ListActivitiesResponse.activities:type_name -> memos.api.v1.Activity
586 | 5, // 6: memos.api.v1.ActivityService.ListActivities:input_type -> memos.api.v1.ListActivitiesRequest
587 | 7, // 7: memos.api.v1.ActivityService.GetActivity:input_type -> memos.api.v1.GetActivityRequest
588 | 6, // 8: memos.api.v1.ActivityService.ListActivities:output_type -> memos.api.v1.ListActivitiesResponse
589 | 2, // 9: memos.api.v1.ActivityService.GetActivity:output_type -> memos.api.v1.Activity
590 | 8, // [8:10] is the sub-list for method output_type
591 | 6, // [6:8] is the sub-list for method input_type
592 | 6, // [6:6] is the sub-list for extension type_name
593 | 6, // [6:6] is the sub-list for extension extendee
594 | 0, // [0:6] is the sub-list for field type_name
595 | }
596 |
597 | func init() { file_api_v1_activity_service_proto_init() }
598 | func file_api_v1_activity_service_proto_init() {
599 | if File_api_v1_activity_service_proto != nil {
600 | return
601 | }
602 | file_api_v1_activity_service_proto_msgTypes[1].OneofWrappers = []any{
603 | (*ActivityPayload_MemoComment)(nil),
604 | }
605 | type x struct{}
606 | out := protoimpl.TypeBuilder{
607 | File: protoimpl.DescBuilder{
608 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
609 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_activity_service_proto_rawDesc), len(file_api_v1_activity_service_proto_rawDesc)),
610 | NumEnums: 2,
611 | NumMessages: 6,
612 | NumExtensions: 0,
613 | NumServices: 1,
614 | },
615 | GoTypes: file_api_v1_activity_service_proto_goTypes,
616 | DependencyIndexes: file_api_v1_activity_service_proto_depIdxs,
617 | EnumInfos: file_api_v1_activity_service_proto_enumTypes,
618 | MessageInfos: file_api_v1_activity_service_proto_msgTypes,
619 | }.Build()
620 | File_api_v1_activity_service_proto = out.File
621 | file_api_v1_activity_service_proto_goTypes = nil
622 | file_api_v1_activity_service_proto_depIdxs = nil
623 | }
624 |
--------------------------------------------------------------------------------