mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
Compare commits
2545 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e0d5412b4 | ||
|
|
8c0bee3840 | ||
|
|
78f6064530 | ||
|
|
d7be24a0e1 | ||
|
|
5493f5f14e | ||
|
|
1dc686fa6c | ||
|
|
4e54ec38ff | ||
|
|
0657a1ef5b | ||
|
|
48546f05b3 | ||
|
|
08a9291964 | ||
|
|
98f2cf6397 | ||
|
|
b1cc1255bb | ||
|
|
b215426623 | ||
|
|
423861d48c | ||
|
|
f2b708c1b8 | ||
|
|
0f4b7c5f4a | ||
|
|
1894ef161f | ||
|
|
98eb57b370 | ||
|
|
cf70867470 | ||
|
|
719c22fef8 | ||
|
|
6010139291 | ||
|
|
cbf556fee5 | ||
|
|
93e848d170 | ||
|
|
60b5b4815d | ||
|
|
98bd4568e7 | ||
|
|
c24225fd89 | ||
|
|
5ea04ca596 | ||
|
|
0275a65781 | ||
|
|
239f28c1e0 | ||
|
|
f78114da43 | ||
|
|
75e76e1331 | ||
|
|
9f83be1d48 | ||
|
|
250bdff4c5 | ||
|
|
b8d4720e5e | ||
|
|
3e11adc15b | ||
|
|
e475f00ba1 | ||
|
|
f0e5a72271 | ||
|
|
ba0876a563 | ||
|
|
a423dac12c | ||
|
|
2b4c2b23b2 | ||
|
|
784fcbb698 | ||
|
|
1ccfa81cf3 | ||
|
|
a177800e83 | ||
|
|
d39cacf1f9 | ||
|
|
8233a6ba1c | ||
|
|
af71ac49bb | ||
|
|
7d6dbb9487 | ||
|
|
4070998f9f | ||
|
|
d3235f75f3 | ||
|
|
e0600388b2 | ||
|
|
16d3de63c2 | ||
|
|
2c50d3469e | ||
|
|
b5d2ff6e28 | ||
|
|
3616194d03 | ||
|
|
811c0757c4 | ||
|
|
464b00ea0b | ||
|
|
a1e610fd8e | ||
|
|
e813853624 | ||
|
|
b2f9496c96 | ||
|
|
f1392e220e | ||
|
|
f37b34544b | ||
|
|
f54b05a521 | ||
|
|
613c9e9416 | ||
|
|
fb15386db2 | ||
|
|
21838d0aae | ||
|
|
52ebfd703c | ||
|
|
8f6d38719f | ||
|
|
93d06bc0f0 | ||
|
|
c25c57ab61 | ||
|
|
b0aad6f694 | ||
|
|
0c251f9ab8 | ||
|
|
0a9212f815 | ||
|
|
537ae622d2 | ||
|
|
3e5e5b1f80 | ||
|
|
3ecbbf31a9 | ||
|
|
deb1deb14c | ||
|
|
c8ff3fa2ee | ||
|
|
f67676ac43 | ||
|
|
38c6c50681 | ||
|
|
74e0f5429a | ||
|
|
3add70714f | ||
|
|
78f0ae649a | ||
|
|
9265b8e2bd | ||
|
|
2317204c50 | ||
|
|
32abc50af4 | ||
|
|
0c673d49ef | ||
|
|
d3744ccfa3 | ||
|
|
c561362d62 | ||
|
|
555b4fbe32 | ||
|
|
8948edf654 | ||
|
|
31e07c083d | ||
|
|
b8763905ba | ||
|
|
62705fed39 | ||
|
|
6df3cf808e | ||
|
|
6c481743de | ||
|
|
83b9ea45b9 | ||
|
|
f79554371d | ||
|
|
eda1983964 | ||
|
|
cf423026a5 | ||
|
|
93e8fa4912 | ||
|
|
bb076ce486 | ||
|
|
cf7718f8dc | ||
|
|
29a22914cf | ||
|
|
087f60ba7b | ||
|
|
d4157bcffa | ||
|
|
ee984a8872 | ||
|
|
80df8f8aed | ||
|
|
a15025303b | ||
|
|
f45f673aec | ||
|
|
f30599fbd2 | ||
|
|
041f9b1beb | ||
|
|
3fbc4d8539 | ||
|
|
5f207c8f0c | ||
|
|
fe5a0fe98a | ||
|
|
584c669068 | ||
|
|
46a085f8df | ||
|
|
e7a788fa71 | ||
|
|
942052b1ea | ||
|
|
deae53c1f1 | ||
|
|
1d99dad435 | ||
|
|
33133ea1a3 | ||
|
|
a4235bb4bf | ||
|
|
e0977e53f7 | ||
|
|
4e12744811 | ||
|
|
40a5503d45 | ||
|
|
16670b6b8d | ||
|
|
d57e7d5a0b | ||
|
|
f7f4206fa1 | ||
|
|
292861be16 | ||
|
|
d0655ece53 | ||
|
|
2c270438ec | ||
|
|
a9caecf479 | ||
|
|
d355e2c631 | ||
|
|
4950ea1c74 | ||
|
|
f9258e41a0 | ||
|
|
e16546f80a | ||
|
|
a73f979f96 | ||
|
|
41549a6951 | ||
|
|
1e8346290c | ||
|
|
6a2701ee83 | ||
|
|
68fcf250a0 | ||
|
|
5aaf0b88fd | ||
|
|
f9b0a2b693 | ||
|
|
bf07a2cfe6 | ||
|
|
776664105a | ||
|
|
b0ecb72eaa | ||
|
|
af1ad2f2db | ||
|
|
56ceba2dec | ||
|
|
e32a585bbf | ||
|
|
dfc0889a4f | ||
|
|
da535c8dc6 | ||
|
|
10c57167cc | ||
|
|
5742f9ca13 | ||
|
|
e9831caca1 | ||
|
|
b23b6302de | ||
|
|
74145157a0 | ||
|
|
05f73a2236 | ||
|
|
775b79338d | ||
|
|
26545c855c | ||
|
|
355ea352aa | ||
|
|
144269fbbc | ||
|
|
590b626052 | ||
|
|
832ad92bac | ||
|
|
20dd3e17f7 | ||
|
|
8ae4bc95dc | ||
|
|
ff175bbb7e | ||
|
|
6d3d71df30 | ||
|
|
d668794c7c | ||
|
|
33f52320f7 | ||
|
|
6295979592 | ||
|
|
cac6f42770 | ||
|
|
00f1773495 | ||
|
|
8a3845ff54 | ||
|
|
155c5baf2c | ||
|
|
4338234641 | ||
|
|
320963098f | ||
|
|
f25c7d9b24 | ||
|
|
d8aeec993c | ||
|
|
1b291422e7 | ||
|
|
8bba7f706e | ||
|
|
f9942002f9 | ||
|
|
92872118b9 | ||
|
|
9b66ef5e26 | ||
|
|
04c78e180c | ||
|
|
cc2370e01e | ||
|
|
7217605831 | ||
|
|
a6a62eb79c | ||
|
|
5f26c52b49 | ||
|
|
647602beac | ||
|
|
81d24f32a7 | ||
|
|
9bcd4f59a2 | ||
|
|
205bf7ed0e | ||
|
|
cdcb61da17 | ||
|
|
7f9af9b12c | ||
|
|
6b253247cb | ||
|
|
761b4e115b | ||
|
|
16f209eada | ||
|
|
06a79a2e37 | ||
|
|
330cc3dc89 | ||
|
|
e8dfd579c3 | ||
|
|
2a93b8d720 | ||
|
|
5d967f41d9 | ||
|
|
339fecbfff | ||
|
|
2cdcd17ba3 | ||
|
|
14d4cfd5a4 | ||
|
|
00d25b12c1 | ||
|
|
95df647265 | ||
|
|
f52e0e005a | ||
|
|
70f3d131f6 | ||
|
|
f7f139d65a | ||
|
|
162521885c | ||
|
|
b0b9513de7 | ||
|
|
f221f9bfe9 | ||
|
|
e831fa8190 | ||
|
|
eae0b7115b | ||
|
|
1f0fffda95 | ||
|
|
404751f378 | ||
|
|
f9dd29ae07 | ||
|
|
1f0bfd2169 | ||
|
|
4aa72306ff | ||
|
|
3b550a8ab8 | ||
|
|
cb7886dc49 | ||
|
|
d00e4fdf17 | ||
|
|
9a2c423435 | ||
|
|
49f8cfd5d1 | ||
|
|
b27004daae | ||
|
|
75359854cc | ||
|
|
cebc46adc7 | ||
|
|
6ee3b0f704 | ||
|
|
bbd206e893 | ||
|
|
cf4db17080 | ||
|
|
c373131b89 | ||
|
|
a77703260f | ||
|
|
8f51529c78 | ||
|
|
707e5caf89 | ||
|
|
17e8fc5408 | ||
|
|
074e7cf71a | ||
|
|
f5461264c5 | ||
|
|
e2ae32063e | ||
|
|
133951328b | ||
|
|
257b8add8c | ||
|
|
755d5b83c6 | ||
|
|
3088cabe10 | ||
|
|
3e6e56b008 | ||
|
|
6d842711e2 | ||
|
|
b84a0592bb | ||
|
|
581a64d5c1 | ||
|
|
4537411109 | ||
|
|
d6b1326a2d | ||
|
|
9490e890c7 | ||
|
|
aed76165ea | ||
|
|
51a90b0013 | ||
|
|
7b1fe9fcfc | ||
|
|
ec67f1b3c9 | ||
|
|
97cfab1758 | ||
|
|
eb251a097e | ||
|
|
4c47e93fce | ||
|
|
af954db473 | ||
|
|
a376dc4dd6 | ||
|
|
8ee56bd29f | ||
|
|
71c39ed554 | ||
|
|
c93b1efbae | ||
|
|
58ae3217ff | ||
|
|
6028838f03 | ||
|
|
000b3a7a2c | ||
|
|
bbdd40b2b0 | ||
|
|
8356ebc46b | ||
|
|
fc95876617 | ||
|
|
b1e196bb4f | ||
|
|
6d10251cbd | ||
|
|
436a6cb084 | ||
|
|
90ed908d2e | ||
|
|
756ab71302 | ||
|
|
a6b09aa5b1 | ||
|
|
ff81ea602d | ||
|
|
8101a5e0b1 | ||
|
|
b5893aa60b | ||
|
|
bedf3b3025 | ||
|
|
09ffa7b818 | ||
|
|
ba7dbc1fca | ||
|
|
15ef57589e | ||
|
|
5aa633948e | ||
|
|
b1297f5d01 | ||
|
|
33e9b13665 | ||
|
|
b79f626a74 | ||
|
|
ec35a42fb5 | ||
|
|
98c9ab70e2 | ||
|
|
edc7645086 | ||
|
|
cbebbca7d6 | ||
|
|
4d62ed46cc | ||
|
|
bb10bb200c | ||
|
|
03c93785f4 | ||
|
|
2fe6d606ec | ||
|
|
c8baeb86ec | ||
|
|
9a88e00df0 | ||
|
|
54a3c25ebd | ||
|
|
d84a88e805 | ||
|
|
5ab845d92e | ||
|
|
4f7a6cd6cc | ||
|
|
c7aaf791e6 | ||
|
|
239348c403 | ||
|
|
9f803aa9bb | ||
|
|
200a0d3e2b | ||
|
|
ea6628066d | ||
|
|
526f46807e | ||
|
|
bfaf06582c | ||
|
|
7331c598df | ||
|
|
f7a445ac8b | ||
|
|
90679cc33a | ||
|
|
192ee7acc0 | ||
|
|
7d94256a2a | ||
|
|
aed4c1392d | ||
|
|
3605efc4d1 | ||
|
|
a0846c2818 | ||
|
|
2ebea4dba9 | ||
|
|
16cfef32d6 | ||
|
|
f637deacfc | ||
|
|
a07805907b | ||
|
|
2e87da4927 | ||
|
|
d460e6bf41 | ||
|
|
e703b4f70d | ||
|
|
be525fa3df | ||
|
|
d1e8af48c0 | ||
|
|
005305cd9a | ||
|
|
8fd1dff484 | ||
|
|
c5fa4fe304 | ||
|
|
8f37d7490c | ||
|
|
18d16abdb5 | ||
|
|
1d83c68cb5 | ||
|
|
861a1e4c9b | ||
|
|
26e5b70483 | ||
|
|
7c5261b5d2 | ||
|
|
7cc8b951a3 | ||
|
|
a3a4e37cb0 | ||
|
|
76c936357b | ||
|
|
6db427e396 | ||
|
|
0a0ccbf6e1 | ||
|
|
96a7d0eb25 | ||
|
|
ed89cb8310 | ||
|
|
722e356044 | ||
|
|
efb15a0453 | ||
|
|
5f2d6b22be | ||
|
|
2dc8ed773c | ||
|
|
86db6d0254 | ||
|
|
f3fb5e0c60 | ||
|
|
1e43c8d84b | ||
|
|
cf207df672 | ||
|
|
5dd1251d1e | ||
|
|
ea104a5e54 | ||
|
|
335a0312f2 | ||
|
|
9c1e2f8137 | ||
|
|
14479347d8 | ||
|
|
0f48cfbb4e | ||
|
|
606a30640d | ||
|
|
ab136e3310 | ||
|
|
21af2a004d | ||
|
|
115b5551b3 | ||
|
|
15be18fa85 | ||
|
|
9ce381abb9 | ||
|
|
2516431b20 | ||
|
|
ded4da07a3 | ||
|
|
e795149186 | ||
|
|
8fe6874b1b | ||
|
|
7c1510e7a9 | ||
|
|
e5fc107920 | ||
|
|
5d740c3813 | ||
|
|
0abe20df72 | ||
|
|
4d41b68d4c | ||
|
|
7c87c1ff74 | ||
|
|
963c630428 | ||
|
|
6b6edc3791 | ||
|
|
425e85f0f9 | ||
|
|
8e7f826ae6 | ||
|
|
9ffc1515f4 | ||
|
|
8cdc0c7ffa | ||
|
|
999a05307e | ||
|
|
ed1954c58c | ||
|
|
77bafba682 | ||
|
|
1540de2f44 | ||
|
|
ed4b48c54f | ||
|
|
706e749275 | ||
|
|
845999292a | ||
|
|
240da335c1 | ||
|
|
f9f277695d | ||
|
|
6cbfbe9c07 | ||
|
|
ec206104e5 | ||
|
|
342f341b3d | ||
|
|
f46b64a17d | ||
|
|
7d5f603482 | ||
|
|
f0a521f5b8 | ||
|
|
59314cdf80 | ||
|
|
ac0315334d | ||
|
|
ac8a374ebd | ||
|
|
95b02341eb | ||
|
|
d34273b186 | ||
|
|
dcfb2b7de2 | ||
|
|
ebcf43c997 | ||
|
|
cfb50f19aa | ||
|
|
e441e3882b | ||
|
|
c1da87a819 | ||
|
|
3b089eeae3 | ||
|
|
9a8a1d017e | ||
|
|
7e23ceb242 | ||
|
|
898b3c3779 | ||
|
|
8eb01adb6f | ||
|
|
621a8d4e20 | ||
|
|
dfa78cac49 | ||
|
|
12f4d3a10d | ||
|
|
00788bd8f8 | ||
|
|
5f2a624c0c | ||
|
|
3e50bee7da | ||
|
|
1aa75847d6 | ||
|
|
89a270cede | ||
|
|
5526355621 | ||
|
|
1ae9bf23a0 | ||
|
|
51a7934616 | ||
|
|
8d08cfe1c9 | ||
|
|
b0f52ade7a | ||
|
|
222d04fb22 | ||
|
|
68468927dd | ||
|
|
dfe29ec766 | ||
|
|
db56e1b575 | ||
|
|
5b92ac1775 | ||
|
|
f2eb9f1b8f | ||
|
|
e602aeecc1 | ||
|
|
ce133ad69b | ||
|
|
e585578553 | ||
|
|
4d9c929c32 | ||
|
|
39bf850591 | ||
|
|
9cd835b979 | ||
|
|
0afdbe3332 | ||
|
|
6b14d87521 | ||
|
|
51d58d3982 | ||
|
|
4378816e44 | ||
|
|
e7bbd850b2 | ||
|
|
c6162d3f38 | ||
|
|
ce32206677 | ||
|
|
50a3af3b29 | ||
|
|
80b64c02fd | ||
|
|
13b911ebf0 | ||
|
|
4a6da91719 | ||
|
|
fa62e8b59a | ||
|
|
8e11826db1 | ||
|
|
e6d0c00cf6 | ||
|
|
03d67d5a00 | ||
|
|
a86117f613 | ||
|
|
fc1a2cf2fc | ||
|
|
d22b772232 | ||
|
|
f1ec5775a7 | ||
|
|
4aa4417d91 | ||
|
|
606e574e19 | ||
|
|
ebe3678288 | ||
|
|
b3ca9969c4 | ||
|
|
3dddd3ec4c | ||
|
|
81aa9b107f | ||
|
|
60efd3ac32 | ||
|
|
4081a6f5ad | ||
|
|
334e489867 | ||
|
|
c7822515a1 | ||
|
|
d86f0bac8c | ||
|
|
e5f244cb50 | ||
|
|
3a5bc82d39 | ||
|
|
a4fa67cd18 | ||
|
|
43a2d6ce09 | ||
|
|
d2434111b4 | ||
|
|
559e427c50 | ||
|
|
99568236a3 | ||
|
|
06fb2174c3 | ||
|
|
5ac17fc012 | ||
|
|
a76b86f18a | ||
|
|
ded8001735 | ||
|
|
185ec2ad2a | ||
|
|
6b59c7670c | ||
|
|
434ef44f8c | ||
|
|
46ea16ef7e | ||
|
|
8f15e8773a | ||
|
|
25efc33b24 | ||
|
|
ba460382b0 | ||
|
|
e35225ff24 | ||
|
|
397a7f00ef | ||
|
|
06eff151e7 | ||
|
|
c30d7ab8f3 | ||
|
|
ab4a670bec | ||
|
|
ce663efc14 | ||
|
|
9e72432f19 | ||
|
|
b056c59dea | ||
|
|
15c90871d9 | ||
|
|
be899cd027 | ||
|
|
8773a3d2c1 | ||
|
|
d2603ee67b | ||
|
|
c92507728a | ||
|
|
eb4f7b47b7 | ||
|
|
1e07b70d23 | ||
|
|
b8a9783db5 | ||
|
|
82e72813f9 | ||
|
|
57510ddee5 | ||
|
|
00c47a0673 | ||
|
|
374f3f7d96 | ||
|
|
8340e6b247 | ||
|
|
7f5148d490 | ||
|
|
c522e1450a | ||
|
|
c342c464a2 | ||
|
|
f6f193af2d | ||
|
|
dd06278692 | ||
|
|
fdd17ce849 | ||
|
|
7cd3fcbc61 | ||
|
|
e78311b3af | ||
|
|
e3afad74ce | ||
|
|
554f93eccc | ||
|
|
79227021f5 | ||
|
|
b4f2a3bd14 | ||
|
|
0b4914d880 | ||
|
|
2f0b0e0071 | ||
|
|
8ce6a32aac | ||
|
|
3158c4b8b5 | ||
|
|
30ae4140f3 | ||
|
|
279cba0e6b | ||
|
|
52539fc130 | ||
|
|
49e3eb107c | ||
|
|
e7d5dfe515 | ||
|
|
28c7a75ea2 | ||
|
|
59d69a05fa | ||
|
|
ad2d492dec | ||
|
|
bee6f278ba | ||
|
|
1bad0543d0 | ||
|
|
73337331cb | ||
|
|
50f7f131ea | ||
|
|
a16bde23f7 | ||
|
|
c5a5f67fdb | ||
|
|
de8db63811 | ||
|
|
dd9ee44a1f | ||
|
|
fa17dce046 | ||
|
|
cbcec80c5d | ||
|
|
2b7bd47b44 | ||
|
|
54c5039db3 | ||
|
|
af646ce2de | ||
|
|
f4ac7ff529 | ||
|
|
55ecdae509 | ||
|
|
ef73299340 | ||
|
|
8c6292925e | ||
|
|
f05a89315c | ||
|
|
a4452d8a2f | ||
|
|
5e74394643 | ||
|
|
f4e722c516 | ||
|
|
12275c6a34 | ||
|
|
21ef5a9bc0 | ||
|
|
87b23940a6 | ||
|
|
11dd23f59b | ||
|
|
887903b66b | ||
|
|
309fab222e | ||
|
|
1dc4f02b64 | ||
|
|
8db90a040c | ||
|
|
932f636d84 | ||
|
|
ed32b20c9e | ||
|
|
10d709c167 | ||
|
|
8455114eef | ||
|
|
c26109cd36 | ||
|
|
4b223c1e4c | ||
|
|
b9cbe6626f | ||
|
|
566171783d | ||
|
|
7edb3598ea | ||
|
|
bc2d2d0cde | ||
|
|
e1977df14b | ||
|
|
ddc89029b7 | ||
|
|
f8b9a83d4a | ||
|
|
2f16b7065a | ||
|
|
e5ff1829a5 | ||
|
|
d7889d9903 | ||
|
|
db3457e081 | ||
|
|
4f2b00b4f3 | ||
|
|
79558028c0 | ||
|
|
70d1301dc3 | ||
|
|
6d5e1def76 | ||
|
|
a5bc2d0ed6 | ||
|
|
08ac60cc70 | ||
|
|
f654d3c90e | ||
|
|
1b69b73eb9 | ||
|
|
3dbb254aeb | ||
|
|
fdb1779a59 | ||
|
|
a316e239ce | ||
|
|
d7f02b94e5 | ||
|
|
d165d87288 | ||
|
|
bf905bba86 | ||
|
|
3a129d5cfb | ||
|
|
024a818e91 | ||
|
|
54a24833a7 | ||
|
|
a620d140c5 | ||
|
|
370054e040 | ||
|
|
fae0b4e900 | ||
|
|
c38404b5d5 | ||
|
|
4d48f50815 | ||
|
|
582cc6609c | ||
|
|
40bd75c725 | ||
|
|
b2fc3076f6 | ||
|
|
288527914b | ||
|
|
a2aea3747c | ||
|
|
8382354ef7 | ||
|
|
264e6e6e9c | ||
|
|
eb72609ea3 | ||
|
|
776785ac90 | ||
|
|
d5f874e185 | ||
|
|
89d940d9b7 | ||
|
|
bd1cf62761 | ||
|
|
196facfacd | ||
|
|
afe75fd9f2 | ||
|
|
8a34013558 | ||
|
|
67f5ac3657 | ||
|
|
7236552b6c | ||
|
|
1f5899d238 | ||
|
|
ec4884ea04 | ||
|
|
2e0619b4dc | ||
|
|
c9146bc749 | ||
|
|
f5b5bd64bc | ||
|
|
d31d9eb71c | ||
|
|
f28b654057 | ||
|
|
8738b68a44 | ||
|
|
42381fa154 | ||
|
|
22427101f8 | ||
|
|
2a4ebf5774 | ||
|
|
5172e4df7c | ||
|
|
893dd2c85e | ||
|
|
d426f89cf0 | ||
|
|
7de3de5610 | ||
|
|
2856e66609 | ||
|
|
354011f994 | ||
|
|
8ed827cd2d | ||
|
|
05c0aeb789 | ||
|
|
aecffe3402 | ||
|
|
70e6b2bb82 | ||
|
|
54296f0437 | ||
|
|
8fcd9332f7 | ||
|
|
1857362d03 | ||
|
|
6d7186fc81 | ||
|
|
e4488da96e | ||
|
|
cc43d06d33 | ||
|
|
9ffd827028 | ||
|
|
15e6542f0d | ||
|
|
24bb3e096a | ||
|
|
5bcbbd4c52 | ||
|
|
ff13d977e9 | ||
|
|
1fdb8b7b01 | ||
|
|
f1ee88c4e1 | ||
|
|
b578afbc6a | ||
|
|
ad94e8e3c6 | ||
|
|
3f4b361fad | ||
|
|
46bd470640 | ||
|
|
fdbf2d8af2 | ||
|
|
5a723f00fa | ||
|
|
728a9705ea | ||
|
|
cd3a98c095 | ||
|
|
a22ad90174 | ||
|
|
5ebbed9115 | ||
|
|
7ae4299df2 | ||
|
|
3d23c01e26 | ||
|
|
089e04bcfd | ||
|
|
98762be1e5 | ||
|
|
d44e74bd1e | ||
|
|
8e0ce4d678 | ||
|
|
45cf158508 | ||
|
|
7340ae15f7 | ||
|
|
6db7ad76da | ||
|
|
4a407668bc | ||
|
|
ab1fa44f00 | ||
|
|
cd0004cf88 | ||
|
|
667aaf06a0 | ||
|
|
a8074d94e8 | ||
|
|
16e68fbfff | ||
|
|
81942b3b98 | ||
|
|
a7cda28fc7 | ||
|
|
0c52f1ee6a | ||
|
|
1994c20c54 | ||
|
|
a1dda913c3 | ||
|
|
d626de1875 | ||
|
|
6cfd94cc69 | ||
|
|
79b68222ff | ||
|
|
aaec46a39c | ||
|
|
9c663b1ba2 | ||
|
|
777ed899a3 | ||
|
|
ddcf1d669d | ||
|
|
32d02ba022 | ||
|
|
5449342016 | ||
|
|
43e42079a4 | ||
|
|
cafa7c5adc | ||
|
|
1258c5a5b0 | ||
|
|
83141f9be2 | ||
|
|
4c59035757 | ||
|
|
9459ae8265 | ||
|
|
8893a302e2 | ||
|
|
d67eaaaee2 | ||
|
|
fd8333eeda | ||
|
|
f5a1739472 | ||
|
|
a297cc3140 | ||
|
|
79c13c6f83 | ||
|
|
8b9455d784 | ||
|
|
501f8898f6 | ||
|
|
ee13927607 | ||
|
|
d2a9aaa9d4 | ||
|
|
f563b58a85 | ||
|
|
ce2d37b90c | ||
|
|
454cd4e24f | ||
|
|
6320d042c8 | ||
|
|
d7ed59581c | ||
|
|
9593b0b091 | ||
|
|
ca53630410 | ||
|
|
f484c38745 | ||
|
|
d12a2b0c38 | ||
|
|
c842b921bc | ||
|
|
6b2eec86c2 | ||
|
|
2eba4e2cd4 | ||
|
|
73baeaa0ad | ||
|
|
c58851bc97 | ||
|
|
96140f3875 | ||
|
|
369b8af109 | ||
|
|
914c0620c4 | ||
|
|
138b69e36e | ||
|
|
3181c076b2 | ||
|
|
673809e07d | ||
|
|
f74fa97b4a | ||
|
|
c797099950 | ||
|
|
0f8bfb6328 | ||
|
|
4cd01ece30 | ||
|
|
14b34edca3 | ||
|
|
411e807dcc | ||
|
|
ea87a1dc0c | ||
|
|
46f7cffc7b | ||
|
|
2a6f054876 | ||
|
|
30dca18b79 | ||
|
|
09c195c752 | ||
|
|
2ae6d94e2c | ||
|
|
9ee4b75bbd | ||
|
|
cc40803b06 | ||
|
|
a0a03b0389 | ||
|
|
0dfc367e56 | ||
|
|
c8d7f93dca | ||
|
|
6fac116d8c | ||
|
|
f48ff102c9 | ||
|
|
bd5a0679ee | ||
|
|
fcfb76a103 | ||
|
|
8e325f9986 | ||
|
|
b8eaf1d57e | ||
|
|
42608cdd8f | ||
|
|
2cfa4c3b76 | ||
|
|
aa136a2776 | ||
|
|
68413a5371 | ||
|
|
638f17a02c | ||
|
|
273d6a6986 | ||
|
|
953141813c | ||
|
|
be2db3f170 | ||
|
|
eefce6ade3 | ||
|
|
c6ebb5552e | ||
|
|
4d64d4bf25 | ||
|
|
2ee4d7d745 | ||
|
|
1b81999329 | ||
|
|
df5aeb6d88 | ||
|
|
df3303dcd3 | ||
|
|
c267074851 | ||
|
|
21874d0509 | ||
|
|
7898df2876 | ||
|
|
b2ec0d1217 | ||
|
|
5673e29e51 | ||
|
|
feefaabce9 | ||
|
|
29b540ade3 | ||
|
|
919f75af1a | ||
|
|
17e905085f | ||
|
|
34af969785 | ||
|
|
fd9c3ccbae | ||
|
|
a3feeceace | ||
|
|
02265a6e1a | ||
|
|
81524c38e9 | ||
|
|
671551bdc1 | ||
|
|
10c81ccba3 | ||
|
|
9361613f23 | ||
|
|
b14334220f | ||
|
|
f184d65267 | ||
|
|
b64e2ff6ff | ||
|
|
cbdae24314 | ||
|
|
762cb25227 | ||
|
|
fc01a796f8 | ||
|
|
feb700f325 | ||
|
|
5334fdf1b2 | ||
|
|
abc14217f6 | ||
|
|
af68cae6ea | ||
|
|
e0cacfc6d6 | ||
|
|
b575064d47 | ||
|
|
6290234ad1 | ||
|
|
aeed25648a | ||
|
|
43e7506ed5 | ||
|
|
a3a1bbe8de | ||
|
|
fe4ec0b156 | ||
|
|
7c5fdd1b06 | ||
|
|
4d54463aeb | ||
|
|
40bc8df63d | ||
|
|
61de7c8a32 | ||
|
|
d6656db20d | ||
|
|
15a091fe4c | ||
|
|
d8a0528135 | ||
|
|
16fb5faebd | ||
|
|
2c4b5d75b3 | ||
|
|
770607f93f | ||
|
|
db0eff4743 | ||
|
|
0793f96578 | ||
|
|
8095d94c97 | ||
|
|
bcfcd59642 | ||
|
|
5d677c3c57 | ||
|
|
28c0549705 | ||
|
|
bb42042db4 | ||
|
|
1c7fb77e05 | ||
|
|
e8ca2ea5a0 | ||
|
|
e43a445c34 | ||
|
|
1237643028 | ||
|
|
aee0e31b0a | ||
|
|
47af632c79 | ||
|
|
7b0ceee57b | ||
|
|
bdc867d153 | ||
|
|
6421fbc68a | ||
|
|
b00443c222 | ||
|
|
a10b3d3821 | ||
|
|
7735cfac31 | ||
|
|
749187e1e9 | ||
|
|
a9812592fe | ||
|
|
e4070f7753 | ||
|
|
ff53187eae | ||
|
|
89ef9b8531 | ||
|
|
56b55ad941 | ||
|
|
24672e0c5e | ||
|
|
52743017a3 | ||
|
|
6cf7192d6a | ||
|
|
6763dab4e5 | ||
|
|
e0290b94b4 | ||
|
|
242f64fa8e | ||
|
|
3edce174d6 | ||
|
|
5266a62685 | ||
|
|
43ef9eaced | ||
|
|
453707d18c | ||
|
|
2d9c5d16e1 | ||
|
|
b20e0097cf | ||
|
|
dd83782522 | ||
|
|
aa3632e2ac | ||
|
|
7f1f6f77a0 | ||
|
|
7eb5be0a4e | ||
|
|
603a6a4971 | ||
|
|
6bda64064e | ||
|
|
ec7992553f | ||
|
|
e5de8c08f5 | ||
|
|
c608877c3e | ||
|
|
52f399a154 | ||
|
|
88728906a8 | ||
|
|
0916ec35da | ||
|
|
9f4f2e8e27 | ||
|
|
82009d3147 | ||
|
|
0127e08a28 | ||
|
|
d275713aff | ||
|
|
c50f4f4cb4 | ||
|
|
fa34a7af4b | ||
|
|
77b75aa6c4 | ||
|
|
9faee68dab | ||
|
|
4f05c972d5 | ||
|
|
abda6ad041 | ||
|
|
7fc7b19d64 | ||
|
|
b2d898dc15 | ||
|
|
15425093af | ||
|
|
b02aa2d5e5 | ||
|
|
c68bfcc3b9 | ||
|
|
2964cf93ab | ||
|
|
787cf2a9fe | ||
|
|
ed190cd41e | ||
|
|
33dda9bf87 | ||
|
|
fa6693a7ae | ||
|
|
055a327b5e | ||
|
|
aff1b47072 | ||
|
|
5f86769255 | ||
|
|
9c18960f47 | ||
|
|
484efbbfe2 | ||
|
|
e83d483454 | ||
|
|
b944418257 | ||
|
|
4ddd3caec7 | ||
|
|
c1f55abaeb | ||
|
|
fff42ebc0d | ||
|
|
2437419b7f | ||
|
|
e53cedaf14 | ||
|
|
6d469fd997 | ||
|
|
9552cddc93 | ||
|
|
34181243e5 | ||
|
|
a0eb891132 | ||
|
|
e136355408 | ||
|
|
5069476dcc | ||
|
|
f950750d56 | ||
|
|
0026f9e54f | ||
|
|
f8f73d117b | ||
|
|
8586ebf098 | ||
|
|
472afce98f | ||
|
|
a12844f5db | ||
|
|
bc965f6afa | ||
|
|
db95b94c9a | ||
|
|
1a5bce49c2 | ||
|
|
436eb0e591 | ||
|
|
e016244aba | ||
|
|
d317b03832 | ||
|
|
3e138405b3 | ||
|
|
0dd0714ad0 | ||
|
|
45d7d0d5f6 | ||
|
|
c3db4ee236 | ||
|
|
91296257fc | ||
|
|
e5f660a006 | ||
|
|
c0628ef95b | ||
|
|
c0b5070e46 | ||
|
|
b1128fc786 | ||
|
|
bcd8a5a7a9 | ||
|
|
0cf280fa9a | ||
|
|
b11653658d | ||
|
|
adf96a47bb | ||
|
|
6529375a8b | ||
|
|
e7e83874cd | ||
|
|
7ef125e3af | ||
|
|
dfa14689e4 | ||
|
|
ec2995d64a | ||
|
|
94c71cb834 | ||
|
|
7f7ddf77b8 | ||
|
|
089cd3de87 | ||
|
|
2d34615eac | ||
|
|
4da3c1d5e5 | ||
|
|
4f222bca5c | ||
|
|
0bb0407f46 | ||
|
|
8bc117bce9 | ||
|
|
afd0e72e37 | ||
|
|
d758ba2702 | ||
|
|
0f126ec217 | ||
|
|
c1a6dc9bac | ||
|
|
6ee95a2c0c | ||
|
|
6814915c88 | ||
|
|
52fdf8bccd | ||
|
|
f67757f606 | ||
|
|
38f05fd6f2 | ||
|
|
65022beb0d | ||
|
|
5d81338aca | ||
|
|
c288d49138 | ||
|
|
0ea0645258 | ||
|
|
9227ca5b5b | ||
|
|
eb6b0ddead | ||
|
|
dca90fb5d2 | ||
|
|
172e27016b | ||
|
|
6da2ff7ffb | ||
|
|
6c433b452f | ||
|
|
65a34ee41a | ||
|
|
5ff0234c71 | ||
|
|
e76509a577 | ||
|
|
4499f45b67 | ||
|
|
504d1768f2 | ||
|
|
caea065594 | ||
|
|
2ee426386a | ||
|
|
9df05fe0fa | ||
|
|
184f79ef8e | ||
|
|
35f0861d6e | ||
|
|
c4d27e7a78 | ||
|
|
7e545533cf | ||
|
|
32cafbff9b | ||
|
|
9c4f72c96e | ||
|
|
5e4493b227 | ||
|
|
834b58fbbd | ||
|
|
342d1aeefb | ||
|
|
363c107359 | ||
|
|
0458269e15 | ||
|
|
64d4db81ca | ||
|
|
865cc997a4 | ||
|
|
981bfe0464 | ||
|
|
695fb1e0ca | ||
|
|
21ad6cc871 | ||
|
|
c24181b2be | ||
|
|
39a0e69b04 | ||
|
|
e60e47f76f | ||
|
|
e67820cabe | ||
|
|
3266c3a58a | ||
|
|
ef820a1138 | ||
|
|
137e64b0dd | ||
|
|
982b0285c9 | ||
|
|
405fc2b4d2 | ||
|
|
eacd3e1c17 | ||
|
|
a62f1e15a6 | ||
|
|
8b0083ffc5 | ||
|
|
5d69d89627 | ||
|
|
b966c16dd5 | ||
|
|
97190645cc | ||
|
|
c26417de70 | ||
|
|
f5c1e79195 | ||
|
|
d02105ca30 | ||
|
|
44e50797ca | ||
|
|
7058f0c8c2 | ||
|
|
f532ccdf94 | ||
|
|
a6fcdfce05 | ||
|
|
dca712d273 | ||
|
|
ac81d856f6 | ||
|
|
88fb79e458 | ||
|
|
480c53d7a2 | ||
|
|
2b7d7c95a5 | ||
|
|
0ee938c38b | ||
|
|
3c36cc2953 | ||
|
|
79bb3253b6 | ||
|
|
18107248aa | ||
|
|
4f1bb55e55 | ||
|
|
20d3abb99a | ||
|
|
1b34119e60 | ||
|
|
9d2b785be6 | ||
|
|
36b4ba33fa | ||
|
|
625ebbea1a | ||
|
|
0f4e5857f0 | ||
|
|
76d955a69a | ||
|
|
e41ea445c9 | ||
|
|
c952651dc1 | ||
|
|
58e771a1d7 | ||
|
|
e876ed3717 | ||
|
|
67d2e4ebcb | ||
|
|
4ea78fa1a2 | ||
|
|
93b8e2211c | ||
|
|
052216c471 | ||
|
|
e5978a70f5 | ||
|
|
59f0ee862d | ||
|
|
215981dfde | ||
|
|
bfdb33f26b | ||
|
|
5b3af827e1 | ||
|
|
9859d77cba | ||
|
|
064c930aed | ||
|
|
043357d7dc | ||
|
|
3a5deefe11 | ||
|
|
2c71371b29 | ||
|
|
222e6b28b7 | ||
|
|
496cde87b2 | ||
|
|
79bbe4b82a | ||
|
|
035d71e07c | ||
|
|
82effea070 | ||
|
|
331f4dcc1b | ||
|
|
055b246857 | ||
|
|
8fc9a318a4 | ||
|
|
9aed80a4fd | ||
|
|
c31f306b5b | ||
|
|
bfd2dbfee2 | ||
|
|
c42af95dd3 | ||
|
|
89a073adc0 | ||
|
|
1c2d82a62f | ||
|
|
02f7a36fa4 | ||
|
|
a76f762196 | ||
|
|
2c2955a229 | ||
|
|
d06d01cef2 | ||
|
|
4b91738f21 | ||
|
|
12fd8f34be | ||
|
|
c2ab05d422 | ||
|
|
7b25b8c1e1 | ||
|
|
af7c0a76d0 | ||
|
|
664c9c4a7c | ||
|
|
fd5d51ee54 | ||
|
|
1b105db958 | ||
|
|
a541e8d3e3 | ||
|
|
6f2ca6c87a | ||
|
|
952539f817 | ||
|
|
c87b679f41 | ||
|
|
e6b20c5246 | ||
|
|
0bfcff676c | ||
|
|
37601e5d03 | ||
|
|
21c70e7993 | ||
|
|
22d331d6c4 | ||
|
|
9bfb2d60b9 | ||
|
|
203b2d9181 | ||
|
|
ddc4566dcb | ||
|
|
1755c9dc79 | ||
|
|
a5df36eff2 | ||
|
|
e30d0c2dd0 | ||
|
|
213c2ea71b | ||
|
|
73f59eaf09 | ||
|
|
c999d71455 | ||
|
|
5359d5a66d | ||
|
|
c58820fa64 | ||
|
|
cfc5599334 | ||
|
|
c02f3c0a7d | ||
|
|
dd83358850 | ||
|
|
d95a6ce898 | ||
|
|
7e80e14f16 | ||
|
|
219304e38d | ||
|
|
20e5597104 | ||
|
|
ed2e299797 | ||
|
|
bacc529391 | ||
|
|
ed1ff11e80 | ||
|
|
a0f8e6987c | ||
|
|
d3e32f0d5a | ||
|
|
95bfcb8055 | ||
|
|
096c489eb3 | ||
|
|
b6425f9004 | ||
|
|
ab2c86640b | ||
|
|
1489feb054 | ||
|
|
acdeabb861 | ||
|
|
6bb6c043e5 | ||
|
|
fa2bba51c1 | ||
|
|
3822c26e32 | ||
|
|
425b43b3bb | ||
|
|
c00dac1bbf | ||
|
|
3ff4d19782 | ||
|
|
31997936d6 | ||
|
|
287f1beb90 | ||
|
|
7680be1a2f | ||
|
|
55e0fbf24e | ||
|
|
eaac17a236 | ||
|
|
1fbd568dfe | ||
|
|
c0619ef4a4 | ||
|
|
b2aa66b4fd | ||
|
|
dfaf2ee29c | ||
|
|
b938c8d7b6 | ||
|
|
553de3cc7e | ||
|
|
73980e9644 | ||
|
|
087e631dd8 | ||
|
|
76fb280720 | ||
|
|
6ffc09d86a | ||
|
|
125c9c92eb | ||
|
|
15eb95f964 | ||
|
|
ed96d65645 | ||
|
|
9c2f87ec2e | ||
|
|
19f6ed5530 | ||
|
|
57c5a92427 | ||
|
|
9410570195 | ||
|
|
c0422dea5b | ||
|
|
7791fb10d8 | ||
|
|
a6ee61e96d | ||
|
|
99d9bd2d75 | ||
|
|
e7aeca736b | ||
|
|
e85f325eb2 | ||
|
|
7dcc5cbaf1 | ||
|
|
1cdd70e008 | ||
|
|
6a11fc571d | ||
|
|
771fe394fd | ||
|
|
d474d1abd0 | ||
|
|
576111741b | ||
|
|
9ac44dfbd9 | ||
|
|
110b53b899 | ||
|
|
42e8d51550 | ||
|
|
fd7043ea40 | ||
|
|
34ae9b0687 | ||
|
|
077bf95425 | ||
|
|
e465b2f0e8 | ||
|
|
01ff3f73f8 | ||
|
|
8aae0d00cd | ||
|
|
16dad8b00d | ||
|
|
7dc4bc5714 | ||
|
|
2e82ba50f2 | ||
|
|
1542f3172a | ||
|
|
69d575fd5b | ||
|
|
607fecf437 | ||
|
|
91f7839b31 | ||
|
|
078bc164d5 | ||
|
|
70f464e6f2 | ||
|
|
e40621eb0f | ||
|
|
fd395e5661 | ||
|
|
be046cae8e | ||
|
|
922de07751 | ||
|
|
7549c807ac | ||
|
|
de5eccf9d6 | ||
|
|
952225d1da | ||
|
|
a928c4f845 | ||
|
|
73e189ea61 | ||
|
|
8168fb71a8 | ||
|
|
87ddeb2c79 | ||
|
|
255254eb69 | ||
|
|
c72f221fc0 | ||
|
|
4ca2b551f5 | ||
|
|
5b6b2f0528 | ||
|
|
fbbfb11916 | ||
|
|
c54febd024 | ||
|
|
5ebf920a61 | ||
|
|
5121e9f954 | ||
|
|
ca98367a0a | ||
|
|
9abf294eed | ||
|
|
9ce22e849c | ||
|
|
58b84f83d1 | ||
|
|
acbde4fb2d | ||
|
|
53090a7273 | ||
|
|
71ee299de7 | ||
|
|
9d1c9fc505 | ||
|
|
03a0972712 | ||
|
|
0bddbba00e | ||
|
|
6007f48b7d | ||
|
|
4f10198ec0 | ||
|
|
7722c41680 | ||
|
|
7cdc5c711c | ||
|
|
4180cc3a3d | ||
|
|
d6789550a0 | ||
|
|
d68da34eec | ||
|
|
63b55c4f65 | ||
|
|
96395b6d75 | ||
|
|
d3a6fa50d6 | ||
|
|
47f22a20ba | ||
|
|
14ec524805 | ||
|
|
fcba3ffa26 | ||
|
|
41eba71f0f | ||
|
|
85ed0202d8 | ||
|
|
745902e8b1 | ||
|
|
ad3487a9ac | ||
|
|
8c2f89edc5 | ||
|
|
6cff920f0c | ||
|
|
27f3f6fbf0 | ||
|
|
89c24415a6 | ||
|
|
0d803bf45f | ||
|
|
d4e54f343d | ||
|
|
08a81e79dd | ||
|
|
cad789e948 | ||
|
|
4de18cfab1 | ||
|
|
5cec1a71da | ||
|
|
ae1e22931f | ||
|
|
a60d4dee41 | ||
|
|
7da10cd367 | ||
|
|
6d45616dbe | ||
|
|
ad326147f1 | ||
|
|
465b173b36 | ||
|
|
9bf1979fa8 | ||
|
|
0a811e19ba | ||
|
|
e119acb0e9 | ||
|
|
0f1e87bd93 | ||
|
|
f9f2f549af | ||
|
|
d665adf78b | ||
|
|
1c27824e58 | ||
|
|
14adcb56da | ||
|
|
b452d63fa6 | ||
|
|
e2b82929ab | ||
|
|
8fbd33be09 | ||
|
|
bff41a8957 | ||
|
|
2375001453 | ||
|
|
462f10ab60 | ||
|
|
58026c52ea | ||
|
|
97b434722c | ||
|
|
b22d236b19 | ||
|
|
cc809a5c06 | ||
|
|
cd0ea6558d | ||
|
|
9eb077c4af | ||
|
|
6eeee6b704 | ||
|
|
b13042d644 | ||
|
|
d09e3c3658 | ||
|
|
72ca4e74ee | ||
|
|
d5c1706e9c | ||
|
|
3a1f82effa | ||
|
|
a3d7cc9392 | ||
|
|
178a5c0130 | ||
|
|
b233eaea97 | ||
|
|
51137e01ef | ||
|
|
fb1490c183 | ||
|
|
4424c8a231 | ||
|
|
723e6bcdae | ||
|
|
d1156aa755 | ||
|
|
4e49d3cb22 | ||
|
|
13c7871d20 | ||
|
|
137c8f8a07 | ||
|
|
0c0c72c3ca | ||
|
|
e6a90a8be8 | ||
|
|
e65282dcc5 | ||
|
|
28a1888163 | ||
|
|
8824ee9b9d | ||
|
|
936fe5ac9d | ||
|
|
f5802a7d82 | ||
|
|
33d9c13b7e | ||
|
|
42bd9b194b | ||
|
|
41e26f56e9 | ||
|
|
14aa3224ce | ||
|
|
8a796d12b4 | ||
|
|
c87df8791b | ||
|
|
f0f42aea9f | ||
|
|
626ff5e3a7 | ||
|
|
36209eaef1 | ||
|
|
d63715d4d9 | ||
|
|
9600fbb609 | ||
|
|
04595a5fb1 | ||
|
|
9a0ada6756 | ||
|
|
416e07cb1f | ||
|
|
58429f88a0 | ||
|
|
439d88f06b | ||
|
|
d165ad187c | ||
|
|
319f679e30 | ||
|
|
b6d1ded668 | ||
|
|
3ad0832516 | ||
|
|
93f062d0b9 | ||
|
|
866937787c | ||
|
|
ca336af4fa | ||
|
|
7ec5d07cb8 | ||
|
|
2e79fe12e2 | ||
|
|
3df550927d | ||
|
|
44be7201c0 | ||
|
|
0d50f5bd08 | ||
|
|
8b1f7c52aa | ||
|
|
9987337eca | ||
|
|
87a1d4633e | ||
|
|
c2aeec20b7 | ||
|
|
a5b3fb2a6a | ||
|
|
c67a69629e | ||
|
|
18fb02a1ec | ||
|
|
ad1822d308 | ||
|
|
4af0d03e93 | ||
|
|
8c312e647d | ||
|
|
d3bd3ddab0 | ||
|
|
6c01e84099 | ||
|
|
b9b795bf0e | ||
|
|
19e7731abb | ||
|
|
609b24f2ba | ||
|
|
735cfda768 | ||
|
|
3f82729e9f | ||
|
|
077cfeb831 | ||
|
|
95588542f9 | ||
|
|
dd529f845a | ||
|
|
9f8a0a8dd3 | ||
|
|
e266d88edd | ||
|
|
0bb5f7f972 | ||
|
|
012a5f4907 | ||
|
|
409d686f7d | ||
|
|
c835231d32 | ||
|
|
723c444910 | ||
|
|
35f2d399e2 | ||
|
|
4491c75135 | ||
|
|
513002ff60 | ||
|
|
9693940010 | ||
|
|
8747c58c7d | ||
|
|
0fd791c02d | ||
|
|
3a804ce012 | ||
|
|
f864ec3730 | ||
|
|
9503f73115 | ||
|
|
f9d1080a7d | ||
|
|
4d3e4358e8 | ||
|
|
843850675f | ||
|
|
726300394b | ||
|
|
5d5d8de9fe | ||
|
|
e097e8331e | ||
|
|
7189ba40d3 | ||
|
|
218159bf83 | ||
|
|
238f896907 | ||
|
|
270a529948 | ||
|
|
cc400da44e | ||
|
|
3df9da91b4 | ||
|
|
57dd1fc49f | ||
|
|
7c5296cf35 | ||
|
|
cbe27923b3 | ||
|
|
aa26cc30d7 | ||
|
|
1ce82ba0d6 | ||
|
|
d1b0b0da10 | ||
|
|
11abc45440 | ||
|
|
b5a6f1f997 | ||
|
|
d114b630d2 | ||
|
|
5f819fc86f | ||
|
|
cc3a47fc65 | ||
|
|
5d3ea57d82 | ||
|
|
c1cbfd5766 | ||
|
|
9ef0f8a901 | ||
|
|
470fe1df49 | ||
|
|
2107ac08d7 | ||
|
|
89ba2a6540 | ||
|
|
9cedb3cc6c | ||
|
|
d0cfb62f35 | ||
|
|
9abf0eca1b | ||
|
|
a6a1898c41 | ||
|
|
f5793c142c | ||
|
|
8f37c77dff | ||
|
|
28aecd86d3 | ||
|
|
95675cdf07 | ||
|
|
8328b5dd4a | ||
|
|
d8d6de9fca | ||
|
|
56c321aeaa | ||
|
|
756e6a150c | ||
|
|
828984c8ec | ||
|
|
9da0ca5cb3 | ||
|
|
dc5f82ac9c | ||
|
|
d000083b41 | ||
|
|
a9eb605b0f | ||
|
|
5604129105 | ||
|
|
04b7a26c03 | ||
|
|
28203bbaf9 | ||
|
|
9138ab8095 | ||
|
|
4231ec5a1a | ||
|
|
55975a46d8 | ||
|
|
1182545448 | ||
|
|
9f3c3ae094 | ||
|
|
4c33d8d762 | ||
|
|
c8961ad489 | ||
|
|
f91f09adea | ||
|
|
336b32004d | ||
|
|
7b5c13b712 | ||
|
|
8bcc2bd715 | ||
|
|
83b771d5cd | ||
|
|
8dbc63ed56 | ||
|
|
8c61531671 | ||
|
|
b5d4b8eae8 | ||
|
|
e36e5823cd | ||
|
|
4ac63ba1f0 | ||
|
|
589b104671 | ||
|
|
220cba84ae | ||
|
|
032509ddba | ||
|
|
054ef3dc8d | ||
|
|
2effacd0a6 | ||
|
|
01f4780655 | ||
|
|
49dd90578b | ||
|
|
1780225da5 | ||
|
|
5e20094386 | ||
|
|
40a30d46af | ||
|
|
6b17a27a13 | ||
|
|
2a7104e564 | ||
|
|
8ca2dac184 | ||
|
|
d9b3501fae | ||
|
|
39351970d0 | ||
|
|
06dbd87311 | ||
|
|
c5a1f4c839 | ||
|
|
f074bb1be2 | ||
|
|
90e7d02e35 | ||
|
|
437e05bd2f | ||
|
|
934f57c92f | ||
|
|
3093f80d68 | ||
|
|
11aa01ee2e | ||
|
|
d8b6e92813 | ||
|
|
6adbb7419c | ||
|
|
d4b88c6c86 | ||
|
|
698380f940 | ||
|
|
dcac442ebf | ||
|
|
da70917b08 | ||
|
|
0292f472e0 | ||
|
|
7e391bd53d | ||
|
|
2157651d17 | ||
|
|
0e05c62a3b | ||
|
|
a7573d5705 | ||
|
|
1fa9f162a5 | ||
|
|
5ea561af3d | ||
|
|
2033b0c8fa | ||
|
|
1c07ae2650 | ||
|
|
5b6c98582e | ||
|
|
0af14fc81a | ||
|
|
833fd23820 | ||
|
|
d46126c5c3 | ||
|
|
811c3e8844 | ||
|
|
223404a240 | ||
|
|
31373be172 | ||
|
|
66e65e4dc1 | ||
|
|
b84ecc4574 | ||
|
|
9a8d43bf88 | ||
|
|
ca770c87d6 | ||
|
|
c83fd1de38 | ||
|
|
db8b8f0d58 | ||
|
|
30fae208c2 | ||
|
|
5fe644a3b6 | ||
|
|
a108f5e212 | ||
|
|
c9aa2eeb98 | ||
|
|
63d6b6f9f9 | ||
|
|
847b4605f4 | ||
|
|
6b3748e2a3 | ||
|
|
6a78887f1d | ||
|
|
7226a9ad47 | ||
|
|
b44f2b5ffb | ||
|
|
07e82c3f4a | ||
|
|
b34aded376 | ||
|
|
4ed9a3a0ea | ||
|
|
f1d85eeaec | ||
|
|
1b0efc5548 | ||
|
|
6dca551164 | ||
|
|
7694597728 | ||
|
|
4d59689126 | ||
|
|
8f7001cd9f | ||
|
|
781b1f7b3a | ||
|
|
e6c9f2a00e | ||
|
|
5d06c8093c | ||
|
|
c396cc9649 | ||
|
|
ac5d8b47ca | ||
|
|
77e8e9ebbd | ||
|
|
c14c6b3786 | ||
|
|
c27c6cea13 | ||
|
|
11a385cda6 | ||
|
|
32e2f1d339 | ||
|
|
69225b507b | ||
|
|
2f905eed0d | ||
|
|
55cf19aa2e | ||
|
|
dd8c10743d | ||
|
|
25ce36e495 | ||
|
|
d205a7683a | ||
|
|
7e4d71cf58 | ||
|
|
97df1a82c7 | ||
|
|
845297ec03 | ||
|
|
ddf4cae537 | ||
|
|
ce64894abe | ||
|
|
beb4d8ccb9 | ||
|
|
e0e59c5831 | ||
|
|
826541a714 | ||
|
|
c40aeb91e6 | ||
|
|
2e34ce90a1 | ||
|
|
93d608f050 | ||
|
|
ec26a9702d | ||
|
|
dbe8aa1d3a | ||
|
|
8628d1e4b2 | ||
|
|
4ea5426e18 | ||
|
|
1282fe732e | ||
|
|
a07d11e820 | ||
|
|
dbc85fe7e4 | ||
|
|
523ef2bba5 | ||
|
|
de8014dfe8 | ||
|
|
b42e5c3213 | ||
|
|
ea728d232d | ||
|
|
43819b021e | ||
|
|
e69f7c735b | ||
|
|
5e792236af | ||
|
|
45c119627b | ||
|
|
65890bc257 | ||
|
|
42c653e1a4 | ||
|
|
8c34be92a6 | ||
|
|
fa53a2550a | ||
|
|
616b8b0ee6 | ||
|
|
d24632682f | ||
|
|
3b1bab651a | ||
|
|
0cea5ebaeb | ||
|
|
1e4a867a9a | ||
|
|
6bb0b4cd47 | ||
|
|
56c6f603aa | ||
|
|
98b3a371f4 | ||
|
|
ba8e1e5dc2 | ||
|
|
467f9080a1 | ||
|
|
0894bf13d2 | ||
|
|
1d7627dd72 | ||
|
|
d80aa67c97 | ||
|
|
ae1d9adf65 | ||
|
|
b40571095d | ||
|
|
04124a2ace | ||
|
|
2730b90512 | ||
|
|
34913cfc83 | ||
|
|
88799d469c | ||
|
|
a07d5d38d6 | ||
|
|
ca5859296a | ||
|
|
1a8310f027 | ||
|
|
041be46732 | ||
|
|
9eafb6bfb5 | ||
|
|
668a9e88c6 | ||
|
|
cd2bdab683 | ||
|
|
d72b4e9a98 | ||
|
|
2cc5691efd | ||
|
|
7726ed4245 | ||
|
|
921d4b996d | ||
|
|
96021e518a | ||
|
|
5c5199920e | ||
|
|
e1c809d6f1 | ||
|
|
218009a5ec | ||
|
|
5340008ad7 | ||
|
|
700fe6b0e4 | ||
|
|
9b8d69b2dd | ||
|
|
84546ff11c | ||
|
|
885a0ddad0 | ||
|
|
3b76c6792c | ||
|
|
4605349bdc | ||
|
|
ff447ad22b | ||
|
|
c081030d61 | ||
|
|
e3496ac1a2 | ||
|
|
8911ea1619 | ||
|
|
34700a4c52 | ||
|
|
b6564bcd77 | ||
|
|
6e6aae6649 | ||
|
|
b98f85d8a7 | ||
|
|
3314fe8b0e | ||
|
|
f12163bc94 | ||
|
|
f7a1680f72 | ||
|
|
4603f414db | ||
|
|
884dca20b3 | ||
|
|
dbb544dc92 | ||
|
|
3fad718807 | ||
|
|
fab8a71fd2 | ||
|
|
7776a6b7c6 | ||
|
|
cd6ab61c2d | ||
|
|
00f69d683a | ||
|
|
0e70de4003 | ||
|
|
35efa927b6 | ||
|
|
1ff03e87c2 | ||
|
|
edf934efbb | ||
|
|
d0815f586e | ||
|
|
685a23bce8 | ||
|
|
0aa7085303 | ||
|
|
994d5dd891 | ||
|
|
e62a94c05a | ||
|
|
2b83572641 | ||
|
|
5f8aae69e4 | ||
|
|
73b8d1dd99 | ||
|
|
58fa00079b | ||
|
|
3060dafb45 | ||
|
|
5cb436174d | ||
|
|
541fd9c044 | ||
|
|
7d6934d00c | ||
|
|
2c328a4540 | ||
|
|
648634d376 | ||
|
|
a654a1cb88 | ||
|
|
ef02519e72 | ||
|
|
557278fac0 | ||
|
|
5652bb76d4 | ||
|
|
d0c40490a7 | ||
|
|
630d84348e | ||
|
|
81d4f01b7f | ||
|
|
b5c665cb7e | ||
|
|
836387cada | ||
|
|
0020498c10 | ||
|
|
66ed43cbcb | ||
|
|
c6e1d139f8 | ||
|
|
ef7381f032 | ||
|
|
df30304d00 | ||
|
|
91a24ef9ce | ||
|
|
d11083d3b9 | ||
|
|
680b8ede6c | ||
|
|
4e023e2500 | ||
|
|
3eac19d258 | ||
|
|
ab867b68d3 | ||
|
|
8cdc662745 | ||
|
|
204c03e772 | ||
|
|
d0ddac296f | ||
|
|
609366da6e | ||
|
|
f48d91539e | ||
|
|
cc23f69f66 | ||
|
|
6ceafc1827 | ||
|
|
8c2224ae39 | ||
|
|
6ff7cfddda | ||
|
|
5361f76b11 | ||
|
|
bdc00d67b2 | ||
|
|
5caa8cdec5 | ||
|
|
9ede3da882 | ||
|
|
836e496ee0 | ||
|
|
5aa4ba32c9 | ||
|
|
4419b4d4ae | ||
|
|
1cab30f32f | ||
|
|
c9a5df81ce | ||
|
|
4f2adfef7b | ||
|
|
8a33290722 | ||
|
|
11cd9b21de | ||
|
|
41c50e758a | ||
|
|
d71bfce1a0 | ||
|
|
1ea65c0b60 | ||
|
|
c7a57191bd | ||
|
|
e3fc23ccf9 | ||
|
|
0baf6b0e19 | ||
|
|
0cddb358c1 | ||
|
|
741eeb7835 | ||
|
|
424f10e180 | ||
|
|
fab3dac70a | ||
|
|
89ab57d738 | ||
|
|
b03778fa73 | ||
|
|
d21abfc60c | ||
|
|
8eed9c267c | ||
|
|
3c2578f666 | ||
|
|
526fbbba45 | ||
|
|
993ea024fd | ||
|
|
bc595b40e7 | ||
|
|
e7ee181a91 | ||
|
|
6b703c4678 | ||
|
|
dbb095fff4 | ||
|
|
adf01ed511 | ||
|
|
17ca97ebd1 | ||
|
|
7d89fcc892 | ||
|
|
e84d562146 | ||
|
|
2e14561bfc | ||
|
|
166e57f1ef | ||
|
|
eeff159a2d | ||
|
|
547f25178b | ||
|
|
9c0a3ff83c | ||
|
|
2ba54c9168 | ||
|
|
026fb3e50e | ||
|
|
af3d3c2c9b | ||
|
|
27a1792e78 | ||
|
|
63e0716457 | ||
|
|
f3090b115d | ||
|
|
a21ff5c2e3 | ||
|
|
ff8851fd9f | ||
|
|
573f07ec82 | ||
|
|
8b20cb9fd2 | ||
|
|
7529296dd5 | ||
|
|
7f44a73fd0 | ||
|
|
eb835948b7 | ||
|
|
70e32637b0 | ||
|
|
c04a31dcda | ||
|
|
e526cef754 | ||
|
|
2ba0dbf50b | ||
|
|
4ee8cf08c6 | ||
|
|
f1f9140afc | ||
|
|
c189654cd9 | ||
|
|
0a66c5c269 | ||
|
|
e129b122a4 | ||
|
|
7f30e2e6ff | ||
|
|
29f784cc20 | ||
|
|
28242d3268 | ||
|
|
8d88477538 | ||
|
|
89053e86b3 | ||
|
|
50f36e3ed5 | ||
|
|
ca6839f593 | ||
|
|
e5cbb8cd56 | ||
|
|
7c92805aac | ||
|
|
a9218ed5f0 | ||
|
|
f3f0efba1e | ||
|
|
ccdcd3d154 | ||
|
|
8c774316ae | ||
|
|
25da3c073b | ||
|
|
6866b6c30d | ||
|
|
f86816fea2 | ||
|
|
df6b4b0607 | ||
|
|
2428e6e190 | ||
|
|
2ff0e71272 | ||
|
|
93609ca731 | ||
|
|
70a187cc18 | ||
|
|
390e29f850 | ||
|
|
3a466ad2a1 | ||
|
|
ccf6af4dc3 | ||
|
|
ce7564a91b | ||
|
|
483c1d5782 | ||
|
|
65850dfd03 | ||
|
|
d1bafd66c8 | ||
|
|
daa1e9edfb | ||
|
|
008d6a0c81 | ||
|
|
7c5fae68fe | ||
|
|
c57cea1aaa | ||
|
|
595dbdb0ec | ||
|
|
003161ea54 | ||
|
|
fd99c5461c | ||
|
|
37366dc2e1 | ||
|
|
c1903df374 | ||
|
|
54374bca05 | ||
|
|
ddf1eb0219 | ||
|
|
8c5ba63f8c | ||
|
|
f7cd039819 | ||
|
|
4335897367 | ||
|
|
6201dcf1aa | ||
|
|
5d24fe189d | ||
|
|
6d9ead80b2 | ||
|
|
bf46a9af68 | ||
|
|
c6d43581f9 | ||
|
|
31399fe475 | ||
|
|
e150599274 | ||
|
|
b70117e9f4 | ||
|
|
df04e852bf | ||
|
|
dd625d8edc | ||
|
|
6ab58f294e | ||
|
|
9d4bb5b3af | ||
|
|
e062c9b4a7 | ||
|
|
1b0629bf0f | ||
|
|
e83ea7fd76 | ||
|
|
6dab43523d | ||
|
|
4a59965d7a | ||
|
|
71de6613d3 | ||
|
|
e43e04b478 | ||
|
|
4ab32d4c2c | ||
|
|
1f05b52c4e | ||
|
|
3e7fbac926 | ||
|
|
eda27a60be | ||
|
|
107a2dbe90 | ||
|
|
9577f6dbe8 | ||
|
|
ae61ade2b1 | ||
|
|
977e7f55e5 | ||
|
|
c399ff86e0 | ||
|
|
d43b806c5e | ||
|
|
7b7061846c | ||
|
|
d81cf5cc1b | ||
|
|
4284fd0469 | ||
|
|
039b6b247a | ||
|
|
a09b2c4eea | ||
|
|
50a99e9120 | ||
|
|
57479b250a | ||
|
|
e64245099c | ||
|
|
d6e4b5e889 | ||
|
|
6e2e7ac782 | ||
|
|
904a6bd97f | ||
|
|
c24b7097fa | ||
|
|
cc23d5cafe | ||
|
|
9c5b44d070 | ||
|
|
84fb8b2288 | ||
|
|
6d2d322140 | ||
|
|
1517688076 | ||
|
|
29124f56bb | ||
|
|
42d849abfc | ||
|
|
d1b307b18f | ||
|
|
f6d347c5e4 | ||
|
|
4fe8476169 | ||
|
|
bbc5ac9f0e | ||
|
|
29b5c393d1 | ||
|
|
b8cc0b1270 | ||
|
|
b145d8b8a2 | ||
|
|
ffe1073292 | ||
|
|
afaaec8492 | ||
|
|
d0b8b076cf | ||
|
|
708049bb89 | ||
|
|
65aa51d525 | ||
|
|
cbbd284e7a | ||
|
|
852903bdbd | ||
|
|
19efacef9c | ||
|
|
0f57629d25 | ||
|
|
69726c3925 | ||
|
|
37f9c7c8d6 | ||
|
|
bcee0bbf3a | ||
|
|
096a71c58b | ||
|
|
a538b9789b | ||
|
|
c6e525b06f | ||
|
|
d29c40dc71 | ||
|
|
4f5f541efe | ||
|
|
caf054bae7 | ||
|
|
7e8011ba34 | ||
|
|
e46f77681d | ||
|
|
0de0a5aa87 | ||
|
|
3394380ffa | ||
|
|
2493bb0fb7 | ||
|
|
4641e89c17 | ||
|
|
28405f6d24 | ||
|
|
5455cb3164 | ||
|
|
1e4a81dea9 | ||
|
|
cbc3373e8e | ||
|
|
870559046f | ||
|
|
a997e1d10d | ||
|
|
c28d35d8f7 | ||
|
|
b92da8f123 | ||
|
|
bdf0c44246 | ||
|
|
799fb058b4 | ||
|
|
11924ad4c5 | ||
|
|
b11d2130a0 | ||
|
|
e0f4cb06b3 | ||
|
|
aad97c4c54 | ||
|
|
3590d3f8b6 | ||
|
|
6e5be6ba75 | ||
|
|
b366ce7594 | ||
|
|
1eacf5367d | ||
|
|
f74d1b7bf8 | ||
|
|
a004dcf320 | ||
|
|
5df59a48b7 | ||
|
|
989208eb45 | ||
|
|
bec1558488 | ||
|
|
6ff79c5d5c | ||
|
|
168c4f6950 | ||
|
|
3e40b9df66 | ||
|
|
94f97208e3 | ||
|
|
bd9003c24b | ||
|
|
26700a1ff0 | ||
|
|
8b92021b1a | ||
|
|
7cd474dbb7 | ||
|
|
9bf869767d | ||
|
|
9e818cddce | ||
|
|
d6fe180ca1 | ||
|
|
99cac7cac0 | ||
|
|
81f2166912 | ||
|
|
4de65ab55d | ||
|
|
771ef44d82 | ||
|
|
76c42c6c9f | ||
|
|
003887d4e0 | ||
|
|
89743bd1e6 | ||
|
|
1ace332152 | ||
|
|
2d14047c73 | ||
|
|
42cd93cf33 | ||
|
|
4a7b764ab3 | ||
|
|
1bdb0d465c | ||
|
|
930b54fabd | ||
|
|
5b0a54bfb7 | ||
|
|
6c3ff6de63 | ||
|
|
dd5a23e36e | ||
|
|
848ecd99ee | ||
|
|
82f61f2a0e | ||
|
|
c5368fe8d3 | ||
|
|
0aaf153717 | ||
|
|
942e1f887b | ||
|
|
b8ab43aa25 | ||
|
|
a5f3b051f2 | ||
|
|
4ba9767b94 | ||
|
|
12fda38520 | ||
|
|
9ed503fd6d | ||
|
|
a8976de634 | ||
|
|
f8855ddb56 | ||
|
|
288ecc617d | ||
|
|
14ec81b65c | ||
|
|
fae0b64a08 | ||
|
|
677750ef51 | ||
|
|
4cfd000b92 | ||
|
|
aacaf3f37c | ||
|
|
ad4a79a510 | ||
|
|
219d2754a0 | ||
|
|
10430a66c3 | ||
|
|
c167c21e4e | ||
|
|
40d25f7dca | ||
|
|
1441a1df1f | ||
|
|
b19c3c6db3 | ||
|
|
8c146aed68 | ||
|
|
805122f45c | ||
|
|
7d5de1a07e | ||
|
|
4b860777cf | ||
|
|
e29924c8a1 | ||
|
|
1847756ade | ||
|
|
771c56f485 | ||
|
|
0f057e81e9 | ||
|
|
529c9b34a7 | ||
|
|
e2e8130f4c | ||
|
|
46c13a4b7f | ||
|
|
96798e10b4 | ||
|
|
0f8ce3dd16 | ||
|
|
491859bbf6 | ||
|
|
f16123a624 | ||
|
|
d50ad9433f | ||
|
|
92a8a4ac0c | ||
|
|
62f53888ba | ||
|
|
79180928d4 | ||
|
|
e5550828a0 | ||
|
|
2e95f6824f | ||
|
|
5195012217 | ||
|
|
a797280e3f | ||
|
|
293f88e40c | ||
|
|
861eeb7b0f | ||
|
|
24b21aa9d7 | ||
|
|
51eac649c5 | ||
|
|
7670c95360 | ||
|
|
65e9fdead1 | ||
|
|
2b2792de73 | ||
|
|
c9bb2b785d | ||
|
|
64e5c343c5 | ||
|
|
9169b3f2cd | ||
|
|
b6f7a85a2a | ||
|
|
3556ae4e65 | ||
|
|
f888c62840 | ||
|
|
c160bed403 | ||
|
|
afc9709484 | ||
|
|
05b41804e3 | ||
|
|
2e2657b39d | ||
|
|
60ee602639 | ||
|
|
cac04e4406 | ||
|
|
278b4d21b4 | ||
|
|
27fd1e2880 | ||
|
|
fae9b3db46 | ||
|
|
49c7f49820 | ||
|
|
ef8981794e | ||
|
|
e52d77b2c4 | ||
|
|
1d2953b1b1 | ||
|
|
d702eaa625 | ||
|
|
50811c3064 | ||
|
|
99d9cc9168 | ||
|
|
119603da5d | ||
|
|
f6039f2eb9 | ||
|
|
65cc19c12e | ||
|
|
c07b4a57ca | ||
|
|
dca35bde87 | ||
|
|
9f25badde3 | ||
|
|
7efa749c66 | ||
|
|
72daa4e1d6 | ||
|
|
54702db9ba | ||
|
|
41ad084489 | ||
|
|
2fb171e069 | ||
|
|
201c0b020d | ||
|
|
b6f19ca093 | ||
|
|
68a77b6e1f | ||
|
|
e4a8a4d708 | ||
|
|
ab07c91d42 | ||
|
|
1838e616fd | ||
|
|
90d0ccc2e8 | ||
|
|
358a5c0ed9 | ||
|
|
40f39fd66c | ||
|
|
3b41976866 | ||
|
|
a23de50bb8 | ||
|
|
6596e6893e | ||
|
|
b6fe4d914e | ||
|
|
3c2cd43d28 | ||
|
|
2658b1fd09 | ||
|
|
b7df1f5bbf | ||
|
|
a0face6695 | ||
|
|
c177db69d5 | ||
|
|
b704c20809 | ||
|
|
6c17f94ef6 | ||
|
|
726285e634 | ||
|
|
bd6ab71d41 | ||
|
|
b67ed1ee13 | ||
|
|
55695f2189 | ||
|
|
e79d67d127 | ||
|
|
1d9ef9813a | ||
|
|
ef621a444f | ||
|
|
bd00fa798d | ||
|
|
a41745c9ae | ||
|
|
1eec474007 | ||
|
|
83e5278b51 | ||
|
|
a8751af6b5 | ||
|
|
6b24f52cd1 | ||
|
|
7ec22482c1 | ||
|
|
ee89dc00c0 | ||
|
|
bbd5fe4eb2 | ||
|
|
575a0610a3 | ||
|
|
b68cc08592 | ||
|
|
d51af7e98a | ||
|
|
334da5e903 | ||
|
|
35fed76d1a | ||
|
|
c77d49259a | ||
|
|
5520605ccc | ||
|
|
1dee8ae49f | ||
|
|
3fd4ee83ac | ||
|
|
5e978e2cfc | ||
|
|
37b7b983d2 | ||
|
|
c4278ef55a | ||
|
|
91220ea4a6 | ||
|
|
4bebbf3e1d | ||
|
|
5d8b8c37a5 | ||
|
|
564f20d13a | ||
|
|
c3adb1b152 | ||
|
|
688dc2304c | ||
|
|
dd6e2337e6 | ||
|
|
66418d4210 | ||
|
|
ab8c7b9d8a | ||
|
|
387799b31c | ||
|
|
4a64a4dea8 | ||
|
|
964c58ac01 | ||
|
|
56716cdad4 | ||
|
|
a2ee750d1e | ||
|
|
3f0601f651 | ||
|
|
6f8e3432e9 | ||
|
|
b7ab6f8e7e | ||
|
|
36b92ad884 | ||
|
|
4d9857ce18 | ||
|
|
43b22ce55f | ||
|
|
147185309c | ||
|
|
f48226d4f2 | ||
|
|
e92407d9ec | ||
|
|
79bf365d78 | ||
|
|
492a1370ab | ||
|
|
e3ddf93c4d | ||
|
|
4a9314c476 | ||
|
|
4767ee3293 | ||
|
|
1ea74dfd0d | ||
|
|
53cf6ebb79 | ||
|
|
d1007950e0 | ||
|
|
331226ec68 | ||
|
|
a7374cf998 | ||
|
|
e3d76193b9 | ||
|
|
07f0c3f052 | ||
|
|
a467a7c173 | ||
|
|
14f9f29348 | ||
|
|
5451fd2d2c | ||
|
|
f092771ea1 | ||
|
|
7c6d7226f5 | ||
|
|
eaebc6dcef | ||
|
|
c5200ca31b | ||
|
|
1078132b12 | ||
|
|
6b058cd299 | ||
|
|
b8f24af5ae | ||
|
|
6384f5af74 | ||
|
|
52038d26d2 | ||
|
|
55f37664ef | ||
|
|
ab8e3473a1 | ||
|
|
eba23c4f6e | ||
|
|
00fe6d3862 | ||
|
|
3646b8f5dd | ||
|
|
d40639bf8e | ||
|
|
12b81781b9 | ||
|
|
b67a37453d | ||
|
|
b04e001db1 | ||
|
|
fbe7b604ef | ||
|
|
0402cb7b27 | ||
|
|
b72bfc9c24 | ||
|
|
40e92f9463 | ||
|
|
f883dd9c1d | ||
|
|
d8bf55efb2 | ||
|
|
f982e83d0a | ||
|
|
3472a6db26 | ||
|
|
c79e51a91b | ||
|
|
ce795a2a7d | ||
|
|
045819c312 | ||
|
|
2fa01886da | ||
|
|
dd7d322c47 | ||
|
|
dfe71f33c2 | ||
|
|
db1d223448 | ||
|
|
54271c1598 | ||
|
|
1ee8ebc9e1 | ||
|
|
6e5537d131 | ||
|
|
90c85103c3 | ||
|
|
2d5d734da4 | ||
|
|
e1e5121dd7 | ||
|
|
85db6721de | ||
|
|
b511a7b634 | ||
|
|
88c3b1ad0f | ||
|
|
9fe15a03b3 | ||
|
|
500afffbcf | ||
|
|
5f3cade810 | ||
|
|
072851e3ba | ||
|
|
e2cbea2022 | ||
|
|
29880be283 | ||
|
|
f4e2b7319a | ||
|
|
ff0db82dc3 | ||
|
|
2daf085ce4 | ||
|
|
495f1f2041 | ||
|
|
89179f78c2 | ||
|
|
7ad7461a92 | ||
|
|
8cfcd201b0 | ||
|
|
abcd3cfafb | ||
|
|
50d41c456b | ||
|
|
1d41d53723 | ||
|
|
0dc003854f | ||
|
|
a4b7a77016 | ||
|
|
939e836d1b | ||
|
|
a0b35f7aa9 | ||
|
|
574e160a11 | ||
|
|
2042737004 | ||
|
|
a0667abec8 | ||
|
|
362306a9cb | ||
|
|
5e069f79a2 | ||
|
|
7c78fb064f | ||
|
|
11a7e897dc | ||
|
|
d8adc0afe9 | ||
|
|
17c1b97d23 | ||
|
|
5aee2f46ab | ||
|
|
013ded1e04 | ||
|
|
0d0f893b93 | ||
|
|
d2a87a4ddb | ||
|
|
b05a176490 | ||
|
|
d149926a39 | ||
|
|
2d49e96a8a | ||
|
|
9036bd478b | ||
|
|
477130aa85 | ||
|
|
878e0eabc8 | ||
|
|
62f63d4af7 | ||
|
|
1acf2f8b13 | ||
|
|
a4a5e539ed | ||
|
|
a2831b37c4 | ||
|
|
706b1b428f | ||
|
|
1690566413 | ||
|
|
a24b885236 | ||
|
|
c89a6665b6 | ||
|
|
797accbc2c | ||
|
|
66f9bc48bb | ||
|
|
de2eff474c | ||
|
|
67195859dc | ||
|
|
61abc6dd11 | ||
|
|
9fe9245727 | ||
|
|
906ec7994e | ||
|
|
5258b0a5b4 | ||
|
|
ceac53b6d0 | ||
|
|
3775d5c9c2 | ||
|
|
da80d4ef62 | ||
|
|
205ad0fd6d | ||
|
|
d208731f5f | ||
|
|
a90acdabb3 | ||
|
|
407d1cdcaa | ||
|
|
cb50bbc3cb | ||
|
|
2743268fd7 | ||
|
|
8cc0977a01 | ||
|
|
0809ec8c72 | ||
|
|
db93710f85 | ||
|
|
241c93c6b7 | ||
|
|
bf07ab9e2f | ||
|
|
fe05e6a464 | ||
|
|
d1aa6aa7f8 | ||
|
|
79af7e8abf | ||
|
|
a142d975d7 | ||
|
|
67691d1e99 | ||
|
|
9b827b4801 | ||
|
|
421f4dbf60 | ||
|
|
8f119c4265 | ||
|
|
9866702850 | ||
|
|
a313a9bb31 | ||
|
|
e53f5fdd29 | ||
|
|
b6c0a04394 | ||
|
|
1e3b8315a0 | ||
|
|
dc5d705f8c | ||
|
|
4f10c12092 | ||
|
|
3aa44f9f6d | ||
|
|
78b4733fb9 | ||
|
|
37bb3bc546 | ||
|
|
b43bfce254 | ||
|
|
0d6281ef6b | ||
|
|
8e2844e0c5 | ||
|
|
c27e38b11c | ||
|
|
cf75054106 | ||
|
|
4ed987229b | ||
|
|
a1068b6fe3 | ||
|
|
91a61e058a | ||
|
|
bebcabc292 | ||
|
|
5bdf15aece | ||
|
|
d347b7a91e | ||
|
|
2c653f170c | ||
|
|
75218ef826 | ||
|
|
b7fbbed895 | ||
|
|
f8c0d73d2d | ||
|
|
006cb56d28 | ||
|
|
55dee0df7e | ||
|
|
2a275b2875 | ||
|
|
4246232fbe | ||
|
|
9d8c9609c3 | ||
|
|
ef5492074e | ||
|
|
40d5686031 | ||
|
|
4276a7a56d | ||
|
|
d6fa1c7c80 | ||
|
|
6cbc3c78e2 | ||
|
|
29966451b6 | ||
|
|
64f0662a61 | ||
|
|
0ccfd0c743 | ||
|
|
0ea1733acc | ||
|
|
8fb59bbfb9 | ||
|
|
7c401040c8 | ||
|
|
43541bde2c | ||
|
|
1e01c4dc46 | ||
|
|
e85d368f87 | ||
|
|
95376f78f6 | ||
|
|
30daea0c4f | ||
|
|
b891e08928 | ||
|
|
94df09c8c0 | ||
|
|
bdf6d4d42a | ||
|
|
cb2e1ae355 | ||
|
|
9705406b82 | ||
|
|
4e00b1b0cd | ||
|
|
fe5ba6850b | ||
|
|
5690dab6bb | ||
|
|
65506a5b30 | ||
|
|
f09bb2689c | ||
|
|
e6f376ae66 | ||
|
|
1c2998c4d8 | ||
|
|
fc5d5cf231 | ||
|
|
2a4fc7dcc3 | ||
|
|
b68d6e2693 | ||
|
|
0b34b142c8 | ||
|
|
0b2a9d8511 | ||
|
|
7c9c5c316b | ||
|
|
180ae206c7 | ||
|
|
69e3ba6bed | ||
|
|
bf5b7e747d | ||
|
|
24154c95f2 | ||
|
|
0b10d24eb2 | ||
|
|
06ec59eca4 | ||
|
|
35a8817442 | ||
|
|
c7378e78d9 | ||
|
|
ab182dc22a | ||
|
|
f554e5a357 | ||
|
|
749486ba3c | ||
|
|
26aae0e637 | ||
|
|
95c8d8fc9c | ||
|
|
1021023577 | ||
|
|
3d0c6004c0 | ||
|
|
6c53bd00f6 | ||
|
|
cc759bef56 | ||
|
|
d670adc11f | ||
|
|
349c383604 | ||
|
|
f407488128 | ||
|
|
086b10717f | ||
|
|
eefd0444c8 | ||
|
|
65a61ed270 | ||
|
|
5e7db4631e | ||
|
|
0d6114e25e | ||
|
|
ce5a6fa3ac | ||
|
|
246851fdbe | ||
|
|
21c30ac157 | ||
|
|
269d92e637 | ||
|
|
ffe145d436 | ||
|
|
37cd841992 | ||
|
|
315ab94c94 | ||
|
|
1aa9963e07 | ||
|
|
88ade2c0b7 | ||
|
|
4ada7dce77 | ||
|
|
a323689ee6 | ||
|
|
2ea612e2fe | ||
|
|
ca2557eb7e | ||
|
|
e0f95686f3 | ||
|
|
29770e8bfb | ||
|
|
b959acc69d | ||
|
|
486cf8bdac | ||
|
|
ea911387f1 | ||
|
|
0b9b89db81 | ||
|
|
eaf89aa2f2 | ||
|
|
4bd373ba57 | ||
|
|
7b29c65f58 | ||
|
|
2298ac6ff3 | ||
|
|
4477f47c25 | ||
|
|
4a2fe3aaae | ||
|
|
0f65b8bdd3 | ||
|
|
778282ae29 | ||
|
|
85dc29bfb9 | ||
|
|
05e46ee4a8 | ||
|
|
6a3b052fa2 | ||
|
|
222c792539 | ||
|
|
51fb8ddb07 | ||
|
|
8e63b8f289 | ||
|
|
17c35be426 | ||
|
|
dfd461518f | ||
|
|
df5818cdc5 | ||
|
|
5894104524 | ||
|
|
09732df0f5 | ||
|
|
ae8f292306 | ||
|
|
9f8c0ce567 | ||
|
|
c7cf35c7de | ||
|
|
e5c9d8604d | ||
|
|
b2c22977c1 | ||
|
|
c0edb72b3d | ||
|
|
33d31b7dca | ||
|
|
4c465bef2d | ||
|
|
3bde9543f3 | ||
|
|
cff0e86989 | ||
|
|
65f7aa7914 | ||
|
|
06f5a5788e | ||
|
|
52c8ac2ad3 | ||
|
|
0c80654cc2 | ||
|
|
a2180f177f | ||
|
|
b992d07f3e | ||
|
|
dc3052e225 | ||
|
|
9b2e57cee5 | ||
|
|
77a3513a6b | ||
|
|
0dd2337663 | ||
|
|
d316c04837 | ||
|
|
63468dbaf3 | ||
|
|
2acd5d4af2 | ||
|
|
6c1cc1d283 | ||
|
|
15cfc9e1f5 | ||
|
|
004713d4cd | ||
|
|
7a6eb53e0f | ||
|
|
02c26d5bb4 | ||
|
|
c60c58ed69 | ||
|
|
366afdd1e4 | ||
|
|
307483e499 | ||
|
|
4608894e56 | ||
|
|
a1066322c8 | ||
|
|
050a2d39fa | ||
|
|
13aa61bbc0 | ||
|
|
f4d0e8c948 | ||
|
|
e7db587a9e | ||
|
|
059080f194 | ||
|
|
78c159cd59 | ||
|
|
721aa3c907 | ||
|
|
77178afad5 | ||
|
|
fd7b8c3293 | ||
|
|
660908e436 | ||
|
|
8d694f7732 | ||
|
|
bdfa9f7a56 | ||
|
|
19ef97a7ec | ||
|
|
2c17ea703d | ||
|
|
1591fdf61c | ||
|
|
811f3340e9 | ||
|
|
7e8d1128f8 | ||
|
|
54db6eda04 | ||
|
|
c5b26e3310 | ||
|
|
7079faf2b9 | ||
|
|
707d1a96eb | ||
|
|
76801dfa4f | ||
|
|
6e4577f721 | ||
|
|
7b0987610c | ||
|
|
50fa560d4a | ||
|
|
b8a7df21f2 | ||
|
|
d1a4348048 | ||
|
|
020b211660 | ||
|
|
4657e58b52 | ||
|
|
22971c3a93 | ||
|
|
5fa9aa3c22 | ||
|
|
fbce43870f | ||
|
|
b1e6956441 | ||
|
|
ad462cec29 | ||
|
|
a0a42285d0 | ||
|
|
b0b2776d03 | ||
|
|
e9ac6affef | ||
|
|
5eea1339c9 | ||
|
|
f303dc21a0 | ||
|
|
d68891d91d | ||
|
|
987bb80770 | ||
|
|
b884327a53 | ||
|
|
4743818fe7 | ||
|
|
43575e6f54 | ||
|
|
89f9dc5640 | ||
|
|
f7aca99d52 | ||
|
|
12a48ae2db | ||
|
|
bcb684d1cc | ||
|
|
d3b26f7126 | ||
|
|
422e190c96 | ||
|
|
3e13fa1ce6 | ||
|
|
dc9f531447 | ||
|
|
e330159f55 | ||
|
|
b88846fff5 | ||
|
|
93b6a910ae | ||
|
|
8d161b4526 | ||
|
|
b6acf62aab | ||
|
|
2a11aed881 | ||
|
|
e7b287902b | ||
|
|
c012ce0481 | ||
|
|
c97399a8ea | ||
|
|
75d622f4a2 | ||
|
|
5bdf7654fc | ||
|
|
62657f7f4e | ||
|
|
64332c3e6a | ||
|
|
57f51d1c58 | ||
|
|
9f3f730723 | ||
|
|
e9d303326f | ||
|
|
20d7112a05 | ||
|
|
922cc21abc | ||
|
|
cdbd934c4e | ||
|
|
ca1170583e | ||
|
|
f5629c8227 | ||
|
|
2f58032ad8 | ||
|
|
466bfe4b49 | ||
|
|
7d0407013e | ||
|
|
0e4e2e4bc5 | ||
|
|
a8a3cf31b4 | ||
|
|
f784516470 | ||
|
|
2aed7c70aa | ||
|
|
b1062f5387 | ||
|
|
29c835d27a | ||
|
|
0698c9c853 | ||
|
|
e54ff5ec9e | ||
|
|
f0a23f4620 | ||
|
|
c60bb12424 | ||
|
|
3b1bb4a95d | ||
|
|
05a5c59a7e | ||
|
|
734d5f3aed | ||
|
|
2cf07753e7 | ||
|
|
2935057ca7 | ||
|
|
68b30063a9 | ||
|
|
f06a3d171b | ||
|
|
a98e64cf0a | ||
|
|
dd04bc9e1d | ||
|
|
2f33eceada | ||
|
|
d5b88775d9 | ||
|
|
a7a01df79a | ||
|
|
e3fac742c5 | ||
|
|
ce390f3f79 | ||
|
|
43a8b7d0e1 | ||
|
|
b596d04939 | ||
|
|
84a3548232 | ||
|
|
63388a7d97 | ||
|
|
35f980d2b8 | ||
|
|
90b881502d | ||
|
|
dfac877957 | ||
|
|
87f5ac8b71 | ||
|
|
3c1a416afc | ||
|
|
972a49d6aa | ||
|
|
cea16fac88 | ||
|
|
7e994c8f11 | ||
|
|
646a41e931 | ||
|
|
735938395b | ||
|
|
d8e10ba399 | ||
|
|
8c28721839 | ||
|
|
da333b0b1e | ||
|
|
44d07ac401 | ||
|
|
d08ba56c28 | ||
|
|
c991a48df6 | ||
|
|
fd44255668 | ||
|
|
84564891be | ||
|
|
8c8bb9e59f | ||
|
|
99df4acfe9 | ||
|
|
47ffd99c3b | ||
|
|
c703f281d9 | ||
|
|
e179c65e52 | ||
|
|
29da70be56 | ||
|
|
a9dce26099 | ||
|
|
2c27f5d425 | ||
|
|
df7b4d54c6 | ||
|
|
9994b1fabc | ||
|
|
2d093d5be0 | ||
|
|
12b373701b | ||
|
|
2b8078a19b | ||
|
|
5617118fa8 | ||
|
|
fa93d0fd6e | ||
|
|
dc436490f8 | ||
|
|
d83f204d8c | ||
|
|
873973a088 | ||
|
|
d371cfd78d | ||
|
|
7b1bad5b29 | ||
|
|
0c2adfa1d2 | ||
|
|
07d9649b22 | ||
|
|
b7339e00ba | ||
|
|
58e68f8f80 | ||
|
|
cfa4151cff | ||
|
|
3d33b5d564 | ||
|
|
b516a8561f | ||
|
|
38383a426f | ||
|
|
7e34de23f1 | ||
|
|
f02ec375a6 | ||
|
|
3c5b0ea90a | ||
|
|
15e1037433 | ||
|
|
5da4c98f05 | ||
|
|
a73ee7aefc | ||
|
|
6c5bea9caf | ||
|
|
93ba2f4fab | ||
|
|
9417797b99 | ||
|
|
167e5596f2 | ||
|
|
2a1e34fe03 | ||
|
|
3de00cf4a8 | ||
|
|
1d55545e30 | ||
|
|
9b5a555d1f | ||
|
|
9c842d0a40 | ||
|
|
0dc377550f | ||
|
|
8a91b0ad9d | ||
|
|
1b50ab5dca | ||
|
|
6053df050c | ||
|
|
3517c6181d | ||
|
|
2e126c71f0 | ||
|
|
46d7ecca88 | ||
|
|
48d8c6ee0f | ||
|
|
5fd3cfdb61 | ||
|
|
10d710cf03 | ||
|
|
21702b615a | ||
|
|
d75338b6e9 | ||
|
|
b85af714f5 | ||
|
|
a2b32e0b75 | ||
|
|
0505598509 | ||
|
|
91d45d6d46 | ||
|
|
de7058532a | ||
|
|
7c94db0ca0 | ||
|
|
1d8603df2b | ||
|
|
6a8c559e8c | ||
|
|
7418d2965d | ||
|
|
ac560dfcf9 | ||
|
|
1afc183458 | ||
|
|
697d01e306 | ||
|
|
aed137472c | ||
|
|
bdc9632b5b | ||
|
|
6f32643d7c | ||
|
|
346d219cd5 | ||
|
|
6b5d5e757e | ||
|
|
e202d7b8d6 | ||
|
|
5a20db0bed | ||
|
|
2136a954f5 | ||
|
|
0e8d3e6907 | ||
|
|
592e037f21 | ||
|
|
c6695121f0 | ||
|
|
17a61bb65f | ||
|
|
49666ddaf3 | ||
|
|
29f73f0d25 | ||
|
|
3f3f6eaee8 | ||
|
|
f743532e57 | ||
|
|
58f62f88a8 | ||
|
|
3a837203a5 | ||
|
|
1a86b3cb5a | ||
|
|
d211f0f474 | ||
|
|
eb80bc7798 | ||
|
|
3b0346d84c | ||
|
|
65ade1fc87 | ||
|
|
5dd6d505cc | ||
|
|
2fe2b82809 | ||
|
|
06fc29aecd | ||
|
|
536627007d | ||
|
|
3c58953e56 | ||
|
|
0d317839d2 | ||
|
|
fa9443f121 | ||
|
|
a7425ac558 | ||
|
|
9611ff7386 | ||
|
|
87e6277977 | ||
|
|
0945b14deb | ||
|
|
1b60180b79 | ||
|
|
bfc6e4dd0f | ||
|
|
57ce96d23e | ||
|
|
64f67f4bda | ||
|
|
5b2e6a568f | ||
|
|
8cb9675965 | ||
|
|
011fcc7dd4 | ||
|
|
a62c982a3d | ||
|
|
08210d55c3 | ||
|
|
62f0122cd5 | ||
|
|
8cb3994022 | ||
|
|
cad4db128b | ||
|
|
4871ebf24e | ||
|
|
929f621be4 | ||
|
|
2c8ff2794d | ||
|
|
d1a7527c0d | ||
|
|
3be5ea34a4 | ||
|
|
4ce728300b | ||
|
|
1999260f9d | ||
|
|
ceef257348 | ||
|
|
babeb468c1 | ||
|
|
85ce72282b | ||
|
|
f80f0f2422 | ||
|
|
9f81362027 | ||
|
|
cc54be0d1d | ||
|
|
40680a5e0f | ||
|
|
f849a94dc5 | ||
|
|
50fee8b0f4 |
@@ -1,2 +1 @@
|
||||
web/node_modules
|
||||
web/yarn.lock
|
||||
|
||||
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
github: usememos
|
||||
38
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Bug Report
|
||||
description: If something isn't working as expected
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before submitting a bug report, please check if the issue is already present in the issues. If it is, please add a reaction to the issue. If it isn't, please fill out the form below.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: |
|
||||
Briefly describe the problem you are having in a few paragraphs.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: |
|
||||
Provide the steps to reproduce the issue.
|
||||
placeholder: |
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. See error
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: The version of Memos you're using
|
||||
description: |
|
||||
Provide the version of Memos you're using.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshots or additional context
|
||||
description: |
|
||||
If applicable, add screenshots to help explain your problem. And add any other context about the problem here. Such as the device you're using, etc.
|
||||
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
36
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
36
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Feature Request
|
||||
description: If you have a suggestion for a new feature
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before submitting a feature request, please check if the issue is already present in the issues. If it is, please add a reaction to the issue. If it isn't, please fill out the form below.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
description: |
|
||||
A clear and concise description of what you want to happen.
|
||||
placeholder: |
|
||||
It would be great if [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Type of feature
|
||||
description: What type of feature is this?
|
||||
options:
|
||||
- User Interface (UI)
|
||||
- User Experience (UX)
|
||||
- API
|
||||
- Documentation
|
||||
- Integrations
|
||||
- Other
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: |
|
||||
What are you trying to do? Why is this important to you?
|
||||
20
.github/dependabot.yml
vendored
Normal file
20
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: npm
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
directory: "/web"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "gomod"
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
48
.github/workflows/backend-tests.yml
vendored
Normal file
48
.github/workflows/backend-tests.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Backend Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- "release/*.*.*"
|
||||
paths:
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- "**.go"
|
||||
|
||||
jobs:
|
||||
go-static-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22
|
||||
check-latest: true
|
||||
cache: true
|
||||
- name: Verify go.mod is tidy
|
||||
run: |
|
||||
go mod tidy -go=1.22
|
||||
git diff --exit-code
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: v1.54.1
|
||||
args: --verbose --timeout=3m
|
||||
skip-cache: true
|
||||
|
||||
go-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22
|
||||
check-latest: true
|
||||
cache: true
|
||||
- name: Run all tests
|
||||
run: go test -v ./... | tee test.log; exit ${PIPESTATUS[0]}
|
||||
- name: Pretty print tests running time
|
||||
run: grep --color=never -e '--- PASS:' -e '--- FAIL:' test.log | sed 's/[:()]//g' | awk '{print $2,$3,$4}' | sort -t' ' -nk3 -r | awk '{sum += $3; print $1,$2,$3,sum"s"}'
|
||||
31
.github/workflows/build-and-push-dev-image.yml
vendored
31
.github/workflows/build-and-push-dev-image.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: build-and-push-dev-image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
build-and-push-dev-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_NEOSMEMO_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build and Push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_NEOSMEMO_USERNAME }}/memos:dev
|
||||
@@ -4,35 +4,64 @@ on:
|
||||
push:
|
||||
branches:
|
||||
# Run on pushing branches like `release/1.0.0`
|
||||
- "release/v*.*.*"
|
||||
- "release/*.*.*"
|
||||
|
||||
jobs:
|
||||
build-and-push-release-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Extract build args
|
||||
# Extract version from branch name
|
||||
# Example: branch name `release/v1.0.0` sets up env.VERSION=1.0.0
|
||||
# Example: branch name `release/1.0.0` sets up env.VERSION=1.0.0
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF_NAME#release/v}" >> $GITHUB_ENV
|
||||
echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_NEOSMEMO_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
||||
username: stevenlgtm
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
version: v0.9.1
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
neosmemo/memos
|
||||
ghcr.io/usememos/memos
|
||||
tags: |
|
||||
type=semver,pattern={{version}},value=${{ env.VERSION }}
|
||||
type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
|
||||
|
||||
- name: Build and Push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_NEOSMEMO_USERNAME }}/memos:${{ env.VERSION }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
61
.github/workflows/build-and-push-stable-image.yml
vendored
Normal file
61
.github/workflows/build-and-push-stable-image.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: build-and-push-stable-image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "stable"
|
||||
|
||||
jobs:
|
||||
build-and-push-release-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: stevenlgtm
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
version: v0.9.1
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
neosmemo/memos
|
||||
ghcr.io/usememos/memos
|
||||
tags: |
|
||||
type=raw,value=stable
|
||||
flavor: |
|
||||
latest=true
|
||||
|
||||
- name: Build and Push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
60
.github/workflows/build-and-push-test-image.yml
vendored
Normal file
60
.github/workflows/build-and-push-test-image.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: build-and-push-test-image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-push-test-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: stevenlgtm
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
version: v0.9.1
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
neosmemo/memos
|
||||
ghcr.io/usememos/memos
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=raw,value=test
|
||||
|
||||
- name: Build and Push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
45
.github/workflows/build-artifacts.yml
vendored
Normal file
45
.github/workflows/build-artifacts.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Build artifacts
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22
|
||||
check-latest: true
|
||||
cache: true
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: pnpm
|
||||
cache-dependency-path: "web/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: web
|
||||
- run: pnpm release
|
||||
working-directory: web
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
# either 'goreleaser' (default) or 'goreleaser-pro'
|
||||
distribution: goreleaser
|
||||
# 'latest', 'nightly', or a semver
|
||||
version: latest
|
||||
args: release --clean --skip-validate
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
70
.github/workflows/codeql.yml
vendored
70
.github/workflows/codeql.yml
vendored
@@ -1,70 +0,0 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: '27 12 * * 0'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go', 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
51
.github/workflows/frontend-tests.yml
vendored
Normal file
51
.github/workflows/frontend-tests.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Frontend Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- "release/*.*.*"
|
||||
paths:
|
||||
- "web/**"
|
||||
|
||||
jobs:
|
||||
static-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: pnpm
|
||||
cache-dependency-path: "web/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: web
|
||||
- name: Run eslint check
|
||||
run: pnpm lint
|
||||
working-directory: web
|
||||
- name: Run type checks
|
||||
run: pnpm type-check
|
||||
working-directory: web
|
||||
|
||||
frontend-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: pnpm
|
||||
cache-dependency-path: "web/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: web
|
||||
- name: Run frontend build
|
||||
run: pnpm build
|
||||
working-directory: web
|
||||
18
.github/workflows/issue-translator.yml
vendored
Normal file
18
.github/workflows/issue-translator.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: 'issue-translator'
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: usthe/issues-translate-action@v2.7
|
||||
with:
|
||||
IS_MODIFY_TITLE: false
|
||||
# not require, default false, . Decide whether to modify the issue title
|
||||
# if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot.
|
||||
CUSTOM_BOT_NOTE: Issue is not in English. It has been translated automatically.
|
||||
# not require. Customize the translation robot prefix message.
|
||||
34
.github/workflows/proto-linter.yml
vendored
Normal file
34
.github/workflows/proto-linter.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Proto linter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- "release/*.*.*"
|
||||
paths:
|
||||
- "proto/**"
|
||||
|
||||
jobs:
|
||||
lint-protos:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup buf
|
||||
uses: bufbuild/buf-setup-action@v1
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
- name: buf lint
|
||||
uses: bufbuild/buf-lint-action@v1
|
||||
with:
|
||||
input: "proto"
|
||||
- name: buf format
|
||||
run: |
|
||||
if [[ $(buf format -d) ]]; then
|
||||
echo "Run 'buf format -w'"
|
||||
exit 1
|
||||
fi
|
||||
17
.github/workflows/stale.yml
vendored
Normal file
17
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Close Stale Issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 */8 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v9.0.0
|
||||
with:
|
||||
days-before-issue-stale: 14
|
||||
days-before-issue-close: 7
|
||||
37
.gitignore
vendored
37
.gitignore
vendored
@@ -1,28 +1,25 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Temp output
|
||||
*.out
|
||||
*.log
|
||||
tmp
|
||||
|
||||
# Air (hot reload) generated
|
||||
.air
|
||||
|
||||
# Frontend asset
|
||||
dist
|
||||
# temp folder
|
||||
tmp
|
||||
|
||||
# Dev database
|
||||
data
|
||||
# Frontend asset
|
||||
web/dist
|
||||
|
||||
# build folder
|
||||
build
|
||||
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
# Jetbrains
|
||||
.idea
|
||||
|
||||
# Docker Compose Environment File
|
||||
.env
|
||||
|
||||
bin/air
|
||||
|
||||
dev-dist
|
||||
|
||||
dist
|
||||
93
.golangci.yaml
Normal file
93
.golangci.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
run:
|
||||
timeout: 10m
|
||||
linters:
|
||||
enable:
|
||||
- errcheck
|
||||
- goimports
|
||||
- revive
|
||||
- govet
|
||||
- staticcheck
|
||||
- misspell
|
||||
- gocritic
|
||||
- sqlclosecheck
|
||||
- rowserrcheck
|
||||
- nilerr
|
||||
- godot
|
||||
- forbidigo
|
||||
- mirror
|
||||
- bodyclose
|
||||
|
||||
issues:
|
||||
include:
|
||||
# https://golangci-lint.run/usage/configuration/#command-line-options
|
||||
exclude:
|
||||
- Rollback
|
||||
- logger.Sync
|
||||
- pgInstance.Stop
|
||||
- fmt.Printf
|
||||
- Enter(.*)_(.*)
|
||||
- Exit(.*)_(.*)
|
||||
|
||||
linters-settings:
|
||||
goimports:
|
||||
# Put imports beginning with prefix after 3rd-party packages.
|
||||
local-prefixes: github.com/usememos/memos
|
||||
revive:
|
||||
# Default to run all linters so that new rules in the future could automatically be added to the static check.
|
||||
enable-all-rules: true
|
||||
rules:
|
||||
# The following rules are too strict and make coding harder. We do not enable them for now.
|
||||
- name: file-header
|
||||
disabled: true
|
||||
- name: line-length-limit
|
||||
disabled: true
|
||||
- name: function-length
|
||||
disabled: true
|
||||
- name: max-public-structs
|
||||
disabled: true
|
||||
- name: function-result-limit
|
||||
disabled: true
|
||||
- name: banned-characters
|
||||
disabled: true
|
||||
- name: argument-limit
|
||||
disabled: true
|
||||
- name: cognitive-complexity
|
||||
disabled: true
|
||||
- name: cyclomatic
|
||||
disabled: true
|
||||
- name: confusing-results
|
||||
disabled: true
|
||||
- name: add-constant
|
||||
disabled: true
|
||||
- name: flag-parameter
|
||||
disabled: true
|
||||
- name: nested-structs
|
||||
disabled: true
|
||||
- name: import-shadowing
|
||||
disabled: true
|
||||
- name: early-return
|
||||
disabled: true
|
||||
- name: use-any
|
||||
disabled: true
|
||||
- name: exported
|
||||
disabled: true
|
||||
- name: unhandled-error
|
||||
disabled: true
|
||||
- name: if-return
|
||||
disabled: true
|
||||
gocritic:
|
||||
disabled-checks:
|
||||
- ifElseChain
|
||||
govet:
|
||||
settings:
|
||||
printf: # The name of the analyzer, run `go tool vet help` to see the list of all analyzers
|
||||
funcs: # Run `go tool vet help printf` to see the full configuration of `printf`.
|
||||
- common.Errorf
|
||||
enable-all: true
|
||||
disable:
|
||||
- fieldalignment
|
||||
- shadow
|
||||
forbidigo:
|
||||
forbid:
|
||||
- 'fmt\.Errorf(# Please use errors\.Wrap\|Wrapf\|Errorf instead)?'
|
||||
- 'ioutil\.ReadDir(# Please use os\.ReadDir)?'
|
||||
38
.goreleaser.yaml
Normal file
38
.goreleaser.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
version: 1
|
||||
|
||||
before:
|
||||
hooks:
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
main: ./bin/memos
|
||||
binary: memos
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
# this name template makes the OS and Arch compatible with the results of `uname`.
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
|
||||
checksum:
|
||||
disable: true
|
||||
|
||||
release:
|
||||
draft: true
|
||||
replace_existing_draft: true
|
||||
make_latest: true
|
||||
mode: replace
|
||||
skip_upload: false
|
||||
@@ -1,2 +1,2 @@
|
||||
# These owners will be the default owners for everything in the repo.
|
||||
* @boojack @lqwakeup
|
||||
* @boojack
|
||||
|
||||
42
Dockerfile
42
Dockerfile
@@ -1,32 +1,40 @@
|
||||
# Build frontend dist.
|
||||
FROM node:14.18.2-alpine3.14 AS frontend
|
||||
FROM node:20-alpine AS frontend
|
||||
WORKDIR /frontend-build
|
||||
|
||||
COPY ./web/ .
|
||||
|
||||
RUN yarn
|
||||
RUN yarn build
|
||||
|
||||
# Build backend exec file.
|
||||
FROM golang:1.16.12-alpine3.15 AS backend
|
||||
WORKDIR /backend-build
|
||||
|
||||
RUN apk --no-cache add gcc musl-dev
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build \
|
||||
-o memos \
|
||||
./bin/server/main.go
|
||||
WORKDIR /frontend-build/web
|
||||
|
||||
RUN corepack enable && pnpm i --frozen-lockfile
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
# Build backend exec file.
|
||||
FROM golang:1.22-alpine AS backend
|
||||
WORKDIR /backend-build
|
||||
|
||||
COPY . .
|
||||
COPY --from=frontend /frontend-build/web/dist /backend-build/server/router/frontend/dist
|
||||
|
||||
RUN CGO_ENABLED=0 go build -o memos ./bin/memos/main.go
|
||||
|
||||
# Make workspace with above generated files.
|
||||
FROM alpine:3.14.3 AS monolithic
|
||||
FROM alpine:latest AS monolithic
|
||||
WORKDIR /usr/local/memos
|
||||
|
||||
RUN apk add --no-cache tzdata
|
||||
ENV TZ="UTC"
|
||||
|
||||
COPY --from=backend /backend-build/memos /usr/local/memos/
|
||||
COPY --from=frontend /frontend-build/dist /usr/local/memos/web/dist
|
||||
|
||||
EXPOSE 5230
|
||||
|
||||
# Directory to store the data, which can be referenced as the mounting point.
|
||||
RUN mkdir -p /var/opt/memos
|
||||
VOLUME /var/opt/memos
|
||||
|
||||
ENV MEMOS_MODE="prod"
|
||||
ENV MEMOS_PORT="5230"
|
||||
|
||||
ENTRYPOINT ["./memos"]
|
||||
|
||||
102
README.md
102
README.md
@@ -1,85 +1,61 @@
|
||||
<h1 align="center">✍️ Memos</h1>
|
||||
<img height="56px" src="https://www.usememos.com/full-logo-landscape.png" alt="Memos" />
|
||||
|
||||
<p align="center">An open source, self-hosted knowledge base that works with a SQLite db file.</p>
|
||||
A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.
|
||||
|
||||
<p align="center">
|
||||
<img alt="GitHub stars" src="https://img.shields.io/github/stars/usememos/memos" />
|
||||
<img alt="Docker pull" src="https://img.shields.io/docker/pulls/neosmemo/memos.svg" />
|
||||
<img alt="Go report" src="https://goreportcard.com/badge/github.com/usememos/memos" />
|
||||
<a href="https://www.usememos.com">Home Page</a> •
|
||||
<a href="https://www.usememos.com/blog">Blogs</a> •
|
||||
<a href="https://www.usememos.com/docs">Docs</a> •
|
||||
<a href="https://demo.usememos.com/">Live Demo</a>
|
||||
|
||||
<p>
|
||||
<a href="https://hub.docker.com/r/neosmemo/memos"><img alt="Docker pull" src="https://img.shields.io/docker/pulls/neosmemo/memos.svg"/></a>
|
||||
<a href="https://discord.gg/tfPJa4UmAv"><img alt="Discord" src="https://img.shields.io/badge/discord-chat-5865f2?logo=discord&logoColor=f5f5f5" /></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://memos.onrender.com/">Live Demo</a> •
|
||||
<a href="https://github.com/usememos/memos/discussions">Discussions</a>
|
||||
</p>
|
||||

|
||||
|
||||

|
||||
## Key points
|
||||
|
||||
## 🎯 Intentions
|
||||
- **Open source and free to use**. Embrace a future where creativity knows no boundaries with our open-source solution. All features are free to use and will never be charged in any form or content.
|
||||
- **Self-hosting with Docker in just seconds**. Enjoy the flexibility, scalability, and ease of setup that Docker provides, allowing you to have full control over your data and privacy.
|
||||
- **Pure text with added Markdown support.** Say goodbye to the overwhelming mental burden of rich formatting and embrace a minimalist approach.
|
||||
- **Customize and share your notes effortlessly**. With our intuitive sharing features, you can easily collaborate and distribute your notes with others.
|
||||
- **RESTful API for third-party services.** Embrace the power of integration and unleash new possibilities with our RESTful API support.
|
||||
|
||||
- ✍️ Write down the light-card memos very easily;
|
||||
- 🏗️ Build the fragmented knowledge management tool for yourself;
|
||||
- 📒 For noting your 📅 daily/weekly plans, 💡 fantastic ideas, 📕 reading thoughts...
|
||||
## Deploy with Docker in seconds
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 🦄 Fully open source;
|
||||
- 👍 Write in the plain textarea without any burden;
|
||||
- 🤠 Great UI and never miss any detail;
|
||||
- 🚀 Super quick self-hosted with `Docker` and `SQLite`;
|
||||
|
||||
## ⚓️ Deploy with Docker
|
||||
|
||||
```docker
|
||||
docker run --name memos --publish 5230:5230 --volume ~/.memos/:/var/opt/memos -e mode=prod -e port=5230 neosmemo/memos:0.1.0
|
||||
```bash
|
||||
docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable
|
||||
```
|
||||
|
||||
Memos should now be running at [http://localhost:5230](http://localhost:5230). If the `~/.memos/` does not have a `memos_prod.db` file, then `memos` will auto generate it.
|
||||
> [!NOTE]
|
||||
> This command is only applicable for Unix/Linux systems. For Windows, please refer to the detailed [documentation](https://www.usememos.com/docs/install/self-hosting).
|
||||
>
|
||||
> The `~/.memos/` directory will be used as the data directory on your local machine, while `/var/opt/memos` is the directory of the volume in Docker and should not be modified.
|
||||
|
||||
## 🏗 Development
|
||||
Learn more about [other installation methods](https://www.usememos.com/docs/install).
|
||||
|
||||
Memos is built with a curated tech stack. It is optimized for developer experience and is very easy to start working on the code:
|
||||
## Contribution
|
||||
|
||||
1. It has no external dependency.
|
||||
2. It requires zero config.
|
||||
3. 1 command to start backend and 1 command to start frontend, both with live reload support.
|
||||
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. We greatly appreciate any contributions you make. Thank you for being a part of our community! 🥰
|
||||
|
||||
### Tech Stack
|
||||
<a href="https://github.com/usememos/memos/graphs/contributors">
|
||||
<img src="https://contri-graphy.yourselfhosted.com/graph?repo=usememos/memos&format=svg" />
|
||||
</a>
|
||||
|
||||
<img alt="tech stack" src="https://raw.githubusercontent.com/usememos/memos/main/resources/tech-stack.png" width="360" />
|
||||
## Internationalization
|
||||
|
||||
### Prerequisites
|
||||
Memos supports multiple languages. You can help us translate Memos into your language. We use Weblate to manage translations.
|
||||
|
||||
- [Go](https://golang.org/doc/install) (1.16 or later)
|
||||
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload
|
||||
- [yarn](https://yarnpkg.com/getting-started/install)
|
||||
<a href="https://hosted.weblate.org/engage/memos-i18n/">
|
||||
<img src="https://hosted.weblate.org/widget/memos-i18n/english/287x66-grey.png" alt="Translation status" />
|
||||
</a>
|
||||
|
||||
### Steps
|
||||
|
||||
1. pull source code
|
||||
|
||||
```bash
|
||||
git clone https://github.com/usememos/memos
|
||||
```
|
||||
|
||||
2. start backend using air(with live reload)
|
||||
|
||||
```bash
|
||||
air -c scripts/.air.toml
|
||||
```
|
||||
|
||||
3. start frontend dev server
|
||||
|
||||
```bash
|
||||
cd web && yarn && yarn dev
|
||||
```
|
||||
|
||||
Memos should now be running at [http://localhost:3000](http://localhost:3000) and change either frontend or backend code would trigger live reload.
|
||||
|
||||
## 🌟 Star history
|
||||
## Star history
|
||||
|
||||
[](https://star-history.com/#usememos/memos&Date)
|
||||
|
||||
---
|
||||
## Other projects
|
||||
|
||||
Just enjoy it.
|
||||
- [**Slash**](https://github.com/yourselfhosted/slash): An open source, self-hosted bookmarks and link sharing platform. Save and share your links very easily.
|
||||
- [**Gomark**](https://github.com/yourselfhosted/gomark): A markdown parser written in Go for Memos. And its [WebAssembly version](https://github.com/yourselfhosted/gomark-wasm) is also available.
|
||||
|
||||
7
SECURITY.md
Normal file
7
SECURITY.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a bug
|
||||
|
||||
Report security bugs via GitHub [issues](https://github.com/usememos/memos/issues).
|
||||
|
||||
For more information, please contact [usememos@gmail.com](usememos@gmail.com).
|
||||
21
api/api.go
21
api/api.go
@@ -1,21 +0,0 @@
|
||||
package api
|
||||
|
||||
// RowStatus is the status for a row.
|
||||
type RowStatus string
|
||||
|
||||
const (
|
||||
// Normal is the status for a normal row.
|
||||
Normal RowStatus = "NORMAL"
|
||||
// Archived is the status for an archived row.
|
||||
Archived RowStatus = "ARCHIVED"
|
||||
)
|
||||
|
||||
func (e RowStatus) String() string {
|
||||
switch e {
|
||||
case Normal:
|
||||
return "NORMAL"
|
||||
case Archived:
|
||||
return "ARCHIVED"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
13
api/auth.go
13
api/auth.go
@@ -1,13 +0,0 @@
|
||||
package api
|
||||
|
||||
type Login struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type Signup struct {
|
||||
Email string `json:"email"`
|
||||
Role Role `json:"role"`
|
||||
Name string `json:"name"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
51
api/memo.go
51
api/memo.go
@@ -1,51 +0,0 @@
|
||||
package api
|
||||
|
||||
type Memo struct {
|
||||
ID int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
RowStatus RowStatus `json:"rowStatus"`
|
||||
CreatorID int `json:"creatorId"`
|
||||
CreatedTs int64 `json:"createdTs"`
|
||||
UpdatedTs int64 `json:"updatedTs"`
|
||||
|
||||
// Domain specific fields
|
||||
Content string `json:"content"`
|
||||
Pinned bool `json:"pinned"`
|
||||
}
|
||||
|
||||
type MemoCreate struct {
|
||||
// Standard fields
|
||||
CreatorID int
|
||||
// Used to import memos with a clearly created ts.
|
||||
CreatedTs *int64 `json:"createdTs"`
|
||||
|
||||
// Domain specific fields
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type MemoPatch struct {
|
||||
ID int
|
||||
|
||||
// Standard fields
|
||||
RowStatus *RowStatus `json:"rowStatus"`
|
||||
|
||||
// Domain specific fields
|
||||
Content *string `json:"content"`
|
||||
}
|
||||
|
||||
type MemoFind struct {
|
||||
ID *int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
RowStatus *RowStatus `json:"rowStatus"`
|
||||
CreatorID *int `json:"creatorId"`
|
||||
|
||||
// Domain specific fields
|
||||
Pinned *bool
|
||||
Tag *string
|
||||
}
|
||||
|
||||
type MemoDelete struct {
|
||||
ID int `json:"id"`
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package api
|
||||
|
||||
type MemoOrganizer struct {
|
||||
ID int
|
||||
|
||||
// Domain specific fields
|
||||
MemoID int
|
||||
UserID int
|
||||
Pinned bool
|
||||
}
|
||||
|
||||
type MemoOrganizerFind struct {
|
||||
MemoID int
|
||||
UserID int
|
||||
}
|
||||
|
||||
type MemoOrganizerUpsert struct {
|
||||
MemoID int
|
||||
UserID int
|
||||
Pinned bool `json:"pinned"`
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package api
|
||||
|
||||
type Resource struct {
|
||||
ID int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
CreatorID int `json:"creatorId"`
|
||||
CreatedTs int64 `json:"createdTs"`
|
||||
UpdatedTs int64 `json:"updatedTs"`
|
||||
|
||||
// Domain specific fields
|
||||
Filename string `json:"filename"`
|
||||
Blob []byte `json:"blob"`
|
||||
Type string `json:"type"`
|
||||
Size int64 `json:"size"`
|
||||
}
|
||||
|
||||
type ResourceCreate struct {
|
||||
// Standard fields
|
||||
CreatorID int
|
||||
|
||||
// Domain specific fields
|
||||
Filename string `json:"filename"`
|
||||
Blob []byte `json:"blob"`
|
||||
Type string `json:"type"`
|
||||
Size int64 `json:"size"`
|
||||
}
|
||||
|
||||
type ResourceFind struct {
|
||||
ID *int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
CreatorID *int `json:"creatorId"`
|
||||
|
||||
// Domain specific fields
|
||||
Filename *string `json:"filename"`
|
||||
}
|
||||
|
||||
type ResourceDelete struct {
|
||||
ID int
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package api
|
||||
|
||||
type Shortcut struct {
|
||||
ID int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
RowStatus RowStatus `json:"rowStatus"`
|
||||
CreatorID int `json:"creatorId"`
|
||||
CreatedTs int64 `json:"createdTs"`
|
||||
UpdatedTs int64 `json:"updatedTs"`
|
||||
|
||||
// Domain specific fields
|
||||
Title string `json:"title"`
|
||||
Payload string `json:"payload"`
|
||||
}
|
||||
|
||||
type ShortcutCreate struct {
|
||||
// Standard fields
|
||||
CreatorID int
|
||||
|
||||
// Domain specific fields
|
||||
Title string `json:"title"`
|
||||
Payload string `json:"payload"`
|
||||
}
|
||||
|
||||
type ShortcutPatch struct {
|
||||
ID int
|
||||
|
||||
// Standard fields
|
||||
RowStatus *RowStatus `json:"rowStatus"`
|
||||
|
||||
// Domain specific fields
|
||||
Title *string `json:"title"`
|
||||
Payload *string `json:"payload"`
|
||||
}
|
||||
|
||||
type ShortcutFind struct {
|
||||
ID *int
|
||||
|
||||
// Standard fields
|
||||
CreatorID *int
|
||||
|
||||
// Domain specific fields
|
||||
Title *string `json:"title"`
|
||||
}
|
||||
|
||||
type ShortcutDelete struct {
|
||||
ID int
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package api
|
||||
|
||||
import "memos/server/profile"
|
||||
|
||||
type SystemStatus struct {
|
||||
Owner *User `json:"owner"`
|
||||
Profile *profile.Profile `json:"profile"`
|
||||
}
|
||||
75
api/user.go
75
api/user.go
@@ -1,75 +0,0 @@
|
||||
package api
|
||||
|
||||
// Role is the type of a role.
|
||||
type Role string
|
||||
|
||||
const (
|
||||
// Owner is the OWNER role.
|
||||
Owner Role = "OWNER"
|
||||
// NormalUser is the USER role.
|
||||
NormalUser Role = "USER"
|
||||
)
|
||||
|
||||
func (e Role) String() string {
|
||||
switch e {
|
||||
case Owner:
|
||||
return "OWNER"
|
||||
case NormalUser:
|
||||
return "USER"
|
||||
}
|
||||
return "USER"
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
RowStatus RowStatus `json:"rowStatus"`
|
||||
CreatedTs int64 `json:"createdTs"`
|
||||
UpdatedTs int64 `json:"updatedTs"`
|
||||
|
||||
// Domain specific fields
|
||||
Email string `json:"email"`
|
||||
Role Role `json:"role"`
|
||||
Name string `json:"name"`
|
||||
PasswordHash string `json:"-"`
|
||||
OpenID string `json:"openId"`
|
||||
}
|
||||
|
||||
type UserCreate struct {
|
||||
// Domain specific fields
|
||||
Email string `json:"email"`
|
||||
Role Role `json:"role"`
|
||||
Name string `json:"name"`
|
||||
Password string `json:"password"`
|
||||
PasswordHash string
|
||||
OpenID string
|
||||
}
|
||||
|
||||
type UserPatch struct {
|
||||
ID int
|
||||
|
||||
// Standard fields
|
||||
RowStatus *RowStatus `json:"rowStatus"`
|
||||
|
||||
// Domain specific fields
|
||||
Email *string `json:"email"`
|
||||
Name *string `json:"name"`
|
||||
Password *string `json:"password"`
|
||||
ResetOpenID *bool `json:"resetOpenId"`
|
||||
PasswordHash *string
|
||||
OpenID *string
|
||||
}
|
||||
|
||||
type UserFind struct {
|
||||
ID *int `json:"id"`
|
||||
|
||||
// Standard fields
|
||||
RowStatus *RowStatus `json:"rowStatus"`
|
||||
|
||||
// Domain specific fields
|
||||
Email *string `json:"email"`
|
||||
Role *Role
|
||||
Name *string `json:"name"`
|
||||
OpenID *string
|
||||
}
|
||||
187
bin/memos/main.go
Normal file
187
bin/memos/main.go
Normal file
@@ -0,0 +1,187 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/usememos/memos/server"
|
||||
"github.com/usememos/memos/server/profile"
|
||||
"github.com/usememos/memos/store"
|
||||
"github.com/usememos/memos/store/db"
|
||||
)
|
||||
|
||||
const (
|
||||
greetingBanner = `
|
||||
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
|
||||
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
|
||||
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
|
||||
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
|
||||
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
|
||||
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||
`
|
||||
)
|
||||
|
||||
var (
|
||||
mode string
|
||||
addr string
|
||||
port int
|
||||
data string
|
||||
driver string
|
||||
dsn string
|
||||
instanceProfile *profile.Profile
|
||||
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "memos",
|
||||
Short: `An open source, lightweight note-taking service. Easily capture and share your great thoughts.`,
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
dbDriver, err := db.NewDBDriver(instanceProfile)
|
||||
if err != nil {
|
||||
cancel()
|
||||
slog.Error("failed to create db driver", err)
|
||||
return
|
||||
}
|
||||
if err := dbDriver.Migrate(ctx); err != nil {
|
||||
cancel()
|
||||
slog.Error("failed to migrate database", err)
|
||||
return
|
||||
}
|
||||
|
||||
storeInstance := store.New(dbDriver, instanceProfile)
|
||||
if err := storeInstance.MigrateManually(ctx); err != nil {
|
||||
cancel()
|
||||
slog.Error("failed to migrate manually", err)
|
||||
return
|
||||
}
|
||||
|
||||
s, err := server.NewServer(ctx, instanceProfile, storeInstance)
|
||||
if err != nil {
|
||||
cancel()
|
||||
slog.Error("failed to create server", err)
|
||||
return
|
||||
}
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
// Trigger graceful shutdown on SIGINT or SIGTERM.
|
||||
// The default signal sent by the `kill` command is SIGTERM,
|
||||
// which is taken as the graceful shutdown signal for many systems, eg., Kubernetes, Gunicorn.
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
|
||||
if err := s.Start(ctx); err != nil {
|
||||
if err != http.ErrServerClosed {
|
||||
slog.Error("failed to start server", err)
|
||||
cancel()
|
||||
}
|
||||
}
|
||||
|
||||
printGreetings()
|
||||
|
||||
go func() {
|
||||
<-c
|
||||
s.Shutdown(ctx)
|
||||
cancel()
|
||||
}()
|
||||
|
||||
// Wait for CTRL-C.
|
||||
<-ctx.Done()
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func Execute() error {
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
|
||||
rootCmd.PersistentFlags().StringVarP(&mode, "mode", "m", "demo", `mode of server, can be "prod" or "dev" or "demo"`)
|
||||
rootCmd.PersistentFlags().StringVarP(&addr, "addr", "a", "", "address of server")
|
||||
rootCmd.PersistentFlags().IntVarP(&port, "port", "p", 8081, "port of server")
|
||||
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
|
||||
rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver")
|
||||
rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)")
|
||||
|
||||
err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = viper.BindPFlag("addr", rootCmd.PersistentFlags().Lookup("addr"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = viper.BindPFlag("data", rootCmd.PersistentFlags().Lookup("data"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = viper.BindPFlag("driver", rootCmd.PersistentFlags().Lookup("driver"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = viper.BindPFlag("dsn", rootCmd.PersistentFlags().Lookup("dsn"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
viper.SetDefault("mode", "demo")
|
||||
viper.SetDefault("driver", "sqlite")
|
||||
viper.SetDefault("addr", "")
|
||||
viper.SetDefault("port", 8081)
|
||||
viper.SetEnvPrefix("memos")
|
||||
}
|
||||
|
||||
func initConfig() {
|
||||
viper.AutomaticEnv()
|
||||
var err error
|
||||
instanceProfile, err = profile.GetProfile()
|
||||
if err != nil {
|
||||
slog.Error("failed to get profile", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf(`---
|
||||
Server profile
|
||||
version: %s
|
||||
data: %s
|
||||
dsn: %s
|
||||
addr: %s
|
||||
port: %d
|
||||
mode: %s
|
||||
driver: %s
|
||||
---
|
||||
`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Driver)
|
||||
}
|
||||
|
||||
func printGreetings() {
|
||||
print(greetingBanner)
|
||||
if len(instanceProfile.Addr) == 0 {
|
||||
fmt.Printf("Version %s has been started on port %d\n", instanceProfile.Version, instanceProfile.Port)
|
||||
} else {
|
||||
fmt.Printf("Version %s has been started on address '%s' and port %d\n", instanceProfile.Version, instanceProfile.Addr, instanceProfile.Port)
|
||||
}
|
||||
fmt.Printf(`---
|
||||
See more in:
|
||||
👉Website: %s
|
||||
👉GitHub: %s
|
||||
---
|
||||
`, "https://usememos.com", "https://github.com/usememos/memos")
|
||||
}
|
||||
|
||||
func main() {
|
||||
err := Execute()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"memos/server"
|
||||
"memos/server/profile"
|
||||
"memos/store"
|
||||
DB "memos/store/db"
|
||||
)
|
||||
|
||||
const (
|
||||
greetingBanner = `
|
||||
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
|
||||
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
|
||||
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
|
||||
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
|
||||
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
|
||||
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||
`
|
||||
)
|
||||
|
||||
type Main struct {
|
||||
profile *profile.Profile
|
||||
}
|
||||
|
||||
func (m *Main) Run() error {
|
||||
db := DB.NewDB(m.profile)
|
||||
if err := db.Open(); err != nil {
|
||||
return fmt.Errorf("cannot open db: %w", err)
|
||||
}
|
||||
|
||||
s := server.NewServer(m.profile)
|
||||
|
||||
storeInstance := store.New(db.Db, m.profile)
|
||||
s.Store = storeInstance
|
||||
|
||||
if err := s.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
profile := profile.GetProfile()
|
||||
m := Main{
|
||||
profile: profile,
|
||||
}
|
||||
|
||||
println(greetingBanner)
|
||||
fmt.Printf("Version %s has started at :%d\n", profile.Version, profile.Port)
|
||||
|
||||
if err := m.Run(); err != nil {
|
||||
fmt.Printf("error: %+v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package main
|
||||
|
||||
import "memos/bin/server/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Code is the error code.
|
||||
type Code int
|
||||
|
||||
// Application error codes.
|
||||
const (
|
||||
// 0 ~ 99 general error
|
||||
Ok Code = 0
|
||||
Internal Code = 1
|
||||
NotAuthorized Code = 2
|
||||
Invalid Code = 3
|
||||
NotFound Code = 4
|
||||
Conflict Code = 5
|
||||
NotImplemented Code = 6
|
||||
|
||||
// 101 ~ 199 db error
|
||||
DbConnectionFailure Code = 101
|
||||
DbStatementSyntaxError Code = 102
|
||||
DbExecutionError Code = 103
|
||||
)
|
||||
|
||||
// Error represents an application-specific error. Application errors can be
|
||||
// unwrapped by the caller to extract out the code & message.
|
||||
//
|
||||
// Any non-application error (such as a disk error) should be reported as an
|
||||
// Internal error and the human user should only see "Internal error" as the
|
||||
// message. These low-level internal error details should only be logged and
|
||||
// reported to the operator of the application (not the end user).
|
||||
type Error struct {
|
||||
// Machine-readable error code.
|
||||
Code Code
|
||||
|
||||
// Embedded error.
|
||||
Err error
|
||||
}
|
||||
|
||||
// Error implements the error interface. Not used by the application otherwise.
|
||||
func (e *Error) Error() string {
|
||||
return e.Err.Error()
|
||||
}
|
||||
|
||||
// ErrorCode unwraps an application error and returns its code.
|
||||
// Non-application errors always return EINTERNAL.
|
||||
func ErrorCode(err error) Code {
|
||||
var e *Error
|
||||
if err == nil {
|
||||
return Ok
|
||||
} else if errors.As(err, &e) {
|
||||
return e.Code
|
||||
}
|
||||
return Internal
|
||||
}
|
||||
|
||||
// ErrorMessage unwraps an application error and returns its message.
|
||||
// Non-application errors always return "Internal error".
|
||||
func ErrorMessage(err error) string {
|
||||
var e *Error
|
||||
if err == nil {
|
||||
return ""
|
||||
} else if errors.As(err, &e) {
|
||||
return e.Err.Error()
|
||||
}
|
||||
return "Internal error."
|
||||
}
|
||||
|
||||
// Errorf is a helper function to return an Error with a given code and error.
|
||||
func Errorf(code Code, err error) *Error {
|
||||
return &Error{
|
||||
Code: code,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// HasPrefixes returns true if the string s has any of the given prefixes.
|
||||
func HasPrefixes(src string, prefixes ...string) bool {
|
||||
for _, prefix := range prefixes {
|
||||
if strings.HasPrefix(src, prefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func GenUUID() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package common
|
||||
|
||||
// Version is the service current released version.
|
||||
var Version = "0.1.0"
|
||||
3144
docs/apidocs.swagger.yaml
Normal file
3144
docs/apidocs.swagger.yaml
Normal file
File diff suppressed because it is too large
Load Diff
90
docs/development-windows.md
Normal file
90
docs/development-windows.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# Development in Windows
|
||||
|
||||
Memos is built with a curated tech stack. It is optimized for developer experience and is very easy to start working on the code:
|
||||
|
||||
1. It has no external dependency.
|
||||
2. It requires zero config.
|
||||
3. 1 command to start backend and 1 command to start frontend, both with live reload support.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| Frontend | Backend |
|
||||
| ---------------------------------------- | --------------------------------- |
|
||||
| [React](https://react.dev/) | [Go](https://go.dev/) |
|
||||
| [Tailwind CSS](https://tailwindcss.com/) | [SQLite](https://www.sqlite.org/) |
|
||||
| [Vite](https://vitejs.dev/) | |
|
||||
| [pnpm](https://pnpm.io/) | |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Go](https://golang.org/doc/install)
|
||||
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload
|
||||
- [Node.js](https://nodejs.org/)
|
||||
- [pnpm](https://pnpm.io/installation)
|
||||
|
||||
## Steps
|
||||
|
||||
(Using PowerShell)
|
||||
|
||||
1. pull source code
|
||||
|
||||
```powershell
|
||||
git clone https://github.com/usememos/memos
|
||||
# or
|
||||
gh repo clone usememos/memos
|
||||
```
|
||||
|
||||
2. cd into the project root directory
|
||||
|
||||
```powershell
|
||||
cd memos
|
||||
```
|
||||
|
||||
3. start backend using air (with live reload)
|
||||
|
||||
```powershell
|
||||
air -c .\scripts\.air-windows.toml
|
||||
```
|
||||
|
||||
4. start frontend dev server
|
||||
|
||||
```powershell
|
||||
cd web; pnpm i; pnpm dev
|
||||
```
|
||||
|
||||
Memos should now be running at [http://localhost:3001](http://localhost:3001) and changing either frontend or backend code would trigger live reload.
|
||||
|
||||
## Building
|
||||
|
||||
Frontend must be built before backend. The built frontend must be placed in the backend ./server/frontend/dist directory. Otherwise, you will get a "No frontend embedded" error.
|
||||
|
||||
### Frontend
|
||||
|
||||
```powershell
|
||||
Move-Item "./server/frontend/dist" "./server/frontend/dist.bak"
|
||||
cd web; pnpm i --frozen-lockfile; pnpm build; cd ..;
|
||||
Move-Item "./web/dist" "./server/" -Force
|
||||
```
|
||||
|
||||
### Backend
|
||||
|
||||
```powershell
|
||||
go build -o ./build/memos.exe ./bin/memos/main.go
|
||||
```
|
||||
|
||||
## ❕ Notes
|
||||
|
||||
- Start development servers easier by running the provided `start.ps1` script.
|
||||
This will start both backend and frontend in detached PowerShell windows:
|
||||
|
||||
```powershell
|
||||
.\scripts\start.ps1
|
||||
```
|
||||
|
||||
- Produce a local build easier using the provided `build.ps1` script to build both frontend and backend:
|
||||
|
||||
```powershell
|
||||
.\scripts\build.ps1
|
||||
```
|
||||
|
||||
This will produce a memos.exe file in the ./build directory.
|
||||
42
docs/development.md
Normal file
42
docs/development.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Development
|
||||
|
||||
Memos is built with a curated tech stack. It is optimized for developer experience and is very easy to start working on the code:
|
||||
|
||||
1. It has no external dependency.
|
||||
2. It requires zero config.
|
||||
3. 1 command to start backend and 1 command to start frontend, both with live reload support.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Go](https://golang.org/doc/install)
|
||||
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload
|
||||
- [Node.js](https://nodejs.org/)
|
||||
- [pnpm](https://pnpm.io/installation)
|
||||
|
||||
## Steps
|
||||
|
||||
1. Pull the source code
|
||||
|
||||
```bash
|
||||
git clone https://github.com/usememos/memos
|
||||
```
|
||||
|
||||
2. Start backend server with [`air`](https://github.com/cosmtrek/air) (with live reload)
|
||||
|
||||
```bash
|
||||
air -c scripts/.air.toml
|
||||
```
|
||||
|
||||
3. Install frontend dependencies and generate TypeScript code from protobuf
|
||||
|
||||
```
|
||||
cd web && pnpm i
|
||||
```
|
||||
|
||||
4. Start the dev server of frontend
|
||||
|
||||
```bash
|
||||
cd web && pnpm dev
|
||||
```
|
||||
|
||||
Memos should now be running at [http://localhost:3001](http://localhost:3001) and change either frontend or backend code would trigger live reload.
|
||||
126
go.mod
126
go.mod
@@ -1,32 +1,108 @@
|
||||
module memos
|
||||
module github.com/usememos/memos
|
||||
|
||||
go 1.17
|
||||
go 1.22
|
||||
|
||||
require github.com/mattn/go-sqlite3 v1.14.9
|
||||
|
||||
require github.com/google/uuid v1.3.0
|
||||
toolchain go1.22.2
|
||||
|
||||
require (
|
||||
github.com/aws/aws-sdk-go-v2 v1.27.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.16
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.16
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.21
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.54.3
|
||||
github.com/go-sql-driver/mysql v1.8.1
|
||||
github.com/google/cel-go v0.20.1
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/gorilla/feeds v1.1.2
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
|
||||
github.com/improbable-eng/grpc-web v0.15.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/labstack/echo/v4 v4.12.0
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/lithammer/shortuuid/v4 v4.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/spf13/viper v1.18.2
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/yourselfhosted/gomark v0.0.0-20240228170507-6a73bfad2eb6
|
||||
golang.org/x/crypto v0.23.0
|
||||
golang.org/x/mod v0.17.0
|
||||
golang.org/x/net v0.25.0
|
||||
golang.org/x/oauth2 v0.20.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8
|
||||
google.golang.org/grpc v1.64.0
|
||||
modernc.org/sqlite v1.29.10
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||
github.com/rs/cors v1.10.1 // indirect
|
||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/stoewer/go-strcase v1.3.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect
|
||||
modernc.org/libc v1.49.3 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
modernc.org/memory v1.8.0 // indirect
|
||||
modernc.org/strutil v1.2.0 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
nhooyr.io/websocket v1.8.11 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 // indirect
|
||||
github.com/aws/smithy-go v1.20.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
|
||||
github.com/mattn/go-colorable v0.1.11 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/labstack/gommon v0.4.2 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/soheilhy/cmux v0.1.5
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.6.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.1 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63
|
||||
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf // indirect
|
||||
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/gorilla/context v1.1.1 // indirect
|
||||
github.com/labstack/echo/v4 v4.6.3
|
||||
github.com/labstack/gommon v0.3.1 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/gorilla/securecookie v1.1.1
|
||||
github.com/gorilla/sessions v1.2.1
|
||||
github.com/labstack/echo-contrib v0.12.0
|
||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
google.golang.org/protobuf v1.34.1
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
179
internal/cron/cron.go
Normal file
179
internal/cron/cron.go
Normal file
@@ -0,0 +1,179 @@
|
||||
// Package cron implements a crontab-like service to execute and schedule repeative tasks/jobs.
|
||||
package cron
|
||||
|
||||
// Example:
|
||||
//
|
||||
// c := cron.New()
|
||||
// c.MustAdd("dailyReport", "0 0 * * *", func() { ... })
|
||||
// c.Start()
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type job struct {
|
||||
schedule *Schedule
|
||||
run func()
|
||||
}
|
||||
|
||||
// Cron is a crontab-like struct for tasks/jobs scheduling.
|
||||
type Cron struct {
|
||||
sync.RWMutex
|
||||
|
||||
interval time.Duration
|
||||
timezone *time.Location
|
||||
ticker *time.Ticker
|
||||
jobs map[string]*job
|
||||
}
|
||||
|
||||
// New create a new Cron struct with default tick interval of 1 minute
|
||||
// and timezone in UTC.
|
||||
//
|
||||
// You can change the default tick interval with Cron.SetInterval().
|
||||
// You can change the default timezone with Cron.SetTimezone().
|
||||
func New() *Cron {
|
||||
return &Cron{
|
||||
interval: 1 * time.Minute,
|
||||
timezone: time.UTC,
|
||||
jobs: map[string]*job{},
|
||||
}
|
||||
}
|
||||
|
||||
// SetInterval changes the current cron tick interval
|
||||
// (it usually should be >= 1 minute).
|
||||
func (c *Cron) SetInterval(d time.Duration) {
|
||||
// update interval
|
||||
c.Lock()
|
||||
wasStarted := c.ticker != nil
|
||||
c.interval = d
|
||||
c.Unlock()
|
||||
|
||||
// restart the ticker
|
||||
if wasStarted {
|
||||
c.Start()
|
||||
}
|
||||
}
|
||||
|
||||
// SetTimezone changes the current cron tick timezone.
|
||||
func (c *Cron) SetTimezone(l *time.Location) {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
c.timezone = l
|
||||
}
|
||||
|
||||
// MustAdd is similar to Add() but panic on failure.
|
||||
func (c *Cron) MustAdd(jobID string, cronExpr string, run func()) {
|
||||
if err := c.Add(jobID, cronExpr, run); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Add registers a single cron job.
|
||||
//
|
||||
// If there is already a job with the provided id, then the old job
|
||||
// will be replaced with the new one.
|
||||
//
|
||||
// cronExpr is a regular cron expression, eg. "0 */3 * * *" (aka. at minute 0 past every 3rd hour).
|
||||
// Check cron.NewSchedule() for the supported tokens.
|
||||
func (c *Cron) Add(jobID string, cronExpr string, run func()) error {
|
||||
if run == nil {
|
||||
return errors.New("failed to add new cron job: run must be non-nil function")
|
||||
}
|
||||
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
schedule, err := NewSchedule(cronExpr)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to add new cron job")
|
||||
}
|
||||
|
||||
c.jobs[jobID] = &job{
|
||||
schedule: schedule,
|
||||
run: run,
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Remove removes a single cron job by its id.
|
||||
func (c *Cron) Remove(jobID string) {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
delete(c.jobs, jobID)
|
||||
}
|
||||
|
||||
// RemoveAll removes all registered cron jobs.
|
||||
func (c *Cron) RemoveAll() {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
c.jobs = map[string]*job{}
|
||||
}
|
||||
|
||||
// Total returns the current total number of registered cron jobs.
|
||||
func (c *Cron) Total() int {
|
||||
c.RLock()
|
||||
defer c.RUnlock()
|
||||
|
||||
return len(c.jobs)
|
||||
}
|
||||
|
||||
// Stop stops the current cron ticker (if not already).
|
||||
//
|
||||
// You can resume the ticker by calling Start().
|
||||
func (c *Cron) Stop() {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
if c.ticker == nil {
|
||||
return // already stopped
|
||||
}
|
||||
|
||||
c.ticker.Stop()
|
||||
c.ticker = nil
|
||||
}
|
||||
|
||||
// Start starts the cron ticker.
|
||||
//
|
||||
// Calling Start() on already started cron will restart the ticker.
|
||||
func (c *Cron) Start() {
|
||||
c.Stop()
|
||||
|
||||
c.Lock()
|
||||
c.ticker = time.NewTicker(c.interval)
|
||||
c.Unlock()
|
||||
|
||||
go func() {
|
||||
for t := range c.ticker.C {
|
||||
c.runDue(t)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// HasStarted checks whether the current Cron ticker has been started.
|
||||
func (c *Cron) HasStarted() bool {
|
||||
c.RLock()
|
||||
defer c.RUnlock()
|
||||
|
||||
return c.ticker != nil
|
||||
}
|
||||
|
||||
// runDue runs all registered jobs that are scheduled for the provided time.
|
||||
func (c *Cron) runDue(t time.Time) {
|
||||
c.RLock()
|
||||
defer c.RUnlock()
|
||||
|
||||
moment := NewMoment(t.In(c.timezone))
|
||||
|
||||
for _, j := range c.jobs {
|
||||
if j.schedule.IsDue(moment) {
|
||||
go j.run()
|
||||
}
|
||||
}
|
||||
}
|
||||
249
internal/cron/cron_test.go
Normal file
249
internal/cron/cron_test.go
Normal file
@@ -0,0 +1,249 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCronNew(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
expectedInterval := 1 * time.Minute
|
||||
if c.interval != expectedInterval {
|
||||
t.Fatalf("Expected default interval %v, got %v", expectedInterval, c.interval)
|
||||
}
|
||||
|
||||
expectedTimezone := time.UTC
|
||||
if c.timezone.String() != expectedTimezone.String() {
|
||||
t.Fatalf("Expected default timezone %v, got %v", expectedTimezone, c.timezone)
|
||||
}
|
||||
|
||||
if len(c.jobs) != 0 {
|
||||
t.Fatalf("Expected no jobs by default, got \n%v", c.jobs)
|
||||
}
|
||||
|
||||
if c.ticker != nil {
|
||||
t.Fatal("Expected the ticker NOT to be initialized")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronSetInterval(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
interval := 2 * time.Minute
|
||||
|
||||
c.SetInterval(interval)
|
||||
|
||||
if c.interval != interval {
|
||||
t.Fatalf("Expected interval %v, got %v", interval, c.interval)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronSetTimezone(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
timezone, _ := time.LoadLocation("Asia/Tokyo")
|
||||
|
||||
c.SetTimezone(timezone)
|
||||
|
||||
if c.timezone.String() != timezone.String() {
|
||||
t.Fatalf("Expected timezone %v, got %v", timezone, c.timezone)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronAddAndRemove(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
if err := c.Add("test0", "* * * * *", nil); err == nil {
|
||||
t.Fatal("Expected nil function error")
|
||||
}
|
||||
|
||||
if err := c.Add("test1", "invalid", func() {}); err == nil {
|
||||
t.Fatal("Expected invalid cron expression error")
|
||||
}
|
||||
|
||||
if err := c.Add("test2", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := c.Add("test3", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := c.Add("test4", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// overwrite test2
|
||||
if err := c.Add("test2", "1 2 3 4 5", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := c.Add("test5", "1 2 3 4 5", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// mock job deletion
|
||||
c.Remove("test4")
|
||||
|
||||
// try to remove non-existing (should be no-op)
|
||||
c.Remove("missing")
|
||||
|
||||
// check job keys
|
||||
{
|
||||
expectedKeys := []string{"test3", "test2", "test5"}
|
||||
|
||||
if v := len(c.jobs); v != len(expectedKeys) {
|
||||
t.Fatalf("Expected %d jobs, got %d", len(expectedKeys), v)
|
||||
}
|
||||
|
||||
for _, k := range expectedKeys {
|
||||
if c.jobs[k] == nil {
|
||||
t.Fatalf("Expected job with key %s, got nil", k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check the jobs schedule
|
||||
{
|
||||
expectedSchedules := map[string]string{
|
||||
"test2": `{"minutes":{"1":{}},"hours":{"2":{}},"days":{"3":{}},"months":{"4":{}},"daysOfWeek":{"5":{}}}`,
|
||||
"test3": `{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
"test5": `{"minutes":{"1":{}},"hours":{"2":{}},"days":{"3":{}},"months":{"4":{}},"daysOfWeek":{"5":{}}}`,
|
||||
}
|
||||
for k, v := range expectedSchedules {
|
||||
raw, err := json.Marshal(c.jobs[k].schedule)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if string(raw) != v {
|
||||
t.Fatalf("Expected %q schedule \n%s, \ngot \n%s", k, v, raw)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronMustAdd(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
defer func() {
|
||||
if r := recover(); r == nil {
|
||||
t.Errorf("test1 didn't panic")
|
||||
}
|
||||
}()
|
||||
|
||||
c.MustAdd("test1", "* * * * *", nil)
|
||||
|
||||
c.MustAdd("test2", "* * * * *", func() {})
|
||||
|
||||
if _, ok := c.jobs["test2"]; !ok {
|
||||
t.Fatal("Couldn't find job test2")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronRemoveAll(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
if err := c.Add("test1", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := c.Add("test2", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := c.Add("test3", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if v := len(c.jobs); v != 3 {
|
||||
t.Fatalf("Expected %d jobs, got %d", 3, v)
|
||||
}
|
||||
|
||||
c.RemoveAll()
|
||||
|
||||
if v := len(c.jobs); v != 0 {
|
||||
t.Fatalf("Expected %d jobs, got %d", 0, v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronTotal(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
if v := c.Total(); v != 0 {
|
||||
t.Fatalf("Expected 0 jobs, got %v", v)
|
||||
}
|
||||
|
||||
if err := c.Add("test1", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := c.Add("test2", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// overwrite
|
||||
if err := c.Add("test1", "* * * * *", func() {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if v := c.Total(); v != 2 {
|
||||
t.Fatalf("Expected 2 jobs, got %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCronStartStop(t *testing.T) {
|
||||
c := New()
|
||||
|
||||
c.SetInterval(1 * time.Second)
|
||||
|
||||
test1 := 0
|
||||
test2 := 0
|
||||
|
||||
err := c.Add("test1", "* * * * *", func() {
|
||||
test1++
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
err = c.Add("test2", "* * * * *", func() {
|
||||
test2++
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
expectedCalls := 3
|
||||
|
||||
// call twice Start to check if the previous ticker will be reseted
|
||||
c.Start()
|
||||
c.Start()
|
||||
|
||||
time.Sleep(3250 * time.Millisecond)
|
||||
|
||||
// call twice Stop to ensure that the second stop is no-op
|
||||
c.Stop()
|
||||
c.Stop()
|
||||
|
||||
if test1 != expectedCalls {
|
||||
t.Fatalf("Expected %d test1, got %d", expectedCalls, test1)
|
||||
}
|
||||
if test2 != expectedCalls {
|
||||
t.Fatalf("Expected %d test2, got %d", expectedCalls, test2)
|
||||
}
|
||||
|
||||
// resume for ~5 seconds
|
||||
c.Start()
|
||||
time.Sleep(5250 * time.Millisecond)
|
||||
c.Stop()
|
||||
|
||||
expectedCalls += 5
|
||||
|
||||
if test1 != expectedCalls {
|
||||
t.Fatalf("Expected %d test1, got %d", expectedCalls, test1)
|
||||
}
|
||||
if test2 != expectedCalls {
|
||||
t.Fatalf("Expected %d test2, got %d", expectedCalls, test2)
|
||||
}
|
||||
}
|
||||
194
internal/cron/schedule.go
Normal file
194
internal/cron/schedule.go
Normal file
@@ -0,0 +1,194 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Moment represents a parsed single time moment.
|
||||
type Moment struct {
|
||||
Minute int `json:"minute"`
|
||||
Hour int `json:"hour"`
|
||||
Day int `json:"day"`
|
||||
Month int `json:"month"`
|
||||
DayOfWeek int `json:"dayOfWeek"`
|
||||
}
|
||||
|
||||
// NewMoment creates a new Moment from the specified time.
|
||||
func NewMoment(t time.Time) *Moment {
|
||||
return &Moment{
|
||||
Minute: t.Minute(),
|
||||
Hour: t.Hour(),
|
||||
Day: t.Day(),
|
||||
Month: int(t.Month()),
|
||||
DayOfWeek: int(t.Weekday()),
|
||||
}
|
||||
}
|
||||
|
||||
// Schedule stores parsed information for each time component when a cron job should run.
|
||||
type Schedule struct {
|
||||
Minutes map[int]struct{} `json:"minutes"`
|
||||
Hours map[int]struct{} `json:"hours"`
|
||||
Days map[int]struct{} `json:"days"`
|
||||
Months map[int]struct{} `json:"months"`
|
||||
DaysOfWeek map[int]struct{} `json:"daysOfWeek"`
|
||||
}
|
||||
|
||||
// IsDue checks whether the provided Moment satisfies the current Schedule.
|
||||
func (s *Schedule) IsDue(m *Moment) bool {
|
||||
if _, ok := s.Minutes[m.Minute]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, ok := s.Hours[m.Hour]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, ok := s.Days[m.Day]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, ok := s.DaysOfWeek[m.DayOfWeek]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, ok := s.Months[m.Month]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// NewSchedule creates a new Schedule from a cron expression.
|
||||
//
|
||||
// A cron expression is consisted of 5 segments separated by space,
|
||||
// representing: minute, hour, day of the month, month and day of the week.
|
||||
//
|
||||
// Each segment could be in the following formats:
|
||||
// - wildcard: *
|
||||
// - range: 1-30
|
||||
// - step: */n or 1-30/n
|
||||
// - list: 1,2,3,10-20/n
|
||||
func NewSchedule(cronExpr string) (*Schedule, error) {
|
||||
segments := strings.Split(cronExpr, " ")
|
||||
if len(segments) != 5 {
|
||||
return nil, errors.New("invalid cron expression - must have exactly 5 space separated segments")
|
||||
}
|
||||
|
||||
minutes, err := parseCronSegment(segments[0], 0, 59)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
hours, err := parseCronSegment(segments[1], 0, 23)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
days, err := parseCronSegment(segments[2], 1, 31)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
months, err := parseCronSegment(segments[3], 1, 12)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
daysOfWeek, err := parseCronSegment(segments[4], 0, 6)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Schedule{
|
||||
Minutes: minutes,
|
||||
Hours: hours,
|
||||
Days: days,
|
||||
Months: months,
|
||||
DaysOfWeek: daysOfWeek,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// parseCronSegment parses a single cron expression segment and
|
||||
// returns its time schedule slots.
|
||||
func parseCronSegment(segment string, min int, max int) (map[int]struct{}, error) {
|
||||
slots := map[int]struct{}{}
|
||||
|
||||
list := strings.Split(segment, ",")
|
||||
for _, p := range list {
|
||||
stepParts := strings.Split(p, "/")
|
||||
|
||||
// step (*/n, 1-30/n)
|
||||
var step int
|
||||
switch len(stepParts) {
|
||||
case 1:
|
||||
step = 1
|
||||
case 2:
|
||||
parsedStep, err := strconv.Atoi(stepParts[1])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if parsedStep < 1 || parsedStep > max {
|
||||
return nil, errors.Errorf("invalid segment step boundary - the step must be between 1 and the %d", max)
|
||||
}
|
||||
step = parsedStep
|
||||
default:
|
||||
return nil, errors.New("invalid segment step format - must be in the format */n or 1-30/n")
|
||||
}
|
||||
|
||||
// find the min and max range of the segment part
|
||||
var rangeMin, rangeMax int
|
||||
if stepParts[0] == "*" {
|
||||
rangeMin = min
|
||||
rangeMax = max
|
||||
} else {
|
||||
// single digit (1) or range (1-30)
|
||||
rangeParts := strings.Split(stepParts[0], "-")
|
||||
switch len(rangeParts) {
|
||||
case 1:
|
||||
if step != 1 {
|
||||
return nil, errors.New("invalid segment step - step > 1 could be used only with the wildcard or range format")
|
||||
}
|
||||
parsed, err := strconv.Atoi(rangeParts[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if parsed < min || parsed > max {
|
||||
return nil, errors.New("invalid segment value - must be between the min and max of the segment")
|
||||
}
|
||||
rangeMin = parsed
|
||||
rangeMax = rangeMin
|
||||
case 2:
|
||||
parsedMin, err := strconv.Atoi(rangeParts[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if parsedMin < min || parsedMin > max {
|
||||
return nil, errors.Errorf("invalid segment range minimum - must be between %d and %d", min, max)
|
||||
}
|
||||
rangeMin = parsedMin
|
||||
|
||||
parsedMax, err := strconv.Atoi(rangeParts[1])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if parsedMax < parsedMin || parsedMax > max {
|
||||
return nil, errors.Errorf("invalid segment range maximum - must be between %d and %d", rangeMin, max)
|
||||
}
|
||||
rangeMax = parsedMax
|
||||
default:
|
||||
return nil, errors.New("invalid segment range format - the range must have 1 or 2 parts")
|
||||
}
|
||||
}
|
||||
|
||||
// fill the slots
|
||||
for i := rangeMin; i <= rangeMax; i += step {
|
||||
slots[i] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
return slots, nil
|
||||
}
|
||||
361
internal/cron/schedule_test.go
Normal file
361
internal/cron/schedule_test.go
Normal file
@@ -0,0 +1,361 @@
|
||||
package cron_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/usememos/memos/internal/cron"
|
||||
)
|
||||
|
||||
func TestNewMoment(t *testing.T) {
|
||||
date, err := time.Parse("2006-01-02 15:04", "2023-05-09 15:20")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
m := cron.NewMoment(date)
|
||||
|
||||
if m.Minute != 20 {
|
||||
t.Fatalf("Expected m.Minute %d, got %d", 20, m.Minute)
|
||||
}
|
||||
|
||||
if m.Hour != 15 {
|
||||
t.Fatalf("Expected m.Hour %d, got %d", 15, m.Hour)
|
||||
}
|
||||
|
||||
if m.Day != 9 {
|
||||
t.Fatalf("Expected m.Day %d, got %d", 9, m.Day)
|
||||
}
|
||||
|
||||
if m.Month != 5 {
|
||||
t.Fatalf("Expected m.Month %d, got %d", 5, m.Month)
|
||||
}
|
||||
|
||||
if m.DayOfWeek != 2 {
|
||||
t.Fatalf("Expected m.DayOfWeek %d, got %d", 2, m.DayOfWeek)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewSchedule(t *testing.T) {
|
||||
scenarios := []struct {
|
||||
cronExpr string
|
||||
expectError bool
|
||||
expectSchedule string
|
||||
}{
|
||||
{
|
||||
"invalid",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"2/3 * * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"*/2 */3 */5 */4 */2",
|
||||
false,
|
||||
`{"minutes":{"0":{},"10":{},"12":{},"14":{},"16":{},"18":{},"2":{},"20":{},"22":{},"24":{},"26":{},"28":{},"30":{},"32":{},"34":{},"36":{},"38":{},"4":{},"40":{},"42":{},"44":{},"46":{},"48":{},"50":{},"52":{},"54":{},"56":{},"58":{},"6":{},"8":{}},"hours":{"0":{},"12":{},"15":{},"18":{},"21":{},"3":{},"6":{},"9":{}},"days":{"1":{},"11":{},"16":{},"21":{},"26":{},"31":{},"6":{}},"months":{"1":{},"5":{},"9":{}},"daysOfWeek":{"0":{},"2":{},"4":{},"6":{}}}`,
|
||||
},
|
||||
|
||||
// minute segment
|
||||
{
|
||||
"-1 * * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"60 * * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"0 * * * *",
|
||||
false,
|
||||
`{"minutes":{"0":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"59 * * * *",
|
||||
false,
|
||||
`{"minutes":{"59":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"1,2,5,7,40-50/2 * * * *",
|
||||
false,
|
||||
`{"minutes":{"1":{},"2":{},"40":{},"42":{},"44":{},"46":{},"48":{},"5":{},"50":{},"7":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
|
||||
// hour segment
|
||||
{
|
||||
"* -1 * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* 24 * * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* 0 * * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* 23 * * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"23":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* 3,4,8-16/3,7 * * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"11":{},"14":{},"3":{},"4":{},"7":{},"8":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
|
||||
// day segment
|
||||
{
|
||||
"* * 0 * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * 32 * *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * 1 * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* * 31 * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"31":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* * 5,6,20-30/3,1 * *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"20":{},"23":{},"26":{},"29":{},"5":{},"6":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
|
||||
// month segment
|
||||
{
|
||||
"* * * 0 *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * 13 *",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * 1 *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* * * 12 *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"12":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* * * 1,4,5-10/2 *",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"4":{},"5":{},"7":{},"9":{}},"daysOfWeek":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}}}`,
|
||||
},
|
||||
|
||||
// day of week segment
|
||||
{
|
||||
"* * * * -1",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * * 7",
|
||||
true,
|
||||
"",
|
||||
},
|
||||
{
|
||||
"* * * * 0",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"0":{}}}`,
|
||||
},
|
||||
{
|
||||
"* * * * 6",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"6":{}}}`,
|
||||
},
|
||||
{
|
||||
"* * * * 1,2-5/2",
|
||||
false,
|
||||
`{"minutes":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"4":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"5":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"6":{},"7":{},"8":{},"9":{}},"hours":{"0":{},"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"days":{"1":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"2":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"3":{},"30":{},"31":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"months":{"1":{},"10":{},"11":{},"12":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{}},"daysOfWeek":{"1":{},"2":{},"4":{}}}`,
|
||||
},
|
||||
}
|
||||
|
||||
for _, s := range scenarios {
|
||||
schedule, err := cron.NewSchedule(s.cronExpr)
|
||||
|
||||
hasErr := err != nil
|
||||
if hasErr != s.expectError {
|
||||
t.Fatalf("[%s] Expected hasErr to be %v, got %v (%v)", s.cronExpr, s.expectError, hasErr, err)
|
||||
}
|
||||
|
||||
if hasErr {
|
||||
continue
|
||||
}
|
||||
|
||||
encoded, err := json.Marshal(schedule)
|
||||
if err != nil {
|
||||
t.Fatalf("[%s] Failed to marshalize the result schedule: %v", s.cronExpr, err)
|
||||
}
|
||||
encodedStr := string(encoded)
|
||||
|
||||
if encodedStr != s.expectSchedule {
|
||||
t.Fatalf("[%s] Expected \n%s, \ngot \n%s", s.cronExpr, s.expectSchedule, encodedStr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestScheduleIsDue(t *testing.T) {
|
||||
scenarios := []struct {
|
||||
cronExpr string
|
||||
moment *cron.Moment
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
"* * * * *",
|
||||
&cron.Moment{},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"* * * * *",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 1,
|
||||
Day: 1,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"5 * * * *",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 1,
|
||||
Day: 1,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"5 * * * *",
|
||||
&cron.Moment{
|
||||
Minute: 5,
|
||||
Hour: 1,
|
||||
Day: 1,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"* 2-6 * * 2,3",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 2,
|
||||
Day: 1,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"* 2-6 * * 2,3",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 2,
|
||||
Day: 1,
|
||||
Month: 1,
|
||||
DayOfWeek: 3,
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"* * 1,2,5,15-18 * *",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 1,
|
||||
Day: 6,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"* * 1,2,5,15-18/2 * *",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 1,
|
||||
Day: 2,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"* * 1,2,5,15-18/2 * *",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 1,
|
||||
Day: 18,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"* * 1,2,5,15-18/2 * *",
|
||||
&cron.Moment{
|
||||
Minute: 1,
|
||||
Hour: 1,
|
||||
Day: 17,
|
||||
Month: 1,
|
||||
DayOfWeek: 1,
|
||||
},
|
||||
true,
|
||||
},
|
||||
}
|
||||
|
||||
for i, s := range scenarios {
|
||||
schedule, err := cron.NewSchedule(s.cronExpr)
|
||||
if err != nil {
|
||||
t.Fatalf("[%d-%s] Unexpected cron error: %v", i, s.cronExpr, err)
|
||||
}
|
||||
|
||||
result := schedule.IsDue(s.moment)
|
||||
|
||||
if result != s.expected {
|
||||
t.Fatalf("[%d-%s] Expected %v, got %v", i, s.cronExpr, s.expected, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
7
internal/util/resource_name.go
Normal file
7
internal/util/resource_name.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package util
|
||||
|
||||
import "regexp"
|
||||
|
||||
var (
|
||||
UIDMatcher = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9-]{1,30}[a-zA-Z0-9])$")
|
||||
)
|
||||
73
internal/util/util.go
Normal file
73
internal/util/util.go
Normal file
@@ -0,0 +1,73 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"math/big"
|
||||
"net/mail"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// ConvertStringToInt32 converts a string to int32.
|
||||
func ConvertStringToInt32(src string) (int32, error) {
|
||||
parsed, err := strconv.ParseInt(src, 10, 32)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int32(parsed), nil
|
||||
}
|
||||
|
||||
// HasPrefixes returns true if the string s has any of the given prefixes.
|
||||
func HasPrefixes(src string, prefixes ...string) bool {
|
||||
for _, prefix := range prefixes {
|
||||
if strings.HasPrefix(src, prefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ValidateEmail validates the email.
|
||||
func ValidateEmail(email string) bool {
|
||||
if _, err := mail.ParseAddress(email); err != nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func GenUUID() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
|
||||
var letters = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
|
||||
// RandomString returns a random string with length n.
|
||||
func RandomString(n int) (string, error) {
|
||||
var sb strings.Builder
|
||||
sb.Grow(n)
|
||||
for i := 0; i < n; i++ {
|
||||
// The reason for using crypto/rand instead of math/rand is that
|
||||
// the former relies on hardware to generate random numbers and
|
||||
// thus has a stronger source of random numbers.
|
||||
randNum, err := rand.Int(rand.Reader, big.NewInt(int64(len(letters))))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if _, err := sb.WriteRune(letters[randNum.Uint64()]); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return sb.String(), nil
|
||||
}
|
||||
|
||||
// ReplaceString replaces all occurrences of old in slice with new.
|
||||
func ReplaceString(slice []string, old, new string) []string {
|
||||
for i, s := range slice {
|
||||
if s == old {
|
||||
slice[i] = new
|
||||
}
|
||||
}
|
||||
return slice
|
||||
}
|
||||
31
internal/util/util_test.go
Normal file
31
internal/util/util_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestValidateEmail(t *testing.T) {
|
||||
tests := []struct {
|
||||
email string
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
email: "t@gmail.com",
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
email: "@qq.com",
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
email: "1@gmail",
|
||||
want: true,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
result := ValidateEmail(test.email)
|
||||
if result != test.want {
|
||||
t.Errorf("Validate Email %s: got result %v, want %v.", test.email, result, test.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
98
plugin/httpgetter/html_meta.go
Normal file
98
plugin/httpgetter/html_meta.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package httpgetter
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
"golang.org/x/net/html/atom"
|
||||
)
|
||||
|
||||
type HTMLMeta struct {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Image string `json:"image"`
|
||||
}
|
||||
|
||||
func GetHTMLMeta(urlStr string) (*HTMLMeta, error) {
|
||||
if _, err := url.Parse(urlStr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response, err := http.Get(urlStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
mediatype, err := getMediatype(response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if mediatype != "text/html" {
|
||||
return nil, errors.New("not a HTML page")
|
||||
}
|
||||
|
||||
htmlMeta := extractHTMLMeta(response.Body)
|
||||
return htmlMeta, nil
|
||||
}
|
||||
|
||||
func extractHTMLMeta(resp io.Reader) *HTMLMeta {
|
||||
tokenizer := html.NewTokenizer(resp)
|
||||
htmlMeta := new(HTMLMeta)
|
||||
|
||||
for {
|
||||
tokenType := tokenizer.Next()
|
||||
if tokenType == html.ErrorToken {
|
||||
break
|
||||
} else if tokenType == html.StartTagToken || tokenType == html.SelfClosingTagToken {
|
||||
token := tokenizer.Token()
|
||||
if token.DataAtom == atom.Body {
|
||||
break
|
||||
}
|
||||
|
||||
if token.DataAtom == atom.Title {
|
||||
tokenizer.Next()
|
||||
token := tokenizer.Token()
|
||||
htmlMeta.Title = token.Data
|
||||
} else if token.DataAtom == atom.Meta {
|
||||
description, ok := extractMetaProperty(token, "description")
|
||||
if ok {
|
||||
htmlMeta.Description = description
|
||||
}
|
||||
|
||||
ogTitle, ok := extractMetaProperty(token, "og:title")
|
||||
if ok {
|
||||
htmlMeta.Title = ogTitle
|
||||
}
|
||||
|
||||
ogDescription, ok := extractMetaProperty(token, "og:description")
|
||||
if ok {
|
||||
htmlMeta.Description = ogDescription
|
||||
}
|
||||
|
||||
ogImage, ok := extractMetaProperty(token, "og:image")
|
||||
if ok {
|
||||
htmlMeta.Image = ogImage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return htmlMeta
|
||||
}
|
||||
|
||||
func extractMetaProperty(token html.Token, prop string) (content string, ok bool) {
|
||||
content, ok = "", false
|
||||
for _, attr := range token.Attr {
|
||||
if attr.Key == "property" && attr.Val == prop {
|
||||
ok = true
|
||||
}
|
||||
if attr.Key == "content" {
|
||||
content = attr.Val
|
||||
}
|
||||
}
|
||||
return content, ok
|
||||
}
|
||||
19
plugin/httpgetter/html_meta_test.go
Normal file
19
plugin/httpgetter/html_meta_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package httpgetter
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetHTMLMeta(t *testing.T) {
|
||||
tests := []struct {
|
||||
urlStr string
|
||||
htmlMeta HTMLMeta
|
||||
}{}
|
||||
for _, test := range tests {
|
||||
metadata, err := GetHTMLMeta(test.urlStr)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, test.htmlMeta, *metadata)
|
||||
}
|
||||
}
|
||||
4
plugin/httpgetter/http_getter.go
Normal file
4
plugin/httpgetter/http_getter.go
Normal file
@@ -0,0 +1,4 @@
|
||||
// Package httpgetter is using to get resources from url.
|
||||
// * Get metadata for website;
|
||||
// * Get image blob to avoid CORS;
|
||||
package httpgetter
|
||||
45
plugin/httpgetter/image.go
Normal file
45
plugin/httpgetter/image.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package httpgetter
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Image struct {
|
||||
Blob []byte
|
||||
Mediatype string
|
||||
}
|
||||
|
||||
func GetImage(urlStr string) (*Image, error) {
|
||||
if _, err := url.Parse(urlStr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response, err := http.Get(urlStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
mediatype, err := getMediatype(response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !strings.HasPrefix(mediatype, "image/") {
|
||||
return nil, errors.New("Wrong image mediatype")
|
||||
}
|
||||
|
||||
bodyBytes, err := io.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
image := &Image{
|
||||
Blob: bodyBytes,
|
||||
Mediatype: mediatype,
|
||||
}
|
||||
return image, nil
|
||||
}
|
||||
15
plugin/httpgetter/util.go
Normal file
15
plugin/httpgetter/util.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package httpgetter
|
||||
|
||||
import (
|
||||
"mime"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func getMediatype(response *http.Response) (string, error) {
|
||||
contentType := response.Header.Get("content-type")
|
||||
mediatype, _, err := mime.ParseMediaType(contentType)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return mediatype, nil
|
||||
}
|
||||
7
plugin/idp/idp.go
Normal file
7
plugin/idp/idp.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package idp
|
||||
|
||||
type IdentityProviderUserInfo struct {
|
||||
Identifier string
|
||||
DisplayName string
|
||||
Email string
|
||||
}
|
||||
117
plugin/idp/oauth2/oauth2.go
Normal file
117
plugin/idp/oauth2/oauth2.go
Normal file
@@ -0,0 +1,117 @@
|
||||
// Package oauth2 is the plugin for OAuth2 Identity Provider.
|
||||
package oauth2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
"github.com/usememos/memos/plugin/idp"
|
||||
storepb "github.com/usememos/memos/proto/gen/store"
|
||||
)
|
||||
|
||||
// IdentityProvider represents an OAuth2 Identity Provider.
|
||||
type IdentityProvider struct {
|
||||
config *storepb.OAuth2Config
|
||||
}
|
||||
|
||||
// NewIdentityProvider initializes a new OAuth2 Identity Provider with the given configuration.
|
||||
func NewIdentityProvider(config *storepb.OAuth2Config) (*IdentityProvider, error) {
|
||||
for v, field := range map[string]string{
|
||||
config.ClientId: "clientId",
|
||||
config.ClientSecret: "clientSecret",
|
||||
config.TokenUrl: "tokenUrl",
|
||||
config.UserInfoUrl: "userInfoUrl",
|
||||
config.FieldMapping.Identifier: "fieldMapping.identifier",
|
||||
} {
|
||||
if v == "" {
|
||||
return nil, errors.Errorf(`the field "%s" is empty but required`, field)
|
||||
}
|
||||
}
|
||||
|
||||
return &IdentityProvider{
|
||||
config: config,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ExchangeToken returns the exchanged OAuth2 token using the given authorization code.
|
||||
func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code string) (string, error) {
|
||||
conf := &oauth2.Config{
|
||||
ClientID: p.config.ClientId,
|
||||
ClientSecret: p.config.ClientSecret,
|
||||
RedirectURL: redirectURL,
|
||||
Scopes: p.config.Scopes,
|
||||
Endpoint: oauth2.Endpoint{
|
||||
AuthURL: p.config.AuthUrl,
|
||||
TokenURL: p.config.TokenUrl,
|
||||
AuthStyle: oauth2.AuthStyleInParams,
|
||||
},
|
||||
}
|
||||
|
||||
token, err := conf.Exchange(ctx, code)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to exchange access token")
|
||||
}
|
||||
|
||||
accessToken, ok := token.Extra("access_token").(string)
|
||||
if !ok {
|
||||
return "", errors.New(`missing "access_token" from authorization response`)
|
||||
}
|
||||
|
||||
return accessToken, nil
|
||||
}
|
||||
|
||||
// UserInfo returns the parsed user information using the given OAuth2 token.
|
||||
func (p *IdentityProvider) UserInfo(token string) (*idp.IdentityProviderUserInfo, error) {
|
||||
client := &http.Client{}
|
||||
req, err := http.NewRequest(http.MethodGet, p.config.UserInfoUrl, nil)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to new http request")
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get user information")
|
||||
}
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to read response body")
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
var claims map[string]any
|
||||
err = json.Unmarshal(body, &claims)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal response body")
|
||||
}
|
||||
|
||||
userInfo := &idp.IdentityProviderUserInfo{}
|
||||
if v, ok := claims[p.config.FieldMapping.Identifier].(string); ok {
|
||||
userInfo.Identifier = v
|
||||
}
|
||||
if userInfo.Identifier == "" {
|
||||
return nil, errors.Errorf("the field %q is not found in claims or has empty value", p.config.FieldMapping.Identifier)
|
||||
}
|
||||
|
||||
// Best effort to map optional fields
|
||||
if p.config.FieldMapping.DisplayName != "" {
|
||||
if v, ok := claims[p.config.FieldMapping.DisplayName].(string); ok {
|
||||
userInfo.DisplayName = v
|
||||
}
|
||||
}
|
||||
if userInfo.DisplayName == "" {
|
||||
userInfo.DisplayName = userInfo.Identifier
|
||||
}
|
||||
if p.config.FieldMapping.Email != "" {
|
||||
if v, ok := claims[p.config.FieldMapping.Email].(string); ok {
|
||||
userInfo.Email = v
|
||||
}
|
||||
}
|
||||
return userInfo, nil
|
||||
}
|
||||
163
plugin/idp/oauth2/oauth2_test.go
Normal file
163
plugin/idp/oauth2/oauth2_test.go
Normal file
@@ -0,0 +1,163 @@
|
||||
package oauth2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/usememos/memos/plugin/idp"
|
||||
storepb "github.com/usememos/memos/proto/gen/store"
|
||||
)
|
||||
|
||||
func TestNewIdentityProvider(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
config *storepb.OAuth2Config
|
||||
containsErr string
|
||||
}{
|
||||
{
|
||||
name: "no tokenUrl",
|
||||
config: &storepb.OAuth2Config{
|
||||
ClientId: "test-client-id",
|
||||
ClientSecret: "test-client-secret",
|
||||
AuthUrl: "",
|
||||
TokenUrl: "",
|
||||
UserInfoUrl: "https://example.com/api/user",
|
||||
FieldMapping: &storepb.FieldMapping{
|
||||
Identifier: "login",
|
||||
},
|
||||
},
|
||||
containsErr: `the field "tokenUrl" is empty but required`,
|
||||
},
|
||||
{
|
||||
name: "no userInfoUrl",
|
||||
config: &storepb.OAuth2Config{
|
||||
ClientId: "test-client-id",
|
||||
ClientSecret: "test-client-secret",
|
||||
AuthUrl: "",
|
||||
TokenUrl: "https://example.com/token",
|
||||
UserInfoUrl: "",
|
||||
FieldMapping: &storepb.FieldMapping{
|
||||
Identifier: "login",
|
||||
},
|
||||
},
|
||||
containsErr: `the field "userInfoUrl" is empty but required`,
|
||||
},
|
||||
{
|
||||
name: "no field mapping identifier",
|
||||
config: &storepb.OAuth2Config{
|
||||
ClientId: "test-client-id",
|
||||
ClientSecret: "test-client-secret",
|
||||
AuthUrl: "",
|
||||
TokenUrl: "https://example.com/token",
|
||||
UserInfoUrl: "https://example.com/api/user",
|
||||
FieldMapping: &storepb.FieldMapping{
|
||||
Identifier: "",
|
||||
},
|
||||
},
|
||||
containsErr: `the field "fieldMapping.identifier" is empty but required`,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
_, err := NewIdentityProvider(test.config)
|
||||
assert.ErrorContains(t, err, test.containsErr)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func newMockServer(t *testing.T, code, accessToken string, userinfo []byte) *httptest.Server {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
var rawIDToken string
|
||||
mux.HandleFunc("/oauth2/token", func(w http.ResponseWriter, r *http.Request) {
|
||||
require.Equal(t, http.MethodPost, r.Method)
|
||||
|
||||
body, err := io.ReadAll(r.Body)
|
||||
require.NoError(t, err)
|
||||
vals, err := url.ParseQuery(string(body))
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, code, vals.Get("code"))
|
||||
require.Equal(t, "authorization_code", vals.Get("grant_type"))
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
err = json.NewEncoder(w).Encode(map[string]any{
|
||||
"access_token": accessToken,
|
||||
"token_type": "Bearer",
|
||||
"expires_in": 3600,
|
||||
"id_token": rawIDToken,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
})
|
||||
mux.HandleFunc("/oauth2/userinfo", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, err := w.Write(userinfo)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
s := httptest.NewServer(mux)
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func TestIdentityProvider(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
const (
|
||||
testClientID = "test-client-id"
|
||||
testCode = "test-code"
|
||||
testAccessToken = "test-access-token"
|
||||
testSubject = "123456789"
|
||||
testName = "John Doe"
|
||||
testEmail = "john.doe@example.com"
|
||||
)
|
||||
userInfo, err := json.Marshal(
|
||||
map[string]any{
|
||||
"sub": testSubject,
|
||||
"name": testName,
|
||||
"email": testEmail,
|
||||
},
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
s := newMockServer(t, testCode, testAccessToken, userInfo)
|
||||
|
||||
oauth2, err := NewIdentityProvider(
|
||||
&storepb.OAuth2Config{
|
||||
ClientId: testClientID,
|
||||
ClientSecret: "test-client-secret",
|
||||
TokenUrl: fmt.Sprintf("%s/oauth2/token", s.URL),
|
||||
UserInfoUrl: fmt.Sprintf("%s/oauth2/userinfo", s.URL),
|
||||
FieldMapping: &storepb.FieldMapping{
|
||||
Identifier: "sub",
|
||||
DisplayName: "name",
|
||||
Email: "email",
|
||||
},
|
||||
},
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
redirectURL := "https://example.com/oauth/callback"
|
||||
oauthToken, err := oauth2.ExchangeToken(ctx, redirectURL, testCode)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, testAccessToken, oauthToken)
|
||||
|
||||
userInfoResult, err := oauth2.UserInfo(oauthToken)
|
||||
require.NoError(t, err)
|
||||
|
||||
wantUserInfo := &idp.IdentityProviderUserInfo{
|
||||
Identifier: testSubject,
|
||||
DisplayName: testName,
|
||||
Email: testEmail,
|
||||
}
|
||||
assert.Equal(t, wantUserInfo, userInfoResult)
|
||||
}
|
||||
93
plugin/storage/s3/s3.go
Normal file
93
plugin/storage/s3/s3.go
Normal file
@@ -0,0 +1,93 @@
|
||||
package s3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/credentials"
|
||||
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
storepb "github.com/usememos/memos/proto/gen/store"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
Client *s3.Client
|
||||
Bucket *string
|
||||
}
|
||||
|
||||
func NewClient(ctx context.Context, s3Config *storepb.StorageS3Config) (*Client, error) {
|
||||
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) {
|
||||
return aws.Endpoint{
|
||||
URL: s3Config.Endpoint,
|
||||
}, nil
|
||||
})
|
||||
cfg, err := config.LoadDefaultConfig(ctx,
|
||||
config.WithEndpointResolverWithOptions(resolver),
|
||||
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(s3Config.AccessKeyId, s3Config.AccessKeySecret, "")),
|
||||
config.WithRegion(s3Config.Region),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to load s3 config")
|
||||
}
|
||||
|
||||
client := s3.NewFromConfig(cfg)
|
||||
return &Client{
|
||||
Client: client,
|
||||
Bucket: aws.String(s3Config.Bucket),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UploadObject uploads an object to S3.
|
||||
func (c *Client) UploadObject(ctx context.Context, key string, fileType string, content io.Reader) (string, error) {
|
||||
uploader := manager.NewUploader(c.Client)
|
||||
putInput := s3.PutObjectInput{
|
||||
Bucket: c.Bucket,
|
||||
Key: aws.String(key),
|
||||
ContentType: aws.String(fileType),
|
||||
Body: content,
|
||||
}
|
||||
result, err := uploader.Upload(ctx, &putInput)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
resultKey := result.Key
|
||||
if resultKey == nil || *resultKey == "" {
|
||||
return "", errors.New("failed to get file key")
|
||||
}
|
||||
return *resultKey, nil
|
||||
}
|
||||
|
||||
// PresignGetObject presigns an object in S3.
|
||||
func (c *Client) PresignGetObject(ctx context.Context, key string) (string, error) {
|
||||
presignClient := s3.NewPresignClient(c.Client)
|
||||
presignResult, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
||||
Bucket: aws.String(*c.Bucket),
|
||||
Key: aws.String(key),
|
||||
}, func(opts *s3.PresignOptions) {
|
||||
// Set the expiration time of the presigned URL to 5 days.
|
||||
// Reference: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
|
||||
opts.Expires = time.Duration(5 * 24 * time.Hour)
|
||||
})
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to presign put object")
|
||||
}
|
||||
return presignResult.URL, nil
|
||||
}
|
||||
|
||||
// DeleteObject deletes an object in S3.
|
||||
func (c *Client) DeleteObject(ctx context.Context, key string) error {
|
||||
_, err := c.Client.DeleteObject(ctx, &s3.DeleteObjectInput{
|
||||
Bucket: c.Bucket,
|
||||
Key: aws.String(key),
|
||||
})
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to delete object")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
88
plugin/webhook/webhook.go
Normal file
88
plugin/webhook/webhook.go
Normal file
@@ -0,0 +1,88 @@
|
||||
package webhook
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
// timeout is the timeout for webhook request. Default to 30 seconds.
|
||||
timeout = 30 * time.Second
|
||||
)
|
||||
|
||||
type Memo struct {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
// id is the system generated id.
|
||||
Name string
|
||||
// The name of the creator.
|
||||
// Format: users/{id}
|
||||
Creator string
|
||||
// The raw content.
|
||||
Content string
|
||||
}
|
||||
|
||||
// WebhookPayload is the payload of webhook request.
|
||||
// nolint
|
||||
type WebhookPayload struct {
|
||||
URL string `json:"url"`
|
||||
ActivityType string `json:"activityType"`
|
||||
CreatorID int32 `json:"creatorId"`
|
||||
CreatedTs int64 `json:"createdTs"`
|
||||
Memo *Memo `json:"memo"`
|
||||
}
|
||||
|
||||
// WebhookResponse is the response of webhook request.
|
||||
// nolint
|
||||
type WebhookResponse struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// Post posts the message to webhook endpoint.
|
||||
func Post(payload WebhookPayload) error {
|
||||
body, err := json.Marshal(&payload)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to marshal webhook request to %s", payload.URL)
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", payload.URL, bytes.NewBuffer(body))
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to construct webhook request to %s", payload.URL)
|
||||
}
|
||||
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
client := &http.Client{
|
||||
Timeout: timeout,
|
||||
}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to post webhook to %s", payload.URL)
|
||||
}
|
||||
|
||||
b, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to read webhook response from %s", payload.URL)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||
return errors.Errorf("failed to post webhook %s, status code: %d, response body: %s", payload.URL, resp.StatusCode, b)
|
||||
}
|
||||
|
||||
response := &WebhookResponse{}
|
||||
if err := json.Unmarshal(b, response); err != nil {
|
||||
return errors.Wrapf(err, "failed to unmarshal webhook response from %s", payload.URL)
|
||||
}
|
||||
|
||||
if response.Code != 0 {
|
||||
return errors.Errorf("receive error code sent by webhook server, code %d, msg: %s", response.Code, response.Message)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
1
plugin/webhook/webhook_test.go
Normal file
1
plugin/webhook/webhook_test.go
Normal file
@@ -0,0 +1 @@
|
||||
package webhook
|
||||
17
proto/README.md
Normal file
17
proto/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Guide
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [buf](https://docs.buf.build/installation)
|
||||
|
||||
## Generate
|
||||
|
||||
```sh
|
||||
buf generate
|
||||
```
|
||||
|
||||
## Format
|
||||
|
||||
```sh
|
||||
buf format -w
|
||||
```
|
||||
56
proto/api/v1/activity_service.proto
Normal file
56
proto/api/v1/activity_service.proto
Normal file
@@ -0,0 +1,56 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service ActivityService {
|
||||
// GetActivity returns the activity with the given id.
|
||||
rpc GetActivity(GetActivityRequest) returns (Activity) {
|
||||
option (google.api.http) = {get: "/api/v1/activities/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
||||
|
||||
message Activity {
|
||||
// The system-generated unique identifier for the activity.
|
||||
int32 id = 1;
|
||||
// The system-generated unique identifier for the user who created the activity.
|
||||
int32 creator_id = 2;
|
||||
// The type of the activity.
|
||||
string type = 3;
|
||||
// The level of the activity.
|
||||
string level = 4;
|
||||
// The create time of the activity.
|
||||
google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
// The payload of the activity.
|
||||
ActivityPayload payload = 6;
|
||||
}
|
||||
|
||||
// ActivityMemoCommentPayload represents the payload of a memo comment activity.
|
||||
message ActivityMemoCommentPayload {
|
||||
// The memo id of comment.
|
||||
int32 memo_id = 1;
|
||||
// The memo id of related memo.
|
||||
int32 related_memo_id = 2;
|
||||
}
|
||||
|
||||
message ActivityVersionUpdatePayload {
|
||||
// The updated version of memos.
|
||||
string version = 1;
|
||||
}
|
||||
|
||||
message ActivityPayload {
|
||||
ActivityMemoCommentPayload memo_comment = 1;
|
||||
ActivityVersionUpdatePayload version_update = 2;
|
||||
}
|
||||
|
||||
message GetActivityRequest {
|
||||
// The system-generated unique identifier for the activity.
|
||||
int32 id = 1;
|
||||
}
|
||||
65
proto/api/v1/auth_service.proto
Normal file
65
proto/api/v1/auth_service.proto
Normal file
@@ -0,0 +1,65 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v1/user_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service AuthService {
|
||||
// GetAuthStatus returns the current auth status of the user.
|
||||
rpc GetAuthStatus(GetAuthStatusRequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v1/auth/status"};
|
||||
}
|
||||
// SignIn signs in the user with the given username and password.
|
||||
rpc SignIn(SignInRequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v1/auth/signin"};
|
||||
}
|
||||
// SignInWithSSO signs in the user with the given SSO code.
|
||||
rpc SignInWithSSO(SignInWithSSORequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v1/auth/signin/sso"};
|
||||
}
|
||||
// SignUp signs up the user with the given username and password.
|
||||
rpc SignUp(SignUpRequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v1/auth/signup"};
|
||||
}
|
||||
// SignOut signs out the user.
|
||||
rpc SignOut(SignOutRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {post: "/api/v1/auth/signout"};
|
||||
}
|
||||
}
|
||||
|
||||
message GetAuthStatusRequest {}
|
||||
|
||||
message GetAuthStatusResponse {
|
||||
User user = 1;
|
||||
}
|
||||
|
||||
message SignInRequest {
|
||||
// The username to sign in with.
|
||||
string username = 1;
|
||||
// The password to sign in with.
|
||||
string password = 2;
|
||||
// Whether the session should never expire.
|
||||
bool never_expire = 3;
|
||||
}
|
||||
|
||||
message SignInWithSSORequest {
|
||||
// The ID of the SSO provider.
|
||||
int32 idp_id = 1;
|
||||
// The code to sign in with.
|
||||
string code = 2;
|
||||
// The redirect URI.
|
||||
string redirect_uri = 3;
|
||||
}
|
||||
|
||||
message SignUpRequest {
|
||||
// The username to sign up with.
|
||||
string username = 1;
|
||||
// The password to sign up with.
|
||||
string password = 2;
|
||||
}
|
||||
|
||||
message SignOutRequest {}
|
||||
17
proto/api/v1/common.proto
Normal file
17
proto/api/v1/common.proto
Normal file
@@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
enum RowStatus {
|
||||
ROW_STATUS_UNSPECIFIED = 0;
|
||||
ACTIVE = 1;
|
||||
ARCHIVED = 2;
|
||||
}
|
||||
|
||||
// Used internally for obfuscating the page token.
|
||||
message PageToken {
|
||||
int32 limit = 1;
|
||||
int32 offset = 2;
|
||||
}
|
||||
114
proto/api/v1/idp_service.proto
Normal file
114
proto/api/v1/idp_service.proto
Normal file
@@ -0,0 +1,114 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service IdentityProviderService {
|
||||
// ListIdentityProviders lists identity providers.
|
||||
rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/identityProviders"};
|
||||
}
|
||||
// GetIdentityProvider gets an identity provider.
|
||||
rpc GetIdentityProvider(GetIdentityProviderRequest) returns (IdentityProvider) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=identityProviders/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateIdentityProvider creates an identity provider.
|
||||
rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (IdentityProvider) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/identityProviders",
|
||||
body: "identity_provider"
|
||||
};
|
||||
}
|
||||
// UpdateIdentityProvider updates an identity provider.
|
||||
rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (IdentityProvider) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{identity_provider.name=identityProviders/*}"
|
||||
body: "identity_provider"
|
||||
};
|
||||
option (google.api.method_signature) = "identity_provider,update_mask";
|
||||
}
|
||||
// DeleteIdentityProvider deletes an identity provider.
|
||||
rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{name=identityProviders/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
||||
|
||||
message IdentityProvider {
|
||||
// The name of the identityProvider.
|
||||
// Format: identityProviders/{id}
|
||||
string name = 1;
|
||||
|
||||
enum Type {
|
||||
TYPE_UNSPECIFIED = 0;
|
||||
OAUTH2 = 1;
|
||||
}
|
||||
Type type = 2;
|
||||
|
||||
string title = 3;
|
||||
|
||||
string identifier_filter = 4;
|
||||
|
||||
IdentityProviderConfig config = 5;
|
||||
}
|
||||
|
||||
message IdentityProviderConfig {
|
||||
oneof config {
|
||||
OAuth2Config oauth2_config = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message FieldMapping {
|
||||
string identifier = 1;
|
||||
string display_name = 2;
|
||||
string email = 3;
|
||||
}
|
||||
|
||||
message OAuth2Config {
|
||||
string client_id = 1;
|
||||
string client_secret = 2;
|
||||
string auth_url = 3;
|
||||
string token_url = 4;
|
||||
string user_info_url = 5;
|
||||
repeated string scopes = 6;
|
||||
FieldMapping field_mapping = 7;
|
||||
}
|
||||
|
||||
message ListIdentityProvidersRequest {}
|
||||
|
||||
message ListIdentityProvidersResponse {
|
||||
repeated IdentityProvider identity_providers = 1;
|
||||
}
|
||||
|
||||
message GetIdentityProviderRequest {
|
||||
// The name of the identityProvider to get.
|
||||
// Format: identityProviders/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CreateIdentityProviderRequest {
|
||||
// The identityProvider to create.
|
||||
IdentityProvider identity_provider = 1;
|
||||
}
|
||||
|
||||
message UpdateIdentityProviderRequest {
|
||||
// The identityProvider to update.
|
||||
IdentityProvider identity_provider = 1;
|
||||
|
||||
// The update mask applies to the resource. Only the top level fields of
|
||||
// IdentityProvider are supported.
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message DeleteIdentityProviderRequest {
|
||||
// The name of the identityProvider to delete.
|
||||
// Format: identityProviders/{id}
|
||||
string name = 1;
|
||||
}
|
||||
80
proto/api/v1/inbox_service.proto
Normal file
80
proto/api/v1/inbox_service.proto
Normal file
@@ -0,0 +1,80 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service InboxService {
|
||||
// ListInboxes lists inboxes for a user.
|
||||
rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/inboxes"};
|
||||
}
|
||||
// UpdateInbox updates an inbox.
|
||||
rpc UpdateInbox(UpdateInboxRequest) returns (Inbox) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{inbox.name=inboxes/*}"
|
||||
body: "inbox"
|
||||
};
|
||||
option (google.api.method_signature) = "inbox,update_mask";
|
||||
}
|
||||
// DeleteInbox deletes an inbox.
|
||||
rpc DeleteInbox(DeleteInboxRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{name=inboxes/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
||||
|
||||
message Inbox {
|
||||
// The name of the inbox.
|
||||
// Format: inboxes/{id}
|
||||
string name = 1;
|
||||
// Format: users/{id}
|
||||
string sender = 2;
|
||||
// Format: users/{id}
|
||||
string receiver = 3;
|
||||
|
||||
enum Status {
|
||||
STATUS_UNSPECIFIED = 0;
|
||||
UNREAD = 1;
|
||||
ARCHIVED = 2;
|
||||
}
|
||||
Status status = 4;
|
||||
|
||||
google.protobuf.Timestamp create_time = 5;
|
||||
|
||||
enum Type {
|
||||
TYPE_UNSPECIFIED = 0;
|
||||
MEMO_COMMENT = 1;
|
||||
VERSION_UPDATE = 2;
|
||||
}
|
||||
Type type = 6;
|
||||
|
||||
optional int32 activity_id = 7;
|
||||
}
|
||||
|
||||
message ListInboxesRequest {
|
||||
// Format: users/{id}
|
||||
string user = 1;
|
||||
}
|
||||
|
||||
message ListInboxesResponse {
|
||||
repeated Inbox inboxes = 1;
|
||||
}
|
||||
|
||||
message UpdateInboxRequest {
|
||||
Inbox inbox = 1;
|
||||
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message DeleteInboxRequest {
|
||||
// The name of the inbox to delete.
|
||||
// Format: inboxes/{id}
|
||||
string name = 1;
|
||||
}
|
||||
259
proto/api/v1/markdown_service.proto
Normal file
259
proto/api/v1/markdown_service.proto
Normal file
@@ -0,0 +1,259 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service MarkdownService {
|
||||
// Parses the given markdown content and returns a list of nodes.
|
||||
rpc ParseMarkdown(ParseMarkdownRequest) returns (ParseMarkdownResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/markdown/parse"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// Restores the given nodes to markdown content.
|
||||
rpc RestoreMarkdown(RestoreMarkdownRequest) returns (RestoreMarkdownResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/markdown:restore"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// GetLinkMetadata returns metadata for a given link.
|
||||
rpc GetLinkMetadata(GetLinkMetadataRequest) returns (LinkMetadata) {
|
||||
option (google.api.http) = {get: "/api/v1/markdown/link:metadata"};
|
||||
}
|
||||
}
|
||||
|
||||
message ParseMarkdownRequest {
|
||||
string markdown = 1;
|
||||
}
|
||||
|
||||
message ParseMarkdownResponse {
|
||||
repeated Node nodes = 1;
|
||||
}
|
||||
|
||||
message RestoreMarkdownRequest {
|
||||
repeated Node nodes = 1;
|
||||
}
|
||||
|
||||
message RestoreMarkdownResponse {
|
||||
string markdown = 1;
|
||||
}
|
||||
|
||||
message GetLinkMetadataRequest {
|
||||
string link = 1;
|
||||
}
|
||||
|
||||
message LinkMetadata {
|
||||
string title = 1;
|
||||
string description = 2;
|
||||
string image = 3;
|
||||
}
|
||||
|
||||
enum NodeType {
|
||||
NODE_UNSPECIFIED = 0;
|
||||
LINE_BREAK = 1;
|
||||
PARAGRAPH = 2;
|
||||
CODE_BLOCK = 3;
|
||||
HEADING = 4;
|
||||
HORIZONTAL_RULE = 5;
|
||||
BLOCKQUOTE = 6;
|
||||
ORDERED_LIST = 7;
|
||||
UNORDERED_LIST = 8;
|
||||
TASK_LIST = 9;
|
||||
MATH_BLOCK = 10;
|
||||
TABLE = 11;
|
||||
EMBEDDED_CONTENT = 12;
|
||||
TEXT = 13;
|
||||
BOLD = 14;
|
||||
ITALIC = 15;
|
||||
BOLD_ITALIC = 16;
|
||||
CODE = 17;
|
||||
IMAGE = 18;
|
||||
LINK = 19;
|
||||
AUTO_LINK = 20;
|
||||
TAG = 21;
|
||||
STRIKETHROUGH = 22;
|
||||
ESCAPING_CHARACTER = 23;
|
||||
MATH = 24;
|
||||
HIGHLIGHT = 25;
|
||||
SUBSCRIPT = 26;
|
||||
SUPERSCRIPT = 27;
|
||||
REFERENCED_CONTENT = 28;
|
||||
SPOILER = 29;
|
||||
}
|
||||
|
||||
message Node {
|
||||
NodeType type = 1;
|
||||
oneof node {
|
||||
LineBreakNode line_break_node = 2;
|
||||
ParagraphNode paragraph_node = 3;
|
||||
CodeBlockNode code_block_node = 4;
|
||||
HeadingNode heading_node = 5;
|
||||
HorizontalRuleNode horizontal_rule_node = 6;
|
||||
BlockquoteNode blockquote_node = 7;
|
||||
OrderedListNode ordered_list_node = 8;
|
||||
UnorderedListNode unordered_list_node = 9;
|
||||
TaskListNode task_list_node = 10;
|
||||
MathBlockNode math_block_node = 11;
|
||||
TableNode table_node = 12;
|
||||
EmbeddedContentNode embedded_content_node = 13;
|
||||
TextNode text_node = 14;
|
||||
BoldNode bold_node = 15;
|
||||
ItalicNode italic_node = 16;
|
||||
BoldItalicNode bold_italic_node = 17;
|
||||
CodeNode code_node = 18;
|
||||
ImageNode image_node = 19;
|
||||
LinkNode link_node = 20;
|
||||
AutoLinkNode auto_link_node = 21;
|
||||
TagNode tag_node = 22;
|
||||
StrikethroughNode strikethrough_node = 23;
|
||||
EscapingCharacterNode escaping_character_node = 24;
|
||||
MathNode math_node = 25;
|
||||
HighlightNode highlight_node = 26;
|
||||
SubscriptNode subscript_node = 27;
|
||||
SuperscriptNode superscript_node = 28;
|
||||
ReferencedContentNode referenced_content_node = 29;
|
||||
SpoilerNode spoiler_node = 30;
|
||||
}
|
||||
}
|
||||
|
||||
message LineBreakNode {}
|
||||
|
||||
message ParagraphNode {
|
||||
repeated Node children = 1;
|
||||
}
|
||||
|
||||
message CodeBlockNode {
|
||||
string language = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
message HeadingNode {
|
||||
int32 level = 1;
|
||||
repeated Node children = 2;
|
||||
}
|
||||
|
||||
message HorizontalRuleNode {
|
||||
string symbol = 1;
|
||||
}
|
||||
|
||||
message BlockquoteNode {
|
||||
repeated Node children = 1;
|
||||
}
|
||||
|
||||
message OrderedListNode {
|
||||
string number = 1;
|
||||
int32 indent = 2;
|
||||
repeated Node children = 3;
|
||||
}
|
||||
|
||||
message UnorderedListNode {
|
||||
string symbol = 1;
|
||||
int32 indent = 2;
|
||||
repeated Node children = 3;
|
||||
}
|
||||
|
||||
message TaskListNode {
|
||||
string symbol = 1;
|
||||
int32 indent = 2;
|
||||
bool complete = 3;
|
||||
repeated Node children = 4;
|
||||
}
|
||||
|
||||
message MathBlockNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message TableNode {
|
||||
repeated string header = 1;
|
||||
repeated string delimiter = 2;
|
||||
|
||||
message Row {
|
||||
repeated string cells = 1;
|
||||
}
|
||||
repeated Row rows = 3;
|
||||
}
|
||||
|
||||
message EmbeddedContentNode {
|
||||
string resource_name = 1;
|
||||
string params = 2;
|
||||
}
|
||||
|
||||
message TextNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message BoldNode {
|
||||
string symbol = 1;
|
||||
repeated Node children = 2;
|
||||
}
|
||||
|
||||
message ItalicNode {
|
||||
string symbol = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
message BoldItalicNode {
|
||||
string symbol = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
message CodeNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message ImageNode {
|
||||
string alt_text = 1;
|
||||
string url = 2;
|
||||
}
|
||||
|
||||
message LinkNode {
|
||||
string text = 1;
|
||||
string url = 2;
|
||||
}
|
||||
|
||||
message AutoLinkNode {
|
||||
string url = 1;
|
||||
bool is_raw_text = 2;
|
||||
}
|
||||
|
||||
message TagNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message StrikethroughNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message EscapingCharacterNode {
|
||||
string symbol = 1;
|
||||
}
|
||||
|
||||
message MathNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message HighlightNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message SubscriptNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message SuperscriptNode {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message ReferencedContentNode {
|
||||
string resource_name = 1;
|
||||
string params = 2;
|
||||
}
|
||||
|
||||
message SpoilerNode {
|
||||
string content = 1;
|
||||
}
|
||||
22
proto/api/v1/memo_relation_service.proto
Normal file
22
proto/api/v1/memo_relation_service.proto
Normal file
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
message MemoRelation {
|
||||
// The name of memo.
|
||||
// Format: "memos/{uid}"
|
||||
string memo = 1;
|
||||
|
||||
// The name of related memo.
|
||||
// Format: "memos/{uid}"
|
||||
string related_memo = 2;
|
||||
|
||||
enum Type {
|
||||
TYPE_UNSPECIFIED = 0;
|
||||
REFERENCE = 1;
|
||||
COMMENT = 2;
|
||||
}
|
||||
Type type = 3;
|
||||
}
|
||||
420
proto/api/v1/memo_service.proto
Normal file
420
proto/api/v1/memo_service.proto
Normal file
@@ -0,0 +1,420 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v1/common.proto";
|
||||
import "api/v1/markdown_service.proto";
|
||||
import "api/v1/memo_relation_service.proto";
|
||||
import "api/v1/reaction_service.proto";
|
||||
import "api/v1/resource_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service MemoService {
|
||||
// CreateMemo creates a memo.
|
||||
rpc CreateMemo(CreateMemoRequest) returns (Memo) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/memos"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// ListMemos lists memos with pagination and filter.
|
||||
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/memos"};
|
||||
}
|
||||
// SearchMemos searches memos.
|
||||
rpc SearchMemos(SearchMemosRequest) returns (SearchMemosResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/memos:search"};
|
||||
}
|
||||
// GetMemo gets a memo.
|
||||
rpc GetMemo(GetMemoRequest) returns (Memo) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpdateMemo updates a memo.
|
||||
rpc UpdateMemo(UpdateMemoRequest) returns (Memo) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{memo.name=memos/*}"
|
||||
body: "memo"
|
||||
};
|
||||
option (google.api.method_signature) = "memo,update_mask";
|
||||
}
|
||||
// DeleteMemo deletes a memo.
|
||||
rpc DeleteMemo(DeleteMemoRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{name=memos/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ExportMemos exports memos.
|
||||
rpc ExportMemos(ExportMemosRequest) returns (ExportMemosResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/memos:export",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// ListMemoProperties lists memo properties.
|
||||
rpc ListMemoProperties(ListMemoPropertiesRequest) returns (ListMemoPropertiesResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/properties"};
|
||||
}
|
||||
// RebuildMemoProperty rebuilds a memo property.
|
||||
rpc RebuildMemoProperty(RebuildMemoPropertyRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/{name=memos/*}/properties:rebuild"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// ListMemoTags lists tags for a memo.
|
||||
rpc ListMemoTags(ListMemoTagsRequest) returns (ListMemoTagsResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{parent=memos/*}/tags"};
|
||||
}
|
||||
// RenameMemoTag renames a tag for a memo.
|
||||
rpc RenameMemoTag(RenameMemoTagRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{parent=memos/*}/tags:rename"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// DeleteMemoTag deletes a tag for a memo.
|
||||
rpc DeleteMemoTag(DeleteMemoTagRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{parent=memos/*}/tags/{tag}"};
|
||||
}
|
||||
// SetMemoResources sets resources for a memo.
|
||||
rpc SetMemoResources(SetMemoResourcesRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{name=memos/*}/resources"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ListMemoResources lists resources for a memo.
|
||||
rpc ListMemoResources(ListMemoResourcesRequest) returns (ListMemoResourcesResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/resources"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// SetMemoRelations sets relations for a memo.
|
||||
rpc SetMemoRelations(SetMemoRelationsRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{name=memos/*}/relations"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ListMemoRelations lists relations for a memo.
|
||||
rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/relations"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateMemoComment creates a comment for a memo.
|
||||
rpc CreateMemoComment(CreateMemoCommentRequest) returns (Memo) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/{name=memos/*}/comments",
|
||||
body: "comment"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ListMemoComments lists comments for a memo.
|
||||
rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/comments"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// GetUserMemosStats gets stats of memos for a user.
|
||||
rpc GetUserMemosStats(GetUserMemosStatsRequest) returns (GetUserMemosStatsResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/memos/stats"};
|
||||
option (google.api.method_signature) = "username";
|
||||
}
|
||||
// ListMemoReactions lists reactions for a memo.
|
||||
rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/reactions"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpsertMemoReaction upserts a reaction for a memo.
|
||||
rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (Reaction) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/{name=memos/*}/reactions",
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/reactions/{reaction_id}"};
|
||||
option (google.api.method_signature) = "reaction_id";
|
||||
}
|
||||
}
|
||||
|
||||
enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0;
|
||||
PRIVATE = 1;
|
||||
PROTECTED = 2;
|
||||
PUBLIC = 3;
|
||||
}
|
||||
|
||||
message Memo {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
// id is the system generated id.
|
||||
string name = 1;
|
||||
|
||||
// The user defined id of the memo.
|
||||
string uid = 2;
|
||||
|
||||
RowStatus row_status = 3;
|
||||
|
||||
// The name of the creator.
|
||||
// Format: users/{id}
|
||||
string creator = 4;
|
||||
|
||||
google.protobuf.Timestamp create_time = 5;
|
||||
|
||||
google.protobuf.Timestamp update_time = 6;
|
||||
|
||||
google.protobuf.Timestamp display_time = 7;
|
||||
|
||||
string content = 8;
|
||||
|
||||
repeated Node nodes = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
Visibility visibility = 10;
|
||||
|
||||
repeated string tags = 11;
|
||||
|
||||
bool pinned = 12;
|
||||
|
||||
optional int32 parent_id = 13 [
|
||||
deprecated = true,
|
||||
(google.api.field_behavior) = OUTPUT_ONLY
|
||||
];
|
||||
|
||||
repeated Resource resources = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
repeated MemoRelation relations = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
repeated Reaction reactions = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
MemoProperty property = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// The name of the parent memo.
|
||||
// Format: memos/{id}
|
||||
optional string parent = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
}
|
||||
|
||||
message MemoProperty {
|
||||
repeated string tags = 1;
|
||||
bool has_link = 2;
|
||||
bool has_task_list = 3;
|
||||
bool has_code = 4;
|
||||
}
|
||||
|
||||
message CreateMemoRequest {
|
||||
string content = 1;
|
||||
|
||||
Visibility visibility = 2;
|
||||
}
|
||||
|
||||
message ListMemosRequest {
|
||||
// The maximum number of memos to return.
|
||||
int32 page_size = 1;
|
||||
|
||||
// A page token, received from a previous `ListMemos` call.
|
||||
// Provide this to retrieve the subsequent page.
|
||||
string page_token = 2;
|
||||
|
||||
// Filter is used to filter memos returned in the list.
|
||||
// Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']"
|
||||
string filter = 3;
|
||||
}
|
||||
|
||||
message ListMemosResponse {
|
||||
repeated Memo memos = 1;
|
||||
|
||||
// A token, which can be sent as `page_token` to retrieve the next page.
|
||||
// If this field is omitted, there are no subsequent pages.
|
||||
string next_page_token = 2;
|
||||
}
|
||||
|
||||
message SearchMemosRequest {
|
||||
// Filter is used to filter memos returned.
|
||||
// Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']"
|
||||
string filter = 1;
|
||||
}
|
||||
|
||||
message SearchMemosResponse {
|
||||
repeated Memo memos = 1;
|
||||
}
|
||||
|
||||
message GetMemoRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message UpdateMemoRequest {
|
||||
Memo memo = 1;
|
||||
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message DeleteMemoRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ExportMemosRequest {
|
||||
// Same as ListMemosRequest.filter
|
||||
string filter = 1;
|
||||
}
|
||||
|
||||
message ExportMemosResponse {
|
||||
bytes content = 1;
|
||||
}
|
||||
|
||||
message ListMemoPropertiesRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}. Use "memos/-" to list all properties.
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListMemoPropertiesResponse {
|
||||
repeated MemoProperty properties = 1;
|
||||
}
|
||||
|
||||
message RebuildMemoPropertyRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}. Use "memos/-" to rebuild all memos.
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListMemoTagsRequest {
|
||||
// The parent, who owns the tags.
|
||||
// Format: memos/{id}. Use "memos/-" to list all tags.
|
||||
string parent = 1;
|
||||
|
||||
// Filter is used to filter memos.
|
||||
// Format: "creator == 'users/{uid}' && visibilities == ['PUBLIC', 'PROTECTED']"
|
||||
string filter = 2;
|
||||
}
|
||||
|
||||
message ListMemoTagsResponse {
|
||||
// tag_amounts is the amount of tags.
|
||||
// key is the tag name. e.g. "tag1".
|
||||
// value is the amount of the tag.
|
||||
map<string, int32> tag_amounts = 1;
|
||||
}
|
||||
|
||||
message RenameMemoTagRequest {
|
||||
// The parent, who owns the tags.
|
||||
// Format: memos/{id}. Use "memos/-" to rename all tags.
|
||||
string parent = 1;
|
||||
string old_tag = 2;
|
||||
string new_tag = 3;
|
||||
}
|
||||
|
||||
message DeleteMemoTagRequest {
|
||||
// The parent, who owns the tags.
|
||||
// Format: memos/{id}. Use "memos/-" to delete all tags.
|
||||
string parent = 1;
|
||||
string tag = 2;
|
||||
bool delete_related_memos = 3;
|
||||
}
|
||||
|
||||
message SetMemoResourcesRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
|
||||
repeated Resource resources = 2;
|
||||
}
|
||||
|
||||
message ListMemoResourcesRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListMemoResourcesResponse {
|
||||
repeated Resource resources = 1;
|
||||
}
|
||||
|
||||
message SetMemoRelationsRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
|
||||
repeated MemoRelation relations = 2;
|
||||
}
|
||||
|
||||
message ListMemoRelationsRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListMemoRelationsResponse {
|
||||
repeated MemoRelation relations = 1;
|
||||
}
|
||||
|
||||
message CreateMemoCommentRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
|
||||
CreateMemoRequest comment = 2;
|
||||
}
|
||||
|
||||
message ListMemoCommentsRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListMemoCommentsResponse {
|
||||
repeated Memo memos = 1;
|
||||
}
|
||||
|
||||
message GetUserMemosStatsRequest {
|
||||
// name is the name of the user to get stats for.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
|
||||
// timezone location
|
||||
// Format: uses tz identifier
|
||||
// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
string timezone = 2;
|
||||
|
||||
// Same as ListMemosRequest.filter
|
||||
string filter = 3;
|
||||
}
|
||||
|
||||
message GetUserMemosStatsResponse {
|
||||
// stats is the stats of memo creating/updating activities.
|
||||
// key is the year-month-day string. e.g. "2020-01-01".
|
||||
map<string, int32> stats = 1;
|
||||
}
|
||||
|
||||
message ListMemoReactionsRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListMemoReactionsResponse {
|
||||
repeated Reaction reactions = 1;
|
||||
}
|
||||
|
||||
message UpsertMemoReactionRequest {
|
||||
// The name of the memo.
|
||||
// Format: memos/{id}
|
||||
string name = 1;
|
||||
|
||||
Reaction reaction = 2;
|
||||
}
|
||||
|
||||
message DeleteMemoReactionRequest {
|
||||
int32 reaction_id = 1;
|
||||
}
|
||||
32
proto/api/v1/reaction_service.proto
Normal file
32
proto/api/v1/reaction_service.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
message Reaction {
|
||||
int32 id = 1;
|
||||
|
||||
// The name of the creator.
|
||||
// Format: users/{id}
|
||||
string creator = 2;
|
||||
|
||||
string content_id = 3;
|
||||
|
||||
enum Type {
|
||||
TYPE_UNSPECIFIED = 0;
|
||||
THUMBS_UP = 1;
|
||||
THUMBS_DOWN = 2;
|
||||
HEART = 3;
|
||||
FIRE = 4;
|
||||
CLAPPING_HANDS = 5;
|
||||
LAUGH = 6;
|
||||
OK_HAND = 7;
|
||||
ROCKET = 8;
|
||||
EYES = 9;
|
||||
THINKING_FACE = 10;
|
||||
CLOWN_FACE = 11;
|
||||
QUESTION_MARK = 12;
|
||||
}
|
||||
Type reaction_type = 4;
|
||||
}
|
||||
128
proto/api/v1/resource_service.proto
Normal file
128
proto/api/v1/resource_service.proto
Normal file
@@ -0,0 +1,128 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/api/httpbody.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service ResourceService {
|
||||
// CreateResource creates a new resource.
|
||||
rpc CreateResource(CreateResourceRequest) returns (Resource) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/resources",
|
||||
body: "resource"
|
||||
};
|
||||
}
|
||||
// ListResources lists all resources.
|
||||
rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/resources"};
|
||||
}
|
||||
// SearchResources searches memos.
|
||||
rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/resources:search"};
|
||||
}
|
||||
// GetResource returns a resource by name.
|
||||
rpc GetResource(GetResourceRequest) returns (Resource) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=resources/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// GetResourceBinary returns a resource binary by name.
|
||||
rpc GetResourceBinary(GetResourceBinaryRequest) returns (google.api.HttpBody) {
|
||||
option (google.api.http) = {get: "/file/{name=resources/*}/{filename}"};
|
||||
option (google.api.method_signature) = "name,filename";
|
||||
}
|
||||
// UpdateResource updates a resource.
|
||||
rpc UpdateResource(UpdateResourceRequest) returns (Resource) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{resource.name=resources/*}",
|
||||
body: "resource"
|
||||
};
|
||||
option (google.api.method_signature) = "resource,update_mask";
|
||||
}
|
||||
// DeleteResource deletes a resource by name.
|
||||
rpc DeleteResource(DeleteResourceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{name=resources/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
||||
|
||||
message Resource {
|
||||
// The name of the resource.
|
||||
// Format: resources/{id}
|
||||
// id is the system generated unique identifier.
|
||||
string name = 1;
|
||||
|
||||
// The user defined id of the resource.
|
||||
string uid = 2;
|
||||
|
||||
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
string filename = 4;
|
||||
|
||||
bytes content = 5 [(google.api.field_behavior) = INPUT_ONLY];
|
||||
|
||||
string external_link = 6;
|
||||
|
||||
string type = 7;
|
||||
|
||||
int64 size = 8;
|
||||
|
||||
// The related memo.
|
||||
// Format: memos/{id}
|
||||
optional string memo = 9;
|
||||
}
|
||||
|
||||
message CreateResourceRequest {
|
||||
Resource resource = 1;
|
||||
}
|
||||
|
||||
message ListResourcesRequest {}
|
||||
|
||||
message ListResourcesResponse {
|
||||
repeated Resource resources = 1;
|
||||
}
|
||||
|
||||
message SearchResourcesRequest {
|
||||
string filter = 1;
|
||||
}
|
||||
|
||||
message SearchResourcesResponse {
|
||||
repeated Resource resources = 1;
|
||||
}
|
||||
|
||||
message GetResourceRequest {
|
||||
// The name of the resource.
|
||||
// Format: resources/{id}
|
||||
// id is the system generated unique identifier.
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message GetResourceBinaryRequest {
|
||||
// The name of the resource.
|
||||
// Format: resources/{id}
|
||||
// id is the system generated unique identifier.
|
||||
string name = 1;
|
||||
|
||||
// The filename of the resource. Mainly used for downloading.
|
||||
string filename = 2;
|
||||
}
|
||||
|
||||
message UpdateResourceRequest {
|
||||
Resource resource = 1;
|
||||
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message DeleteResourceRequest {
|
||||
// The name of the resource.
|
||||
// Format: resources/{id}
|
||||
// id is the system generated unique identifier.
|
||||
string name = 1;
|
||||
}
|
||||
228
proto/api/v1/user_service.proto
Normal file
228
proto/api/v1/user_service.proto
Normal file
@@ -0,0 +1,228 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v1/common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/api/httpbody.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service UserService {
|
||||
// ListUsers returns a list of users.
|
||||
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/users"};
|
||||
}
|
||||
// SearchUsers searches users by filter.
|
||||
rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/users:search"};
|
||||
}
|
||||
// GetUser gets a user by name.
|
||||
rpc GetUser(GetUserRequest) returns (User) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=users/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// GetUserAvatarBinary gets the avatar of a user.
|
||||
rpc GetUserAvatarBinary(GetUserAvatarBinaryRequest) returns (google.api.HttpBody) {
|
||||
option (google.api.http) = {get: "/file/{name=users/*}/avatar"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateUser creates a new user.
|
||||
rpc CreateUser(CreateUserRequest) returns (User) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/users"
|
||||
body: "user"
|
||||
};
|
||||
option (google.api.method_signature) = "user";
|
||||
}
|
||||
// UpdateUser updates a user.
|
||||
rpc UpdateUser(UpdateUserRequest) returns (User) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{user.name=users/*}"
|
||||
body: "user"
|
||||
};
|
||||
option (google.api.method_signature) = "user,update_mask";
|
||||
}
|
||||
// DeleteUser deletes a user.
|
||||
rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{name=users/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// GetUserSetting gets the setting of a user.
|
||||
rpc GetUserSetting(GetUserSettingRequest) returns (UserSetting) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=users/*}/setting"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpdateUserSetting updates the setting of a user.
|
||||
rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UserSetting) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/{setting.name=users/*/setting}"
|
||||
body: "setting"
|
||||
};
|
||||
option (google.api.method_signature) = "setting,update_mask";
|
||||
}
|
||||
// ListUserAccessTokens returns a list of access tokens for a user.
|
||||
rpc ListUserAccessTokens(ListUserAccessTokensRequest) returns (ListUserAccessTokensResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/{name=users/*}/access_tokens"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateUserAccessToken creates a new access token for a user.
|
||||
rpc CreateUserAccessToken(CreateUserAccessTokenRequest) returns (UserAccessToken) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/{name=users/*}/access_tokens"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// DeleteUserAccessToken deletes an access token for a user.
|
||||
rpc DeleteUserAccessToken(DeleteUserAccessTokenRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/{name=users/*}/access_tokens/{access_token}"};
|
||||
option (google.api.method_signature) = "name,access_token";
|
||||
}
|
||||
}
|
||||
|
||||
message User {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
|
||||
// The system generated uid of the user.
|
||||
int32 id = 2;
|
||||
|
||||
enum Role {
|
||||
ROLE_UNSPECIFIED = 0;
|
||||
HOST = 1;
|
||||
ADMIN = 2;
|
||||
USER = 3;
|
||||
}
|
||||
Role role = 3;
|
||||
|
||||
string username = 4;
|
||||
|
||||
string email = 5;
|
||||
|
||||
string nickname = 6;
|
||||
|
||||
string avatar_url = 7;
|
||||
|
||||
string description = 8;
|
||||
|
||||
string password = 9 [(google.api.field_behavior) = INPUT_ONLY];
|
||||
|
||||
RowStatus row_status = 10;
|
||||
|
||||
google.protobuf.Timestamp create_time = 11;
|
||||
|
||||
google.protobuf.Timestamp update_time = 12;
|
||||
}
|
||||
|
||||
message ListUsersRequest {}
|
||||
|
||||
message ListUsersResponse {
|
||||
repeated User users = 1;
|
||||
}
|
||||
|
||||
message SearchUsersRequest {
|
||||
// Filter is used to filter users returned in the list.
|
||||
// Format: "username == 'frank'"
|
||||
string filter = 1;
|
||||
}
|
||||
|
||||
message SearchUsersResponse {
|
||||
repeated User users = 1;
|
||||
}
|
||||
|
||||
message GetUserRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message GetUserAvatarBinaryRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
|
||||
// The raw HTTP body is bound to this field.
|
||||
google.api.HttpBody http_body = 2;
|
||||
}
|
||||
|
||||
message CreateUserRequest {
|
||||
User user = 1;
|
||||
}
|
||||
|
||||
message UpdateUserRequest {
|
||||
User user = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message DeleteUserRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message UserSetting {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
// The preferred locale of the user.
|
||||
string locale = 2;
|
||||
// The preferred appearance of the user.
|
||||
string appearance = 3;
|
||||
// The default visibility of the memo.
|
||||
string memo_visibility = 4;
|
||||
}
|
||||
|
||||
message GetUserSettingRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message UpdateUserSettingRequest {
|
||||
UserSetting setting = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message UserAccessToken {
|
||||
string access_token = 1;
|
||||
string description = 2;
|
||||
google.protobuf.Timestamp issued_at = 3;
|
||||
google.protobuf.Timestamp expires_at = 4;
|
||||
}
|
||||
|
||||
message ListUserAccessTokensRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ListUserAccessTokensResponse {
|
||||
repeated UserAccessToken access_tokens = 1;
|
||||
}
|
||||
|
||||
message CreateUserAccessTokenRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
|
||||
string description = 2;
|
||||
|
||||
optional google.protobuf.Timestamp expires_at = 3;
|
||||
}
|
||||
|
||||
message DeleteUserAccessTokenRequest {
|
||||
// The name of the user.
|
||||
// Format: users/{id}
|
||||
string name = 1;
|
||||
// access_token is the access token to delete.
|
||||
string access_token = 2;
|
||||
}
|
||||
88
proto/api/v1/webhook_service.proto
Normal file
88
proto/api/v1/webhook_service.proto
Normal file
@@ -0,0 +1,88 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v1/common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service WebhookService {
|
||||
// CreateWebhook creates a new webhook.
|
||||
rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/webhooks"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// GetWebhook returns a webhook by id.
|
||||
rpc GetWebhook(GetWebhookRequest) returns (Webhook) {
|
||||
option (google.api.http) = {get: "/api/v1/webhooks/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// ListWebhooks returns a list of webhooks.
|
||||
rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) {
|
||||
option (google.api.http) = {get: "/api/v1/webhooks"};
|
||||
}
|
||||
// UpdateWebhook updates a webhook.
|
||||
rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/webhooks/{webhook.id}"
|
||||
body: "webhook"
|
||||
};
|
||||
option (google.api.method_signature) = "webhook,update_mask";
|
||||
}
|
||||
// DeleteWebhook deletes a webhook by id.
|
||||
rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v1/webhooks/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
||||
|
||||
message Webhook {
|
||||
int32 id = 1;
|
||||
|
||||
int32 creator_id = 2;
|
||||
|
||||
google.protobuf.Timestamp created_time = 3;
|
||||
|
||||
google.protobuf.Timestamp updated_time = 4;
|
||||
|
||||
RowStatus row_status = 5;
|
||||
|
||||
string name = 6;
|
||||
|
||||
string url = 7;
|
||||
}
|
||||
|
||||
message CreateWebhookRequest {
|
||||
string name = 1;
|
||||
|
||||
string url = 2;
|
||||
}
|
||||
|
||||
message GetWebhookRequest {
|
||||
int32 id = 1;
|
||||
}
|
||||
|
||||
message ListWebhooksRequest {
|
||||
int32 creator_id = 1;
|
||||
}
|
||||
|
||||
message ListWebhooksResponse {
|
||||
repeated Webhook webhooks = 1;
|
||||
}
|
||||
|
||||
message UpdateWebhookRequest {
|
||||
Webhook webhook = 1;
|
||||
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message DeleteWebhookRequest {
|
||||
int32 id = 1;
|
||||
}
|
||||
26
proto/api/v1/workspace_service.proto
Normal file
26
proto/api/v1/workspace_service.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service WorkspaceService {
|
||||
// GetWorkspaceProfile returns the workspace profile.
|
||||
rpc GetWorkspaceProfile(GetWorkspaceProfileRequest) returns (WorkspaceProfile) {
|
||||
option (google.api.http) = {get: "/api/v1/workspace/profile"};
|
||||
}
|
||||
}
|
||||
|
||||
message WorkspaceProfile {
|
||||
// The name of instance owner.
|
||||
// Format: "users/{id}"
|
||||
string owner = 1;
|
||||
// version is the current version of instance
|
||||
string version = 2;
|
||||
// mode is the instance mode (e.g. "prod", "dev" or "demo").
|
||||
string mode = 3;
|
||||
}
|
||||
|
||||
message GetWorkspaceProfileRequest {}
|
||||
110
proto/api/v1/workspace_setting_service.proto
Normal file
110
proto/api/v1/workspace_setting_service.proto
Normal file
@@ -0,0 +1,110 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service WorkspaceSettingService {
|
||||
// GetWorkspaceSetting returns the setting by name.
|
||||
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (WorkspaceSetting) {
|
||||
option (google.api.http) = {get: "/api/v1/workspace/{name=settings/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// SetWorkspaceSetting updates the setting.
|
||||
rpc SetWorkspaceSetting(SetWorkspaceSettingRequest) returns (WorkspaceSetting) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v1/workspace/{setting.name=settings/*}",
|
||||
body: "setting"
|
||||
};
|
||||
option (google.api.method_signature) = "setting";
|
||||
}
|
||||
}
|
||||
|
||||
message WorkspaceSetting {
|
||||
// name is the name of the setting.
|
||||
// Format: settings/{setting}
|
||||
string name = 1;
|
||||
oneof value {
|
||||
WorkspaceGeneralSetting general_setting = 2;
|
||||
WorkspaceStorageSetting storage_setting = 3;
|
||||
WorkspaceMemoRelatedSetting memo_related_setting = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message WorkspaceGeneralSetting {
|
||||
// disallow_signup is the flag to disallow signup.
|
||||
bool disallow_signup = 1;
|
||||
// disallow_password_login is the flag to disallow password login.
|
||||
bool disallow_password_login = 2;
|
||||
// additional_script is the additional script.
|
||||
string additional_script = 3;
|
||||
// additional_style is the additional style.
|
||||
string additional_style = 4;
|
||||
// custom_profile is the custom profile.
|
||||
WorkspaceCustomProfile custom_profile = 5;
|
||||
}
|
||||
|
||||
message WorkspaceCustomProfile {
|
||||
string title = 1;
|
||||
string description = 2;
|
||||
string logo_url = 3;
|
||||
string locale = 4;
|
||||
string appearance = 5;
|
||||
}
|
||||
|
||||
message WorkspaceStorageSetting {
|
||||
enum StorageType {
|
||||
STORAGE_TYPE_UNSPECIFIED = 0;
|
||||
// DATABASE is the database storage type.
|
||||
DATABASE = 1;
|
||||
// LOCAL is the local storage type.
|
||||
LOCAL = 2;
|
||||
// S3 is the S3 storage type.
|
||||
S3 = 3;
|
||||
}
|
||||
// storage_type is the storage type.
|
||||
StorageType storage_type = 1;
|
||||
// The template of file path.
|
||||
// e.g. assets/{timestamp}_{filename}
|
||||
string filepath_template = 2;
|
||||
// The max upload size in megabytes.
|
||||
int64 upload_size_limit_mb = 3;
|
||||
// Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
|
||||
message S3Config {
|
||||
string access_key_id = 1;
|
||||
string access_key_secret = 2;
|
||||
string endpoint = 3;
|
||||
string region = 4;
|
||||
string bucket = 5;
|
||||
}
|
||||
// The S3 config.
|
||||
S3Config s3_config = 4;
|
||||
}
|
||||
|
||||
message WorkspaceMemoRelatedSetting {
|
||||
// disallow_public_share disallows set memo as public visible.
|
||||
bool disallow_public_visible = 1;
|
||||
// display_with_update_time orders and displays memo with update time.
|
||||
bool display_with_update_time = 2;
|
||||
// content_length_limit is the limit of content length. Unit is byte.
|
||||
int32 content_length_limit = 3;
|
||||
// enable_auto_compact enables auto compact for large content.
|
||||
bool enable_auto_compact = 4;
|
||||
// enable_double_click_edit enables editing on double click.
|
||||
bool enable_double_click_edit = 5;
|
||||
}
|
||||
|
||||
message GetWorkspaceSettingRequest {
|
||||
// The resource name of the workspace setting.
|
||||
// Format: settings/{setting}
|
||||
string name = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
message SetWorkspaceSettingRequest {
|
||||
// setting is the setting to update.
|
||||
WorkspaceSetting setting = 1;
|
||||
}
|
||||
35
proto/buf.gen.yaml
Normal file
35
proto/buf.gen.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
version: v1
|
||||
managed:
|
||||
enabled: true
|
||||
go_package_prefix:
|
||||
default: github.com/usememos/memos/proto/gen
|
||||
except:
|
||||
- buf.build/googleapis/googleapis
|
||||
plugins:
|
||||
- plugin: buf.build/protocolbuffers/go
|
||||
out: gen
|
||||
opt:
|
||||
- paths=source_relative
|
||||
- plugin: buf.build/grpc/go
|
||||
out: gen
|
||||
opt:
|
||||
- paths=source_relative
|
||||
- plugin: buf.build/grpc-ecosystem/gateway
|
||||
out: gen
|
||||
opt:
|
||||
- paths=source_relative
|
||||
- plugin: buf.build/grpc-ecosystem/openapiv2
|
||||
out: ../docs
|
||||
opt: output_format=yaml,allow_merge=true
|
||||
# Build the TypeScript definitions for the web.
|
||||
- plugin: buf.build/community/stephenh-ts-proto
|
||||
out: ../web/src/types/proto
|
||||
# reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto
|
||||
opt:
|
||||
- env=browser
|
||||
- useOptionals=messages
|
||||
- outputServices=generic-definitions
|
||||
- outputJsonMethods=false
|
||||
- useExactTypes=false
|
||||
- esModuleInterop=true
|
||||
- stringEnums=true
|
||||
13
proto/buf.lock
Normal file
13
proto/buf.lock
Normal file
@@ -0,0 +1,13 @@
|
||||
# Generated by buf. DO NOT EDIT.
|
||||
version: v1
|
||||
deps:
|
||||
- remote: buf.build
|
||||
owner: googleapis
|
||||
repository: googleapis
|
||||
commit: a86849a25cc04f4dbe9b15ddddfbc488
|
||||
digest: shake256:e19143328f8cbfe13fc226aeee5e63773ca494693a72740a7560664270039a380d94a1344234b88c7691311460df9a9b1c2982190d0a2612eae80368718e1943
|
||||
- remote: buf.build
|
||||
owner: grpc-ecosystem
|
||||
repository: grpc-gateway
|
||||
commit: 3f42134f4c564983838425bc43c7a65f
|
||||
digest: shake256:3d11d4c0fe5e05fda0131afefbce233940e27f0c31c5d4e385686aea58ccd30f72053f61af432fa83f1fc11cda57f5f18ca3da26a29064f73c5a0d076bba8d92
|
||||
15
proto/buf.yaml
Normal file
15
proto/buf.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
version: v1
|
||||
name: buf.build/yourselfhosted/memos
|
||||
breaking:
|
||||
use:
|
||||
- FILE
|
||||
lint:
|
||||
use:
|
||||
- BASIC
|
||||
except:
|
||||
- ENUM_VALUE_PREFIX
|
||||
- PACKAGE_DIRECTORY_MATCH
|
||||
- PACKAGE_VERSION_SUFFIX
|
||||
deps:
|
||||
- buf.build/googleapis/googleapis
|
||||
- buf.build/grpc-ecosystem/grpc-gateway
|
||||
520
proto/gen/api/v1/activity_service.pb.go
Normal file
520
proto/gen/api/v1/activity_service.pb.go
Normal file
@@ -0,0 +1,520 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc (unknown)
|
||||
// source: api/v1/activity_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Activity struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The system-generated unique identifier for the activity.
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// The system-generated unique identifier for the user who created the activity.
|
||||
CreatorId int32 `protobuf:"varint,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
|
||||
// The type of the activity.
|
||||
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
|
||||
// The level of the activity.
|
||||
Level string `protobuf:"bytes,4,opt,name=level,proto3" json:"level,omitempty"`
|
||||
// The create time of the activity.
|
||||
CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
|
||||
// The payload of the activity.
|
||||
Payload *ActivityPayload `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Activity) Reset() {
|
||||
*x = Activity{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Activity) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Activity) ProtoMessage() {}
|
||||
|
||||
func (x *Activity) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Activity.ProtoReflect.Descriptor instead.
|
||||
func (*Activity) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_activity_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Activity) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Activity) GetCreatorId() int32 {
|
||||
if x != nil {
|
||||
return x.CreatorId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Activity) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Activity) GetLevel() string {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Activity) GetCreateTime() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreateTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Activity) GetPayload() *ActivityPayload {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ActivityMemoCommentPayload represents the payload of a memo comment activity.
|
||||
type ActivityMemoCommentPayload struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The memo id of comment.
|
||||
MemoId int32 `protobuf:"varint,1,opt,name=memo_id,json=memoId,proto3" json:"memo_id,omitempty"`
|
||||
// The memo id of related memo.
|
||||
RelatedMemoId int32 `protobuf:"varint,2,opt,name=related_memo_id,json=relatedMemoId,proto3" json:"related_memo_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ActivityMemoCommentPayload) Reset() {
|
||||
*x = ActivityMemoCommentPayload{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ActivityMemoCommentPayload) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ActivityMemoCommentPayload) ProtoMessage() {}
|
||||
|
||||
func (x *ActivityMemoCommentPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ActivityMemoCommentPayload.ProtoReflect.Descriptor instead.
|
||||
func (*ActivityMemoCommentPayload) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_activity_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ActivityMemoCommentPayload) GetMemoId() int32 {
|
||||
if x != nil {
|
||||
return x.MemoId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ActivityMemoCommentPayload) GetRelatedMemoId() int32 {
|
||||
if x != nil {
|
||||
return x.RelatedMemoId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ActivityVersionUpdatePayload struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The updated version of memos.
|
||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ActivityVersionUpdatePayload) Reset() {
|
||||
*x = ActivityVersionUpdatePayload{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ActivityVersionUpdatePayload) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ActivityVersionUpdatePayload) ProtoMessage() {}
|
||||
|
||||
func (x *ActivityVersionUpdatePayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ActivityVersionUpdatePayload.ProtoReflect.Descriptor instead.
|
||||
func (*ActivityVersionUpdatePayload) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_activity_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ActivityVersionUpdatePayload) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ActivityPayload struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MemoComment *ActivityMemoCommentPayload `protobuf:"bytes,1,opt,name=memo_comment,json=memoComment,proto3" json:"memo_comment,omitempty"`
|
||||
VersionUpdate *ActivityVersionUpdatePayload `protobuf:"bytes,2,opt,name=version_update,json=versionUpdate,proto3" json:"version_update,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ActivityPayload) Reset() {
|
||||
*x = ActivityPayload{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ActivityPayload) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ActivityPayload) ProtoMessage() {}
|
||||
|
||||
func (x *ActivityPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ActivityPayload.ProtoReflect.Descriptor instead.
|
||||
func (*ActivityPayload) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_activity_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ActivityPayload) GetMemoComment() *ActivityMemoCommentPayload {
|
||||
if x != nil {
|
||||
return x.MemoComment
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ActivityPayload) GetVersionUpdate() *ActivityVersionUpdatePayload {
|
||||
if x != nil {
|
||||
return x.VersionUpdate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetActivityRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The system-generated unique identifier for the activity.
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetActivityRequest) Reset() {
|
||||
*x = GetActivityRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetActivityRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetActivityRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetActivityRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_activity_service_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetActivityRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetActivityRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_activity_service_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetActivityRequest) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_api_v1_activity_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_v1_activity_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
|
||||
0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x01, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76,
|
||||
0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72,
|
||||
0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x41, 0x0a, 0x0b,
|
||||
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2,
|
||||
0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||
0x37, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52,
|
||||
0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x5d, 0x0a, 0x1a, 0x41, 0x63, 0x74, 0x69,
|
||||
0x76, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x50,
|
||||
0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x12,
|
||||
0x26, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65,
|
||||
0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x1c, 0x41, 0x63, 0x74, 0x69, 0x76,
|
||||
0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x22, 0xb1, 0x01, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x61,
|
||||
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4b, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x63, 0x6f,
|
||||
0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x65,
|
||||
0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76,
|
||||
0x69, 0x74, 0x79, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61,
|
||||
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69,
|
||||
0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50,
|
||||
0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69,
|
||||
0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x32, 0x80, 0x01, 0x0a, 0x0f,
|
||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
||||
0x6d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x20,
|
||||
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
|
||||
0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x22, 0x24, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82,
|
||||
0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61,
|
||||
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xac,
|
||||
0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x76, 0x31, 0x42, 0x14, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||
0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
||||
0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e,
|
||||
0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56,
|
||||
0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31,
|
||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d,
|
||||
0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_v1_activity_service_proto_rawDescOnce sync.Once
|
||||
file_api_v1_activity_service_proto_rawDescData = file_api_v1_activity_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_v1_activity_service_proto_rawDescGZIP() []byte {
|
||||
file_api_v1_activity_service_proto_rawDescOnce.Do(func() {
|
||||
file_api_v1_activity_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_activity_service_proto_rawDescData)
|
||||
})
|
||||
return file_api_v1_activity_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_v1_activity_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_api_v1_activity_service_proto_goTypes = []interface{}{
|
||||
(*Activity)(nil), // 0: memos.api.v1.Activity
|
||||
(*ActivityMemoCommentPayload)(nil), // 1: memos.api.v1.ActivityMemoCommentPayload
|
||||
(*ActivityVersionUpdatePayload)(nil), // 2: memos.api.v1.ActivityVersionUpdatePayload
|
||||
(*ActivityPayload)(nil), // 3: memos.api.v1.ActivityPayload
|
||||
(*GetActivityRequest)(nil), // 4: memos.api.v1.GetActivityRequest
|
||||
(*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp
|
||||
}
|
||||
var file_api_v1_activity_service_proto_depIdxs = []int32{
|
||||
5, // 0: memos.api.v1.Activity.create_time:type_name -> google.protobuf.Timestamp
|
||||
3, // 1: memos.api.v1.Activity.payload:type_name -> memos.api.v1.ActivityPayload
|
||||
1, // 2: memos.api.v1.ActivityPayload.memo_comment:type_name -> memos.api.v1.ActivityMemoCommentPayload
|
||||
2, // 3: memos.api.v1.ActivityPayload.version_update:type_name -> memos.api.v1.ActivityVersionUpdatePayload
|
||||
4, // 4: memos.api.v1.ActivityService.GetActivity:input_type -> memos.api.v1.GetActivityRequest
|
||||
0, // 5: memos.api.v1.ActivityService.GetActivity:output_type -> memos.api.v1.Activity
|
||||
5, // [5:6] is the sub-list for method output_type
|
||||
4, // [4:5] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_activity_service_proto_init() }
|
||||
func file_api_v1_activity_service_proto_init() {
|
||||
if File_api_v1_activity_service_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_v1_activity_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Activity); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_activity_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActivityMemoCommentPayload); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_activity_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActivityVersionUpdatePayload); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_activity_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActivityPayload); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_activity_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetActivityRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_v1_activity_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_v1_activity_service_proto_goTypes,
|
||||
DependencyIndexes: file_api_v1_activity_service_proto_depIdxs,
|
||||
MessageInfos: file_api_v1_activity_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_v1_activity_service_proto = out.File
|
||||
file_api_v1_activity_service_proto_rawDesc = nil
|
||||
file_api_v1_activity_service_proto_goTypes = nil
|
||||
file_api_v1_activity_service_proto_depIdxs = nil
|
||||
}
|
||||
189
proto/gen/api/v1/activity_service.pb.gw.go
Normal file
189
proto/gen/api/v1/activity_service.pb.gw.go
Normal file
@@ -0,0 +1,189 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/v1/activity_service.proto
|
||||
|
||||
/*
|
||||
Package apiv1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = metadata.Join
|
||||
|
||||
func request_ActivityService_GetActivity_0(ctx context.Context, marshaler runtime.Marshaler, client ActivityServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetActivityRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.Int32(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetActivity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_ActivityService_GetActivity_0(ctx context.Context, marshaler runtime.Marshaler, server ActivityServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetActivityRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.Int32(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetActivity(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterActivityServiceHandlerServer registers the http handlers for service ActivityService to "mux".
|
||||
// UnaryRPC :call ActivityServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterActivityServiceHandlerFromEndpoint instead.
|
||||
func RegisterActivityServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ActivityServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_ActivityService_GetActivity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ActivityService/GetActivity", runtime.WithHTTPPathPattern("/api/v1/activities/{id}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_ActivityService_GetActivity_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ActivityService_GetActivity_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterActivityServiceHandlerFromEndpoint is same as RegisterActivityServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterActivityServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterActivityServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterActivityServiceHandler registers the http handlers for service ActivityService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterActivityServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterActivityServiceHandlerClient(ctx, mux, NewActivityServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterActivityServiceHandlerClient registers the http handlers for service ActivityService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ActivityServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ActivityServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "ActivityServiceClient" to call the correct interceptors.
|
||||
func RegisterActivityServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ActivityServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_ActivityService_GetActivity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ActivityService/GetActivity", runtime.WithHTTPPathPattern("/api/v1/activities/{id}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_ActivityService_GetActivity_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ActivityService_GetActivity_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_ActivityService_GetActivity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "activities", "id"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_ActivityService_GetActivity_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
111
proto/gen/api/v1/activity_service_grpc.pb.go
Normal file
111
proto/gen/api/v1/activity_service_grpc.pb.go
Normal file
@@ -0,0 +1,111 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: api/v1/activity_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
ActivityService_GetActivity_FullMethodName = "/memos.api.v1.ActivityService/GetActivity"
|
||||
)
|
||||
|
||||
// ActivityServiceClient is the client API for ActivityService service.
|
||||
//
|
||||
// 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.
|
||||
type ActivityServiceClient interface {
|
||||
// GetActivity returns the activity with the given id.
|
||||
GetActivity(ctx context.Context, in *GetActivityRequest, opts ...grpc.CallOption) (*Activity, error)
|
||||
}
|
||||
|
||||
type activityServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewActivityServiceClient(cc grpc.ClientConnInterface) ActivityServiceClient {
|
||||
return &activityServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *activityServiceClient) GetActivity(ctx context.Context, in *GetActivityRequest, opts ...grpc.CallOption) (*Activity, error) {
|
||||
out := new(Activity)
|
||||
err := c.cc.Invoke(ctx, ActivityService_GetActivity_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ActivityServiceServer is the server API for ActivityService service.
|
||||
// All implementations must embed UnimplementedActivityServiceServer
|
||||
// for forward compatibility
|
||||
type ActivityServiceServer interface {
|
||||
// GetActivity returns the activity with the given id.
|
||||
GetActivity(context.Context, *GetActivityRequest) (*Activity, error)
|
||||
mustEmbedUnimplementedActivityServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedActivityServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedActivityServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedActivityServiceServer) GetActivity(context.Context, *GetActivityRequest) (*Activity, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetActivity not implemented")
|
||||
}
|
||||
func (UnimplementedActivityServiceServer) mustEmbedUnimplementedActivityServiceServer() {}
|
||||
|
||||
// UnsafeActivityServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ActivityServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeActivityServiceServer interface {
|
||||
mustEmbedUnimplementedActivityServiceServer()
|
||||
}
|
||||
|
||||
func RegisterActivityServiceServer(s grpc.ServiceRegistrar, srv ActivityServiceServer) {
|
||||
s.RegisterService(&ActivityService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ActivityService_GetActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetActivityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ActivityServiceServer).GetActivity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ActivityService_GetActivity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ActivityServiceServer).GetActivity(ctx, req.(*GetActivityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ActivityService_ServiceDesc is the grpc.ServiceDesc for ActivityService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ActivityService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memos.api.v1.ActivityService",
|
||||
HandlerType: (*ActivityServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetActivity",
|
||||
Handler: _ActivityService_GetActivity_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/activity_service.proto",
|
||||
}
|
||||
557
proto/gen/api/v1/auth_service.pb.go
Normal file
557
proto/gen/api/v1/auth_service.pb.go
Normal file
@@ -0,0 +1,557 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc (unknown)
|
||||
// source: api/v1/auth_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type GetAuthStatusRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *GetAuthStatusRequest) Reset() {
|
||||
*x = GetAuthStatusRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetAuthStatusRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAuthStatusRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetAuthStatusRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetAuthStatusRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetAuthStatusRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type GetAuthStatusResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetAuthStatusResponse) Reset() {
|
||||
*x = GetAuthStatusResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetAuthStatusResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAuthStatusResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetAuthStatusResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetAuthStatusResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetAuthStatusResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetAuthStatusResponse) GetUser() *User {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SignInRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The username to sign in with.
|
||||
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
|
||||
// The password to sign in with.
|
||||
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
||||
// Whether the session should never expire.
|
||||
NeverExpire bool `protobuf:"varint,3,opt,name=never_expire,json=neverExpire,proto3" json:"never_expire,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SignInRequest) Reset() {
|
||||
*x = SignInRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SignInRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SignInRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SignInRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SignInRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SignInRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SignInRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SignInRequest) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SignInRequest) GetNeverExpire() bool {
|
||||
if x != nil {
|
||||
return x.NeverExpire
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type SignInWithSSORequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The ID of the SSO provider.
|
||||
IdpId int32 `protobuf:"varint,1,opt,name=idp_id,json=idpId,proto3" json:"idp_id,omitempty"`
|
||||
// The code to sign in with.
|
||||
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
// The redirect URI.
|
||||
RedirectUri string `protobuf:"bytes,3,opt,name=redirect_uri,json=redirectUri,proto3" json:"redirect_uri,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SignInWithSSORequest) Reset() {
|
||||
*x = SignInWithSSORequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SignInWithSSORequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SignInWithSSORequest) ProtoMessage() {}
|
||||
|
||||
func (x *SignInWithSSORequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SignInWithSSORequest.ProtoReflect.Descriptor instead.
|
||||
func (*SignInWithSSORequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SignInWithSSORequest) GetIdpId() int32 {
|
||||
if x != nil {
|
||||
return x.IdpId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SignInWithSSORequest) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SignInWithSSORequest) GetRedirectUri() string {
|
||||
if x != nil {
|
||||
return x.RedirectUri
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SignUpRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The username to sign up with.
|
||||
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
|
||||
// The password to sign up with.
|
||||
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SignUpRequest) Reset() {
|
||||
*x = SignUpRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SignUpRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SignUpRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SignUpRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SignUpRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SignUpRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *SignUpRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SignUpRequest) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SignOutRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *SignOutRequest) Reset() {
|
||||
*x = SignOutRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SignOutRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SignOutRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SignOutRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_auth_service_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SignOutRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SignOutRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_api_v1_auth_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_v1_auth_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76,
|
||||
0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x75,
|
||||
0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12,
|
||||
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
|
||||
0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e,
|
||||
0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65,
|
||||
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65,
|
||||
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
||||
0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72,
|
||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x45, 0x78,
|
||||
0x70, 0x69, 0x72, 0x65, 0x22, 0x64, 0x0a, 0x14, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x57, 0x69,
|
||||
0x74, 0x68, 0x53, 0x53, 0x4f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06,
|
||||
0x69, 0x64, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x64,
|
||||
0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x64, 0x69, 0x72,
|
||||
0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72,
|
||||
0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x72, 0x69, 0x22, 0x47, 0x0a, 0x0d, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75,
|
||||
0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75,
|
||||
0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75, 0x74, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0xec, 0x03, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68,
|
||||
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
|
||||
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1b,
|
||||
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x56, 0x0a, 0x06, 0x53,
|
||||
0x69, 0x67, 0x6e, 0x49, 0x6e, 0x12, 0x1b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x69, 0x67,
|
||||
0x6e, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x57, 0x69, 0x74,
|
||||
0x68, 0x53, 0x53, 0x4f, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x53, 0x53,
|
||||
0x4f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1f, 0x82, 0xd3,
|
||||
0xe4, 0x93, 0x02, 0x19, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75,
|
||||
0x74, 0x68, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x2f, 0x73, 0x73, 0x6f, 0x12, 0x56, 0x0a,
|
||||
0x06, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x12, 0x1b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15,
|
||||
0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73,
|
||||
0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x5d, 0x0a, 0x07, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75, 0x74,
|
||||
0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x14,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x69, 0x67,
|
||||
0x6e, 0x6f, 0x75, 0x74, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x41, 0x75, 0x74, 0x68, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67,
|
||||
0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2,
|
||||
0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70,
|
||||
0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69,
|
||||
0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c,
|
||||
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
||||
0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_v1_auth_service_proto_rawDescOnce sync.Once
|
||||
file_api_v1_auth_service_proto_rawDescData = file_api_v1_auth_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_v1_auth_service_proto_rawDescGZIP() []byte {
|
||||
file_api_v1_auth_service_proto_rawDescOnce.Do(func() {
|
||||
file_api_v1_auth_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_auth_service_proto_rawDescData)
|
||||
})
|
||||
return file_api_v1_auth_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_api_v1_auth_service_proto_goTypes = []interface{}{
|
||||
(*GetAuthStatusRequest)(nil), // 0: memos.api.v1.GetAuthStatusRequest
|
||||
(*GetAuthStatusResponse)(nil), // 1: memos.api.v1.GetAuthStatusResponse
|
||||
(*SignInRequest)(nil), // 2: memos.api.v1.SignInRequest
|
||||
(*SignInWithSSORequest)(nil), // 3: memos.api.v1.SignInWithSSORequest
|
||||
(*SignUpRequest)(nil), // 4: memos.api.v1.SignUpRequest
|
||||
(*SignOutRequest)(nil), // 5: memos.api.v1.SignOutRequest
|
||||
(*User)(nil), // 6: memos.api.v1.User
|
||||
(*emptypb.Empty)(nil), // 7: google.protobuf.Empty
|
||||
}
|
||||
var file_api_v1_auth_service_proto_depIdxs = []int32{
|
||||
6, // 0: memos.api.v1.GetAuthStatusResponse.user:type_name -> memos.api.v1.User
|
||||
0, // 1: memos.api.v1.AuthService.GetAuthStatus:input_type -> memos.api.v1.GetAuthStatusRequest
|
||||
2, // 2: memos.api.v1.AuthService.SignIn:input_type -> memos.api.v1.SignInRequest
|
||||
3, // 3: memos.api.v1.AuthService.SignInWithSSO:input_type -> memos.api.v1.SignInWithSSORequest
|
||||
4, // 4: memos.api.v1.AuthService.SignUp:input_type -> memos.api.v1.SignUpRequest
|
||||
5, // 5: memos.api.v1.AuthService.SignOut:input_type -> memos.api.v1.SignOutRequest
|
||||
6, // 6: memos.api.v1.AuthService.GetAuthStatus:output_type -> memos.api.v1.User
|
||||
6, // 7: memos.api.v1.AuthService.SignIn:output_type -> memos.api.v1.User
|
||||
6, // 8: memos.api.v1.AuthService.SignInWithSSO:output_type -> memos.api.v1.User
|
||||
6, // 9: memos.api.v1.AuthService.SignUp:output_type -> memos.api.v1.User
|
||||
7, // 10: memos.api.v1.AuthService.SignOut:output_type -> google.protobuf.Empty
|
||||
6, // [6:11] is the sub-list for method output_type
|
||||
1, // [1:6] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_auth_service_proto_init() }
|
||||
func file_api_v1_auth_service_proto_init() {
|
||||
if File_api_v1_auth_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_v1_user_service_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_v1_auth_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetAuthStatusRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_auth_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetAuthStatusResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_auth_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SignInRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_auth_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SignInWithSSORequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_auth_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SignUpRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_auth_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SignOutRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_v1_auth_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_v1_auth_service_proto_goTypes,
|
||||
DependencyIndexes: file_api_v1_auth_service_proto_depIdxs,
|
||||
MessageInfos: file_api_v1_auth_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_v1_auth_service_proto = out.File
|
||||
file_api_v1_auth_service_proto_rawDesc = nil
|
||||
file_api_v1_auth_service_proto_goTypes = nil
|
||||
file_api_v1_auth_service_proto_depIdxs = nil
|
||||
}
|
||||
485
proto/gen/api/v1/auth_service.pb.gw.go
Normal file
485
proto/gen/api/v1/auth_service.pb.gw.go
Normal file
@@ -0,0 +1,485 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/v1/auth_service.proto
|
||||
|
||||
/*
|
||||
Package apiv1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = metadata.Join
|
||||
|
||||
func request_AuthService_GetAuthStatus_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAuthStatusRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.GetAuthStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_GetAuthStatus_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAuthStatusRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.GetAuthStatus(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_AuthService_SignIn_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_AuthService_SignIn_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignInRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_SignIn_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SignIn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_SignIn_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignInRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_SignIn_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SignIn(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_AuthService_SignInWithSSO_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_AuthService_SignInWithSSO_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignInWithSSORequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_SignInWithSSO_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SignInWithSSO(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_SignInWithSSO_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignInWithSSORequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_SignInWithSSO_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SignInWithSSO(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_AuthService_SignUp_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_AuthService_SignUp_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignUpRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_SignUp_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SignUp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_SignUp_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignUpRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_SignUp_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SignUp(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_AuthService_SignOut_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignOutRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.SignOut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_SignOut_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SignOutRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.SignOut(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux".
|
||||
// UnaryRPC :call AuthServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead.
|
||||
func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_GetAuthStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v1/auth/status"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_AuthService_GetAuthStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_GetAuthStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v1/auth/signin"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_AuthService_SignIn_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignIn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignInWithSSO_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignInWithSSO", runtime.WithHTTPPathPattern("/api/v1/auth/signin/sso"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_AuthService_SignInWithSSO_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignInWithSSO_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignUp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_AuthService_SignUp_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignUp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignOut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v1/auth/signout"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_AuthService_SignOut_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignOut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterAuthServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterAuthServiceHandler registers the http handlers for service AuthService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterAuthServiceHandlerClient(ctx, mux, NewAuthServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterAuthServiceHandlerClient registers the http handlers for service AuthService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "AuthServiceClient" to call the correct interceptors.
|
||||
func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_GetAuthStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v1/auth/status"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_AuthService_GetAuthStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_GetAuthStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v1/auth/signin"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_AuthService_SignIn_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignIn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignInWithSSO_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignInWithSSO", runtime.WithHTTPPathPattern("/api/v1/auth/signin/sso"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_AuthService_SignInWithSSO_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignInWithSSO_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignUp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_AuthService_SignUp_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignUp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_SignOut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v1/auth/signout"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_AuthService_SignOut_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_SignOut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_AuthService_GetAuthStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "status"}, ""))
|
||||
|
||||
pattern_AuthService_SignIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signin"}, ""))
|
||||
|
||||
pattern_AuthService_SignInWithSSO_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "auth", "signin", "sso"}, ""))
|
||||
|
||||
pattern_AuthService_SignUp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signup"}, ""))
|
||||
|
||||
pattern_AuthService_SignOut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signout"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_AuthService_GetAuthStatus_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_AuthService_SignIn_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_AuthService_SignInWithSSO_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_AuthService_SignUp_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_AuthService_SignOut_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
268
proto/gen/api/v1/auth_service_grpc.pb.go
Normal file
268
proto/gen/api/v1/auth_service_grpc.pb.go
Normal file
@@ -0,0 +1,268 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: api/v1/auth_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
AuthService_GetAuthStatus_FullMethodName = "/memos.api.v1.AuthService/GetAuthStatus"
|
||||
AuthService_SignIn_FullMethodName = "/memos.api.v1.AuthService/SignIn"
|
||||
AuthService_SignInWithSSO_FullMethodName = "/memos.api.v1.AuthService/SignInWithSSO"
|
||||
AuthService_SignUp_FullMethodName = "/memos.api.v1.AuthService/SignUp"
|
||||
AuthService_SignOut_FullMethodName = "/memos.api.v1.AuthService/SignOut"
|
||||
)
|
||||
|
||||
// AuthServiceClient is the client API for AuthService service.
|
||||
//
|
||||
// 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.
|
||||
type AuthServiceClient interface {
|
||||
// GetAuthStatus returns the current auth status of the user.
|
||||
GetAuthStatus(ctx context.Context, in *GetAuthStatusRequest, opts ...grpc.CallOption) (*User, error)
|
||||
// SignIn signs in the user with the given username and password.
|
||||
SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*User, error)
|
||||
// SignInWithSSO signs in the user with the given SSO code.
|
||||
SignInWithSSO(ctx context.Context, in *SignInWithSSORequest, opts ...grpc.CallOption) (*User, error)
|
||||
// SignUp signs up the user with the given username and password.
|
||||
SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*User, error)
|
||||
// SignOut signs out the user.
|
||||
SignOut(ctx context.Context, in *SignOutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type authServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||||
return &authServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetAuthStatus(ctx context.Context, in *GetAuthStatusRequest, opts ...grpc.CallOption) (*User, error) {
|
||||
out := new(User)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetAuthStatus_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*User, error) {
|
||||
out := new(User)
|
||||
err := c.cc.Invoke(ctx, AuthService_SignIn_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) SignInWithSSO(ctx context.Context, in *SignInWithSSORequest, opts ...grpc.CallOption) (*User, error) {
|
||||
out := new(User)
|
||||
err := c.cc.Invoke(ctx, AuthService_SignInWithSSO_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*User, error) {
|
||||
out := new(User)
|
||||
err := c.cc.Invoke(ctx, AuthService_SignUp_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) SignOut(ctx context.Context, in *SignOutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, AuthService_SignOut_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthServiceServer is the server API for AuthService service.
|
||||
// All implementations must embed UnimplementedAuthServiceServer
|
||||
// for forward compatibility
|
||||
type AuthServiceServer interface {
|
||||
// GetAuthStatus returns the current auth status of the user.
|
||||
GetAuthStatus(context.Context, *GetAuthStatusRequest) (*User, error)
|
||||
// SignIn signs in the user with the given username and password.
|
||||
SignIn(context.Context, *SignInRequest) (*User, error)
|
||||
// SignInWithSSO signs in the user with the given SSO code.
|
||||
SignInWithSSO(context.Context, *SignInWithSSORequest) (*User, error)
|
||||
// SignUp signs up the user with the given username and password.
|
||||
SignUp(context.Context, *SignUpRequest) (*User, error)
|
||||
// SignOut signs out the user.
|
||||
SignOut(context.Context, *SignOutRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedAuthServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedAuthServiceServer) GetAuthStatus(context.Context, *GetAuthStatusRequest) (*User, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetAuthStatus not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) SignIn(context.Context, *SignInRequest) (*User, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) SignInWithSSO(context.Context, *SignInWithSSORequest) (*User, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignInWithSSO not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) SignUp(context.Context, *SignUpRequest) (*User, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignUp not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) SignOut(context.Context, *SignOutRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignOut not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||
|
||||
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuthServiceServer interface {
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||||
s.RegisterService(&AuthService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuthService_GetAuthStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAuthStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetAuthStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetAuthStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetAuthStatus(ctx, req.(*GetAuthStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignInRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).SignIn(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_SignIn_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).SignIn(ctx, req.(*SignInRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_SignInWithSSO_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignInWithSSORequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).SignInWithSSO(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_SignInWithSSO_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).SignInWithSSO(ctx, req.(*SignInWithSSORequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignUpRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).SignUp(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_SignUp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).SignUp(ctx, req.(*SignUpRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_SignOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignOutRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).SignOut(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_SignOut_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).SignOut(ctx, req.(*SignOutRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memos.api.v1.AuthService",
|
||||
HandlerType: (*AuthServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetAuthStatus",
|
||||
Handler: _AuthService_GetAuthStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignIn",
|
||||
Handler: _AuthService_SignIn_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignInWithSSO",
|
||||
Handler: _AuthService_SignInWithSSO_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignUp",
|
||||
Handler: _AuthService_SignUp_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignOut",
|
||||
Handler: _AuthService_SignOut_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/auth_service.proto",
|
||||
}
|
||||
218
proto/gen/api/v1/common.pb.go
Normal file
218
proto/gen/api/v1/common.pb.go
Normal file
@@ -0,0 +1,218 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc (unknown)
|
||||
// source: api/v1/common.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type RowStatus int32
|
||||
|
||||
const (
|
||||
RowStatus_ROW_STATUS_UNSPECIFIED RowStatus = 0
|
||||
RowStatus_ACTIVE RowStatus = 1
|
||||
RowStatus_ARCHIVED RowStatus = 2
|
||||
)
|
||||
|
||||
// Enum value maps for RowStatus.
|
||||
var (
|
||||
RowStatus_name = map[int32]string{
|
||||
0: "ROW_STATUS_UNSPECIFIED",
|
||||
1: "ACTIVE",
|
||||
2: "ARCHIVED",
|
||||
}
|
||||
RowStatus_value = map[string]int32{
|
||||
"ROW_STATUS_UNSPECIFIED": 0,
|
||||
"ACTIVE": 1,
|
||||
"ARCHIVED": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x RowStatus) Enum() *RowStatus {
|
||||
p := new(RowStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x RowStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (RowStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_v1_common_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (RowStatus) Type() protoreflect.EnumType {
|
||||
return &file_api_v1_common_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x RowStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RowStatus.Descriptor instead.
|
||||
func (RowStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_v1_common_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// Used internally for obfuscating the page token.
|
||||
type PageToken struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PageToken) Reset() {
|
||||
*x = PageToken{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_common_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PageToken) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PageToken) ProtoMessage() {}
|
||||
|
||||
func (x *PageToken) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_common_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PageToken.ProtoReflect.Descriptor instead.
|
||||
func (*PageToken) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_common_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *PageToken) GetLimit() int32 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PageToken) GetOffset() int32 {
|
||||
if x != nil {
|
||||
return x.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_api_v1_common_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_v1_common_proto_rawDesc = []byte{
|
||||
0x0a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x76, 0x31, 0x22, 0x39, 0x0a, 0x09, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2a, 0x41,
|
||||
0x0a, 0x09, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x16, 0x52,
|
||||
0x4f, 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
|
||||
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56,
|
||||
0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10,
|
||||
0x02, 0x42, 0xa3, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
|
||||
0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c,
|
||||
0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d,
|
||||
0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65,
|
||||
0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
|
||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a,
|
||||
0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_v1_common_proto_rawDescOnce sync.Once
|
||||
file_api_v1_common_proto_rawDescData = file_api_v1_common_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_v1_common_proto_rawDescGZIP() []byte {
|
||||
file_api_v1_common_proto_rawDescOnce.Do(func() {
|
||||
file_api_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_common_proto_rawDescData)
|
||||
})
|
||||
return file_api_v1_common_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_api_v1_common_proto_goTypes = []interface{}{
|
||||
(RowStatus)(0), // 0: memos.api.v1.RowStatus
|
||||
(*PageToken)(nil), // 1: memos.api.v1.PageToken
|
||||
}
|
||||
var file_api_v1_common_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_common_proto_init() }
|
||||
func file_api_v1_common_proto_init() {
|
||||
if File_api_v1_common_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PageToken); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_v1_common_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_v1_common_proto_goTypes,
|
||||
DependencyIndexes: file_api_v1_common_proto_depIdxs,
|
||||
EnumInfos: file_api_v1_common_proto_enumTypes,
|
||||
MessageInfos: file_api_v1_common_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_v1_common_proto = out.File
|
||||
file_api_v1_common_proto_rawDesc = nil
|
||||
file_api_v1_common_proto_goTypes = nil
|
||||
file_api_v1_common_proto_depIdxs = nil
|
||||
}
|
||||
1030
proto/gen/api/v1/idp_service.pb.go
Normal file
1030
proto/gen/api/v1/idp_service.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
589
proto/gen/api/v1/idp_service.pb.gw.go
Normal file
589
proto/gen/api/v1/idp_service.pb.gw.go
Normal file
@@ -0,0 +1,589 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/v1/idp_service.proto
|
||||
|
||||
/*
|
||||
Package apiv1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = metadata.Join
|
||||
|
||||
func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListIdentityProvidersRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.ListIdentityProviders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListIdentityProvidersRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.ListIdentityProviders(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetIdentityProvider(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.IdentityProvider); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.CreateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.IdentityProvider); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.CreateIdentityProvider(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_IdentityProviderService_UpdateIdentityProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{"identity_provider": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
|
||||
)
|
||||
|
||||
func request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IdentityProvider); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["identity_provider.name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identity_provider.name")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "identity_provider.name", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identity_provider.name", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IdentityProvider); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["identity_provider.name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identity_provider.name")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "identity_provider.name", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identity_provider.name", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateIdentityProvider(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := client.DeleteIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteIdentityProviderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := server.DeleteIdentityProvider(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterIdentityProviderServiceHandlerServer registers the http handlers for service IdentityProviderService to "mux".
|
||||
// UnaryRPC :call IdentityProviderServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIdentityProviderServiceHandlerFromEndpoint instead.
|
||||
func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IdentityProviderServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_IdentityProviderService_ListIdentityProviders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_IdentityProviderService_ListIdentityProviders_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_ListIdentityProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_IdentityProviderService_GetIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_IdentityProviderService_GetIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_GetIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_IdentityProviderService_CreateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_IdentityProviderService_UpdateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{identity_provider.name=identityProviders/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_IdentityProviderService_DeleteIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterIdentityProviderServiceHandlerFromEndpoint is same as RegisterIdentityProviderServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterIdentityProviderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterIdentityProviderServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterIdentityProviderServiceHandler registers the http handlers for service IdentityProviderService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterIdentityProviderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterIdentityProviderServiceHandlerClient(ctx, mux, NewIdentityProviderServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterIdentityProviderServiceHandlerClient registers the http handlers for service IdentityProviderService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IdentityProviderServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IdentityProviderServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "IdentityProviderServiceClient" to call the correct interceptors.
|
||||
func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IdentityProviderServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_IdentityProviderService_ListIdentityProviders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_IdentityProviderService_ListIdentityProviders_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_ListIdentityProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_IdentityProviderService_GetIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_IdentityProviderService_GetIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_GetIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_IdentityProviderService_CreateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_IdentityProviderService_UpdateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{identity_provider.name=identityProviders/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_IdentityProviderService_DeleteIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_IdentityProviderService_ListIdentityProviders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "identityProviders"}, ""))
|
||||
|
||||
pattern_IdentityProviderService_GetIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "identityProviders", "name"}, ""))
|
||||
|
||||
pattern_IdentityProviderService_CreateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "identityProviders"}, ""))
|
||||
|
||||
pattern_IdentityProviderService_UpdateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "identityProviders", "identity_provider.name"}, ""))
|
||||
|
||||
pattern_IdentityProviderService_DeleteIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "identityProviders", "name"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_IdentityProviderService_ListIdentityProviders_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_IdentityProviderService_GetIdentityProvider_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_IdentityProviderService_CreateIdentityProvider_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_IdentityProviderService_UpdateIdentityProvider_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_IdentityProviderService_DeleteIdentityProvider_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
269
proto/gen/api/v1/idp_service_grpc.pb.go
Normal file
269
proto/gen/api/v1/idp_service_grpc.pb.go
Normal file
@@ -0,0 +1,269 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: api/v1/idp_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
IdentityProviderService_ListIdentityProviders_FullMethodName = "/memos.api.v1.IdentityProviderService/ListIdentityProviders"
|
||||
IdentityProviderService_GetIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/GetIdentityProvider"
|
||||
IdentityProviderService_CreateIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/CreateIdentityProvider"
|
||||
IdentityProviderService_UpdateIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider"
|
||||
IdentityProviderService_DeleteIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider"
|
||||
)
|
||||
|
||||
// IdentityProviderServiceClient is the client API for IdentityProviderService service.
|
||||
//
|
||||
// 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.
|
||||
type IdentityProviderServiceClient interface {
|
||||
// ListIdentityProviders lists identity providers.
|
||||
ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error)
|
||||
// GetIdentityProvider gets an identity provider.
|
||||
GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error)
|
||||
// CreateIdentityProvider creates an identity provider.
|
||||
CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error)
|
||||
// UpdateIdentityProvider updates an identity provider.
|
||||
UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error)
|
||||
// DeleteIdentityProvider deletes an identity provider.
|
||||
DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type identityProviderServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewIdentityProviderServiceClient(cc grpc.ClientConnInterface) IdentityProviderServiceClient {
|
||||
return &identityProviderServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *identityProviderServiceClient) ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error) {
|
||||
out := new(ListIdentityProvidersResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityProviderService_ListIdentityProviders_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityProviderServiceClient) GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error) {
|
||||
out := new(IdentityProvider)
|
||||
err := c.cc.Invoke(ctx, IdentityProviderService_GetIdentityProvider_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityProviderServiceClient) CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error) {
|
||||
out := new(IdentityProvider)
|
||||
err := c.cc.Invoke(ctx, IdentityProviderService_CreateIdentityProvider_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityProviderServiceClient) UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*IdentityProvider, error) {
|
||||
out := new(IdentityProvider)
|
||||
err := c.cc.Invoke(ctx, IdentityProviderService_UpdateIdentityProvider_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityProviderServiceClient) DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, IdentityProviderService_DeleteIdentityProvider_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// IdentityProviderServiceServer is the server API for IdentityProviderService service.
|
||||
// All implementations must embed UnimplementedIdentityProviderServiceServer
|
||||
// for forward compatibility
|
||||
type IdentityProviderServiceServer interface {
|
||||
// ListIdentityProviders lists identity providers.
|
||||
ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error)
|
||||
// GetIdentityProvider gets an identity provider.
|
||||
GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*IdentityProvider, error)
|
||||
// CreateIdentityProvider creates an identity provider.
|
||||
CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*IdentityProvider, error)
|
||||
// UpdateIdentityProvider updates an identity provider.
|
||||
UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*IdentityProvider, error)
|
||||
// DeleteIdentityProvider deletes an identity provider.
|
||||
DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedIdentityProviderServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedIdentityProviderServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedIdentityProviderServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedIdentityProviderServiceServer) ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListIdentityProviders not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityProviderServiceServer) GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*IdentityProvider, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetIdentityProvider not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityProviderServiceServer) CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*IdentityProvider, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateIdentityProvider not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityProviderServiceServer) UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*IdentityProvider, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateIdentityProvider not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityProviderServiceServer) DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteIdentityProvider not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityProviderServiceServer) mustEmbedUnimplementedIdentityProviderServiceServer() {
|
||||
}
|
||||
|
||||
// UnsafeIdentityProviderServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to IdentityProviderServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeIdentityProviderServiceServer interface {
|
||||
mustEmbedUnimplementedIdentityProviderServiceServer()
|
||||
}
|
||||
|
||||
func RegisterIdentityProviderServiceServer(s grpc.ServiceRegistrar, srv IdentityProviderServiceServer) {
|
||||
s.RegisterService(&IdentityProviderService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _IdentityProviderService_ListIdentityProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListIdentityProvidersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityProviderService_ListIdentityProviders_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, req.(*ListIdentityProvidersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityProviderService_GetIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetIdentityProviderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityProviderService_GetIdentityProvider_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, req.(*GetIdentityProviderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityProviderService_CreateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateIdentityProviderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityProviderService_CreateIdentityProvider_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, req.(*CreateIdentityProviderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityProviderService_UpdateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateIdentityProviderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityProviderService_UpdateIdentityProvider_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, req.(*UpdateIdentityProviderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityProviderService_DeleteIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteIdentityProviderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityProviderService_DeleteIdentityProvider_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, req.(*DeleteIdentityProviderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// IdentityProviderService_ServiceDesc is the grpc.ServiceDesc for IdentityProviderService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var IdentityProviderService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memos.api.v1.IdentityProviderService",
|
||||
HandlerType: (*IdentityProviderServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListIdentityProviders",
|
||||
Handler: _IdentityProviderService_ListIdentityProviders_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetIdentityProvider",
|
||||
Handler: _IdentityProviderService_GetIdentityProvider_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateIdentityProvider",
|
||||
Handler: _IdentityProviderService_CreateIdentityProvider_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateIdentityProvider",
|
||||
Handler: _IdentityProviderService_UpdateIdentityProvider_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteIdentityProvider",
|
||||
Handler: _IdentityProviderService_DeleteIdentityProvider_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/idp_service.proto",
|
||||
}
|
||||
652
proto/gen/api/v1/inbox_service.pb.go
Normal file
652
proto/gen/api/v1/inbox_service.pb.go
Normal file
@@ -0,0 +1,652 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc (unknown)
|
||||
// source: api/v1/inbox_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Inbox_Status int32
|
||||
|
||||
const (
|
||||
Inbox_STATUS_UNSPECIFIED Inbox_Status = 0
|
||||
Inbox_UNREAD Inbox_Status = 1
|
||||
Inbox_ARCHIVED Inbox_Status = 2
|
||||
)
|
||||
|
||||
// Enum value maps for Inbox_Status.
|
||||
var (
|
||||
Inbox_Status_name = map[int32]string{
|
||||
0: "STATUS_UNSPECIFIED",
|
||||
1: "UNREAD",
|
||||
2: "ARCHIVED",
|
||||
}
|
||||
Inbox_Status_value = map[string]int32{
|
||||
"STATUS_UNSPECIFIED": 0,
|
||||
"UNREAD": 1,
|
||||
"ARCHIVED": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Inbox_Status) Enum() *Inbox_Status {
|
||||
p := new(Inbox_Status)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Inbox_Status) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Inbox_Status) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_v1_inbox_service_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Inbox_Status) Type() protoreflect.EnumType {
|
||||
return &file_api_v1_inbox_service_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Inbox_Status) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Inbox_Status.Descriptor instead.
|
||||
func (Inbox_Status) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
type Inbox_Type int32
|
||||
|
||||
const (
|
||||
Inbox_TYPE_UNSPECIFIED Inbox_Type = 0
|
||||
Inbox_MEMO_COMMENT Inbox_Type = 1
|
||||
Inbox_VERSION_UPDATE Inbox_Type = 2
|
||||
)
|
||||
|
||||
// Enum value maps for Inbox_Type.
|
||||
var (
|
||||
Inbox_Type_name = map[int32]string{
|
||||
0: "TYPE_UNSPECIFIED",
|
||||
1: "MEMO_COMMENT",
|
||||
2: "VERSION_UPDATE",
|
||||
}
|
||||
Inbox_Type_value = map[string]int32{
|
||||
"TYPE_UNSPECIFIED": 0,
|
||||
"MEMO_COMMENT": 1,
|
||||
"VERSION_UPDATE": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Inbox_Type) Enum() *Inbox_Type {
|
||||
p := new(Inbox_Type)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Inbox_Type) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Inbox_Type) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_v1_inbox_service_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (Inbox_Type) Type() protoreflect.EnumType {
|
||||
return &file_api_v1_inbox_service_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x Inbox_Type) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Inbox_Type.Descriptor instead.
|
||||
func (Inbox_Type) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{0, 1}
|
||||
}
|
||||
|
||||
type Inbox struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The name of the inbox.
|
||||
// Format: inboxes/{id}
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
// Format: users/{id}
|
||||
Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
|
||||
// Format: users/{id}
|
||||
Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"`
|
||||
Status Inbox_Status `protobuf:"varint,4,opt,name=status,proto3,enum=memos.api.v1.Inbox_Status" json:"status,omitempty"`
|
||||
CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
|
||||
Type Inbox_Type `protobuf:"varint,6,opt,name=type,proto3,enum=memos.api.v1.Inbox_Type" json:"type,omitempty"`
|
||||
ActivityId *int32 `protobuf:"varint,7,opt,name=activity_id,json=activityId,proto3,oneof" json:"activity_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Inbox) Reset() {
|
||||
*x = Inbox{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Inbox) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Inbox) ProtoMessage() {}
|
||||
|
||||
func (x *Inbox) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Inbox.ProtoReflect.Descriptor instead.
|
||||
func (*Inbox) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Inbox) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Inbox) GetSender() string {
|
||||
if x != nil {
|
||||
return x.Sender
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Inbox) GetReceiver() string {
|
||||
if x != nil {
|
||||
return x.Receiver
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Inbox) GetStatus() Inbox_Status {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return Inbox_STATUS_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Inbox) GetCreateTime() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreateTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Inbox) GetType() Inbox_Type {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return Inbox_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Inbox) GetActivityId() int32 {
|
||||
if x != nil && x.ActivityId != nil {
|
||||
return *x.ActivityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListInboxesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Format: users/{id}
|
||||
User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListInboxesRequest) Reset() {
|
||||
*x = ListInboxesRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListInboxesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListInboxesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListInboxesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListInboxesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListInboxesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ListInboxesRequest) GetUser() string {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListInboxesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Inboxes []*Inbox `protobuf:"bytes,1,rep,name=inboxes,proto3" json:"inboxes,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListInboxesResponse) Reset() {
|
||||
*x = ListInboxesResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListInboxesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListInboxesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListInboxesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListInboxesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListInboxesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListInboxesResponse) GetInboxes() []*Inbox {
|
||||
if x != nil {
|
||||
return x.Inboxes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateInboxRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Inbox *Inbox `protobuf:"bytes,1,opt,name=inbox,proto3" json:"inbox,omitempty"`
|
||||
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UpdateInboxRequest) Reset() {
|
||||
*x = UpdateInboxRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UpdateInboxRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateInboxRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateInboxRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateInboxRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateInboxRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *UpdateInboxRequest) GetInbox() *Inbox {
|
||||
if x != nil {
|
||||
return x.Inbox
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UpdateInboxRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
|
||||
if x != nil {
|
||||
return x.UpdateMask
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DeleteInboxRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The name of the inbox to delete.
|
||||
// Format: inboxes/{id}
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeleteInboxRequest) Reset() {
|
||||
*x = DeleteInboxRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeleteInboxRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteInboxRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteInboxRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_inbox_service_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteInboxRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteInboxRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_inbox_service_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *DeleteInboxRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_api_v1_inbox_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_v1_inbox_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65,
|
||||
0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xa4, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
|
||||
0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
|
||||
0x76, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
|
||||
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74,
|
||||
0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
|
||||
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,
|
||||
0x70, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76,
|
||||
0x69, 0x74, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x3a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53,
|
||||
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x4e,
|
||||
0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56,
|
||||
0x45, 0x44, 0x10, 0x02, 0x22, 0x42, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10,
|
||||
0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
|
||||
0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45,
|
||||
0x4e, 0x54, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f,
|
||||
0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63, 0x74,
|
||||
0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73,
|
||||
0x65, 0x72, 0x22, 0x44, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65,
|
||||
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x69, 0x6e, 0x62,
|
||||
0x6f, 0x78, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52,
|
||||
0x07, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x22, 0x7c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29,
|
||||
0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
|
||||
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62,
|
||||
0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x28, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
||||
0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x32, 0xf7, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x6b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73,
|
||||
0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x87,
|
||||
0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20,
|
||||
0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x49, 0x6e, 0x62, 0x6f, 0x78, 0x22, 0x41, 0xda, 0x41, 0x11, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2c,
|
||||
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||
0x27, 0x3a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x32, 0x1e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
|
||||
0x31, 0x2f, 0x7b, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e,
|
||||
0x62, 0x6f, 0x78, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65,
|
||||
0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62,
|
||||
0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
|
||||
0x79, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a,
|
||||
0x2a, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
|
||||
0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63,
|
||||
0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42,
|
||||
0x11, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31,
|
||||
0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d,
|
||||
0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65,
|
||||
0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
|
||||
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41,
|
||||
0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_v1_inbox_service_proto_rawDescOnce sync.Once
|
||||
file_api_v1_inbox_service_proto_rawDescData = file_api_v1_inbox_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_v1_inbox_service_proto_rawDescGZIP() []byte {
|
||||
file_api_v1_inbox_service_proto_rawDescOnce.Do(func() {
|
||||
file_api_v1_inbox_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_inbox_service_proto_rawDescData)
|
||||
})
|
||||
return file_api_v1_inbox_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_v1_inbox_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_api_v1_inbox_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_api_v1_inbox_service_proto_goTypes = []interface{}{
|
||||
(Inbox_Status)(0), // 0: memos.api.v1.Inbox.Status
|
||||
(Inbox_Type)(0), // 1: memos.api.v1.Inbox.Type
|
||||
(*Inbox)(nil), // 2: memos.api.v1.Inbox
|
||||
(*ListInboxesRequest)(nil), // 3: memos.api.v1.ListInboxesRequest
|
||||
(*ListInboxesResponse)(nil), // 4: memos.api.v1.ListInboxesResponse
|
||||
(*UpdateInboxRequest)(nil), // 5: memos.api.v1.UpdateInboxRequest
|
||||
(*DeleteInboxRequest)(nil), // 6: memos.api.v1.DeleteInboxRequest
|
||||
(*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp
|
||||
(*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask
|
||||
(*emptypb.Empty)(nil), // 9: google.protobuf.Empty
|
||||
}
|
||||
var file_api_v1_inbox_service_proto_depIdxs = []int32{
|
||||
0, // 0: memos.api.v1.Inbox.status:type_name -> memos.api.v1.Inbox.Status
|
||||
7, // 1: memos.api.v1.Inbox.create_time:type_name -> google.protobuf.Timestamp
|
||||
1, // 2: memos.api.v1.Inbox.type:type_name -> memos.api.v1.Inbox.Type
|
||||
2, // 3: memos.api.v1.ListInboxesResponse.inboxes:type_name -> memos.api.v1.Inbox
|
||||
2, // 4: memos.api.v1.UpdateInboxRequest.inbox:type_name -> memos.api.v1.Inbox
|
||||
8, // 5: memos.api.v1.UpdateInboxRequest.update_mask:type_name -> google.protobuf.FieldMask
|
||||
3, // 6: memos.api.v1.InboxService.ListInboxes:input_type -> memos.api.v1.ListInboxesRequest
|
||||
5, // 7: memos.api.v1.InboxService.UpdateInbox:input_type -> memos.api.v1.UpdateInboxRequest
|
||||
6, // 8: memos.api.v1.InboxService.DeleteInbox:input_type -> memos.api.v1.DeleteInboxRequest
|
||||
4, // 9: memos.api.v1.InboxService.ListInboxes:output_type -> memos.api.v1.ListInboxesResponse
|
||||
2, // 10: memos.api.v1.InboxService.UpdateInbox:output_type -> memos.api.v1.Inbox
|
||||
9, // 11: memos.api.v1.InboxService.DeleteInbox:output_type -> google.protobuf.Empty
|
||||
9, // [9:12] is the sub-list for method output_type
|
||||
6, // [6:9] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_inbox_service_proto_init() }
|
||||
func file_api_v1_inbox_service_proto_init() {
|
||||
if File_api_v1_inbox_service_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_v1_inbox_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Inbox); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_inbox_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListInboxesRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_inbox_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListInboxesResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_inbox_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UpdateInboxRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_v1_inbox_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeleteInboxRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_api_v1_inbox_service_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_v1_inbox_service_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_v1_inbox_service_proto_goTypes,
|
||||
DependencyIndexes: file_api_v1_inbox_service_proto_depIdxs,
|
||||
EnumInfos: file_api_v1_inbox_service_proto_enumTypes,
|
||||
MessageInfos: file_api_v1_inbox_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_v1_inbox_service_proto = out.File
|
||||
file_api_v1_inbox_service_proto_rawDesc = nil
|
||||
file_api_v1_inbox_service_proto_goTypes = nil
|
||||
file_api_v1_inbox_service_proto_depIdxs = nil
|
||||
}
|
||||
427
proto/gen/api/v1/inbox_service.pb.gw.go
Normal file
427
proto/gen/api/v1/inbox_service.pb.gw.go
Normal file
@@ -0,0 +1,427 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/v1/inbox_service.proto
|
||||
|
||||
/*
|
||||
Package apiv1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = metadata.Join
|
||||
|
||||
var (
|
||||
filter_InboxService_ListInboxes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_InboxService_ListInboxes_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListInboxesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_ListInboxes_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListInboxes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_InboxService_ListInboxes_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListInboxesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_ListInboxes_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListInboxes(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_InboxService_UpdateInbox_0 = &utilities.DoubleArray{Encoding: map[string]int{"inbox": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
|
||||
)
|
||||
|
||||
func request_InboxService_UpdateInbox_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateInboxRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Inbox); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Inbox); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["inbox.name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "inbox.name")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "inbox.name", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "inbox.name", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_UpdateInbox_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateInbox(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_InboxService_UpdateInbox_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateInboxRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Inbox); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Inbox); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["inbox.name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "inbox.name")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "inbox.name", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "inbox.name", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_UpdateInbox_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateInbox(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_InboxService_DeleteInbox_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteInboxRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := client.DeleteInbox(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_InboxService_DeleteInbox_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteInboxRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := server.DeleteInbox(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterInboxServiceHandlerServer registers the http handlers for service InboxService to "mux".
|
||||
// UnaryRPC :call InboxServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInboxServiceHandlerFromEndpoint instead.
|
||||
func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InboxServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_InboxService_ListInboxes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v1/inboxes"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_InboxService_ListInboxes_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_InboxService_ListInboxes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_InboxService_UpdateInbox_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/api/v1/{inbox.name=inboxes/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_InboxService_UpdateInbox_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_InboxService_UpdateInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_InboxService_DeleteInbox_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/api/v1/{name=inboxes/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_InboxService_DeleteInbox_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_InboxService_DeleteInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterInboxServiceHandlerFromEndpoint is same as RegisterInboxServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterInboxServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterInboxServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterInboxServiceHandler registers the http handlers for service InboxService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterInboxServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterInboxServiceHandlerClient(ctx, mux, NewInboxServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterInboxServiceHandlerClient registers the http handlers for service InboxService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InboxServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InboxServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "InboxServiceClient" to call the correct interceptors.
|
||||
func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InboxServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_InboxService_ListInboxes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v1/inboxes"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_InboxService_ListInboxes_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_InboxService_ListInboxes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_InboxService_UpdateInbox_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/api/v1/{inbox.name=inboxes/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_InboxService_UpdateInbox_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_InboxService_UpdateInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_InboxService_DeleteInbox_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/api/v1/{name=inboxes/*}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_InboxService_DeleteInbox_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_InboxService_DeleteInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_InboxService_ListInboxes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "inboxes"}, ""))
|
||||
|
||||
pattern_InboxService_UpdateInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "inboxes", "inbox.name"}, ""))
|
||||
|
||||
pattern_InboxService_DeleteInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "inboxes", "name"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_InboxService_ListInboxes_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_InboxService_UpdateInbox_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_InboxService_DeleteInbox_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
190
proto/gen/api/v1/inbox_service_grpc.pb.go
Normal file
190
proto/gen/api/v1/inbox_service_grpc.pb.go
Normal file
@@ -0,0 +1,190 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: api/v1/inbox_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
InboxService_ListInboxes_FullMethodName = "/memos.api.v1.InboxService/ListInboxes"
|
||||
InboxService_UpdateInbox_FullMethodName = "/memos.api.v1.InboxService/UpdateInbox"
|
||||
InboxService_DeleteInbox_FullMethodName = "/memos.api.v1.InboxService/DeleteInbox"
|
||||
)
|
||||
|
||||
// InboxServiceClient is the client API for InboxService service.
|
||||
//
|
||||
// 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.
|
||||
type InboxServiceClient interface {
|
||||
// ListInboxes lists inboxes for a user.
|
||||
ListInboxes(ctx context.Context, in *ListInboxesRequest, opts ...grpc.CallOption) (*ListInboxesResponse, error)
|
||||
// UpdateInbox updates an inbox.
|
||||
UpdateInbox(ctx context.Context, in *UpdateInboxRequest, opts ...grpc.CallOption) (*Inbox, error)
|
||||
// DeleteInbox deletes an inbox.
|
||||
DeleteInbox(ctx context.Context, in *DeleteInboxRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type inboxServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewInboxServiceClient(cc grpc.ClientConnInterface) InboxServiceClient {
|
||||
return &inboxServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *inboxServiceClient) ListInboxes(ctx context.Context, in *ListInboxesRequest, opts ...grpc.CallOption) (*ListInboxesResponse, error) {
|
||||
out := new(ListInboxesResponse)
|
||||
err := c.cc.Invoke(ctx, InboxService_ListInboxes_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *inboxServiceClient) UpdateInbox(ctx context.Context, in *UpdateInboxRequest, opts ...grpc.CallOption) (*Inbox, error) {
|
||||
out := new(Inbox)
|
||||
err := c.cc.Invoke(ctx, InboxService_UpdateInbox_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *inboxServiceClient) DeleteInbox(ctx context.Context, in *DeleteInboxRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, InboxService_DeleteInbox_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// InboxServiceServer is the server API for InboxService service.
|
||||
// All implementations must embed UnimplementedInboxServiceServer
|
||||
// for forward compatibility
|
||||
type InboxServiceServer interface {
|
||||
// ListInboxes lists inboxes for a user.
|
||||
ListInboxes(context.Context, *ListInboxesRequest) (*ListInboxesResponse, error)
|
||||
// UpdateInbox updates an inbox.
|
||||
UpdateInbox(context.Context, *UpdateInboxRequest) (*Inbox, error)
|
||||
// DeleteInbox deletes an inbox.
|
||||
DeleteInbox(context.Context, *DeleteInboxRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedInboxServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedInboxServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedInboxServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedInboxServiceServer) ListInboxes(context.Context, *ListInboxesRequest) (*ListInboxesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListInboxes not implemented")
|
||||
}
|
||||
func (UnimplementedInboxServiceServer) UpdateInbox(context.Context, *UpdateInboxRequest) (*Inbox, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateInbox not implemented")
|
||||
}
|
||||
func (UnimplementedInboxServiceServer) DeleteInbox(context.Context, *DeleteInboxRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteInbox not implemented")
|
||||
}
|
||||
func (UnimplementedInboxServiceServer) mustEmbedUnimplementedInboxServiceServer() {}
|
||||
|
||||
// UnsafeInboxServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to InboxServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeInboxServiceServer interface {
|
||||
mustEmbedUnimplementedInboxServiceServer()
|
||||
}
|
||||
|
||||
func RegisterInboxServiceServer(s grpc.ServiceRegistrar, srv InboxServiceServer) {
|
||||
s.RegisterService(&InboxService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _InboxService_ListInboxes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListInboxesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(InboxServiceServer).ListInboxes(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: InboxService_ListInboxes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(InboxServiceServer).ListInboxes(ctx, req.(*ListInboxesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _InboxService_UpdateInbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateInboxRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(InboxServiceServer).UpdateInbox(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: InboxService_UpdateInbox_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(InboxServiceServer).UpdateInbox(ctx, req.(*UpdateInboxRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _InboxService_DeleteInbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteInboxRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(InboxServiceServer).DeleteInbox(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: InboxService_DeleteInbox_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(InboxServiceServer).DeleteInbox(ctx, req.(*DeleteInboxRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// InboxService_ServiceDesc is the grpc.ServiceDesc for InboxService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var InboxService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memos.api.v1.InboxService",
|
||||
HandlerType: (*InboxServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListInboxes",
|
||||
Handler: _InboxService_ListInboxes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateInbox",
|
||||
Handler: _InboxService_UpdateInbox_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteInbox",
|
||||
Handler: _InboxService_DeleteInbox_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/inbox_service.proto",
|
||||
}
|
||||
3430
proto/gen/api/v1/markdown_service.pb.go
Normal file
3430
proto/gen/api/v1/markdown_service.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
327
proto/gen/api/v1/markdown_service.pb.gw.go
Normal file
327
proto/gen/api/v1/markdown_service.pb.gw.go
Normal file
@@ -0,0 +1,327 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/v1/markdown_service.proto
|
||||
|
||||
/*
|
||||
Package apiv1 is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = metadata.Join
|
||||
|
||||
func request_MarkdownService_ParseMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, client MarkdownServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ParseMarkdownRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ParseMarkdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_MarkdownService_ParseMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, server MarkdownServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ParseMarkdownRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ParseMarkdown(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_MarkdownService_RestoreMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, client MarkdownServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq RestoreMarkdownRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.RestoreMarkdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_MarkdownService_RestoreMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, server MarkdownServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq RestoreMarkdownRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.RestoreMarkdown(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_MarkdownService_GetLinkMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_MarkdownService_GetLinkMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client MarkdownServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetLinkMetadataRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MarkdownService_GetLinkMetadata_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetLinkMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_MarkdownService_GetLinkMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server MarkdownServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetLinkMetadataRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MarkdownService_GetLinkMetadata_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetLinkMetadata(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterMarkdownServiceHandlerServer registers the http handlers for service MarkdownService to "mux".
|
||||
// UnaryRPC :call MarkdownServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMarkdownServiceHandlerFromEndpoint instead.
|
||||
func RegisterMarkdownServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MarkdownServiceServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_MarkdownService_ParseMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MarkdownService/ParseMarkdown", runtime.WithHTTPPathPattern("/api/v1/markdown/parse"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_MarkdownService_ParseMarkdown_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MarkdownService_ParseMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_MarkdownService_RestoreMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MarkdownService/RestoreMarkdown", runtime.WithHTTPPathPattern("/api/v1/markdown:restore"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_MarkdownService_RestoreMarkdown_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MarkdownService_RestoreMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_MarkdownService_GetLinkMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.MarkdownService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v1/markdown/link:metadata"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_MarkdownService_GetLinkMetadata_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MarkdownService_GetLinkMetadata_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterMarkdownServiceHandlerFromEndpoint is same as RegisterMarkdownServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterMarkdownServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterMarkdownServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterMarkdownServiceHandler registers the http handlers for service MarkdownService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterMarkdownServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterMarkdownServiceHandlerClient(ctx, mux, NewMarkdownServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterMarkdownServiceHandlerClient registers the http handlers for service MarkdownService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MarkdownServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MarkdownServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "MarkdownServiceClient" to call the correct interceptors.
|
||||
func RegisterMarkdownServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MarkdownServiceClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_MarkdownService_ParseMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MarkdownService/ParseMarkdown", runtime.WithHTTPPathPattern("/api/v1/markdown/parse"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_MarkdownService_ParseMarkdown_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MarkdownService_ParseMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_MarkdownService_RestoreMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MarkdownService/RestoreMarkdown", runtime.WithHTTPPathPattern("/api/v1/markdown:restore"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_MarkdownService_RestoreMarkdown_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MarkdownService_RestoreMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_MarkdownService_GetLinkMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.MarkdownService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v1/markdown/link:metadata"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_MarkdownService_GetLinkMetadata_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MarkdownService_GetLinkMetadata_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_MarkdownService_ParseMarkdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "markdown", "parse"}, ""))
|
||||
|
||||
pattern_MarkdownService_RestoreMarkdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "markdown"}, "restore"))
|
||||
|
||||
pattern_MarkdownService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "markdown", "link"}, "metadata"))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_MarkdownService_ParseMarkdown_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_MarkdownService_RestoreMarkdown_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_MarkdownService_GetLinkMetadata_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
189
proto/gen/api/v1/markdown_service_grpc.pb.go
Normal file
189
proto/gen/api/v1/markdown_service_grpc.pb.go
Normal file
@@ -0,0 +1,189 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: api/v1/markdown_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
MarkdownService_ParseMarkdown_FullMethodName = "/memos.api.v1.MarkdownService/ParseMarkdown"
|
||||
MarkdownService_RestoreMarkdown_FullMethodName = "/memos.api.v1.MarkdownService/RestoreMarkdown"
|
||||
MarkdownService_GetLinkMetadata_FullMethodName = "/memos.api.v1.MarkdownService/GetLinkMetadata"
|
||||
)
|
||||
|
||||
// MarkdownServiceClient is the client API for MarkdownService service.
|
||||
//
|
||||
// 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.
|
||||
type MarkdownServiceClient interface {
|
||||
// Parses the given markdown content and returns a list of nodes.
|
||||
ParseMarkdown(ctx context.Context, in *ParseMarkdownRequest, opts ...grpc.CallOption) (*ParseMarkdownResponse, error)
|
||||
// Restores the given nodes to markdown content.
|
||||
RestoreMarkdown(ctx context.Context, in *RestoreMarkdownRequest, opts ...grpc.CallOption) (*RestoreMarkdownResponse, error)
|
||||
// GetLinkMetadata returns metadata for a given link.
|
||||
GetLinkMetadata(ctx context.Context, in *GetLinkMetadataRequest, opts ...grpc.CallOption) (*LinkMetadata, error)
|
||||
}
|
||||
|
||||
type markdownServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMarkdownServiceClient(cc grpc.ClientConnInterface) MarkdownServiceClient {
|
||||
return &markdownServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *markdownServiceClient) ParseMarkdown(ctx context.Context, in *ParseMarkdownRequest, opts ...grpc.CallOption) (*ParseMarkdownResponse, error) {
|
||||
out := new(ParseMarkdownResponse)
|
||||
err := c.cc.Invoke(ctx, MarkdownService_ParseMarkdown_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *markdownServiceClient) RestoreMarkdown(ctx context.Context, in *RestoreMarkdownRequest, opts ...grpc.CallOption) (*RestoreMarkdownResponse, error) {
|
||||
out := new(RestoreMarkdownResponse)
|
||||
err := c.cc.Invoke(ctx, MarkdownService_RestoreMarkdown_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *markdownServiceClient) GetLinkMetadata(ctx context.Context, in *GetLinkMetadataRequest, opts ...grpc.CallOption) (*LinkMetadata, error) {
|
||||
out := new(LinkMetadata)
|
||||
err := c.cc.Invoke(ctx, MarkdownService_GetLinkMetadata_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MarkdownServiceServer is the server API for MarkdownService service.
|
||||
// All implementations must embed UnimplementedMarkdownServiceServer
|
||||
// for forward compatibility
|
||||
type MarkdownServiceServer interface {
|
||||
// Parses the given markdown content and returns a list of nodes.
|
||||
ParseMarkdown(context.Context, *ParseMarkdownRequest) (*ParseMarkdownResponse, error)
|
||||
// Restores the given nodes to markdown content.
|
||||
RestoreMarkdown(context.Context, *RestoreMarkdownRequest) (*RestoreMarkdownResponse, error)
|
||||
// GetLinkMetadata returns metadata for a given link.
|
||||
GetLinkMetadata(context.Context, *GetLinkMetadataRequest) (*LinkMetadata, error)
|
||||
mustEmbedUnimplementedMarkdownServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedMarkdownServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedMarkdownServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedMarkdownServiceServer) ParseMarkdown(context.Context, *ParseMarkdownRequest) (*ParseMarkdownResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ParseMarkdown not implemented")
|
||||
}
|
||||
func (UnimplementedMarkdownServiceServer) RestoreMarkdown(context.Context, *RestoreMarkdownRequest) (*RestoreMarkdownResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RestoreMarkdown not implemented")
|
||||
}
|
||||
func (UnimplementedMarkdownServiceServer) GetLinkMetadata(context.Context, *GetLinkMetadataRequest) (*LinkMetadata, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLinkMetadata not implemented")
|
||||
}
|
||||
func (UnimplementedMarkdownServiceServer) mustEmbedUnimplementedMarkdownServiceServer() {}
|
||||
|
||||
// UnsafeMarkdownServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MarkdownServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMarkdownServiceServer interface {
|
||||
mustEmbedUnimplementedMarkdownServiceServer()
|
||||
}
|
||||
|
||||
func RegisterMarkdownServiceServer(s grpc.ServiceRegistrar, srv MarkdownServiceServer) {
|
||||
s.RegisterService(&MarkdownService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MarkdownService_ParseMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ParseMarkdownRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MarkdownServiceServer).ParseMarkdown(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MarkdownService_ParseMarkdown_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MarkdownServiceServer).ParseMarkdown(ctx, req.(*ParseMarkdownRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MarkdownService_RestoreMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RestoreMarkdownRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MarkdownServiceServer).RestoreMarkdown(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MarkdownService_RestoreMarkdown_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MarkdownServiceServer).RestoreMarkdown(ctx, req.(*RestoreMarkdownRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MarkdownService_GetLinkMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetLinkMetadataRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MarkdownServiceServer).GetLinkMetadata(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MarkdownService_GetLinkMetadata_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MarkdownServiceServer).GetLinkMetadata(ctx, req.(*GetLinkMetadataRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// MarkdownService_ServiceDesc is the grpc.ServiceDesc for MarkdownService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MarkdownService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memos.api.v1.MarkdownService",
|
||||
HandlerType: (*MarkdownServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ParseMarkdown",
|
||||
Handler: _MarkdownService_ParseMarkdown_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RestoreMarkdown",
|
||||
Handler: _MarkdownService_RestoreMarkdown_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLinkMetadata",
|
||||
Handler: _MarkdownService_GetLinkMetadata_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/markdown_service.proto",
|
||||
}
|
||||
236
proto/gen/api/v1/memo_relation_service.pb.go
Normal file
236
proto/gen/api/v1/memo_relation_service.pb.go
Normal file
@@ -0,0 +1,236 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc (unknown)
|
||||
// source: api/v1/memo_relation_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type MemoRelation_Type int32
|
||||
|
||||
const (
|
||||
MemoRelation_TYPE_UNSPECIFIED MemoRelation_Type = 0
|
||||
MemoRelation_REFERENCE MemoRelation_Type = 1
|
||||
MemoRelation_COMMENT MemoRelation_Type = 2
|
||||
)
|
||||
|
||||
// Enum value maps for MemoRelation_Type.
|
||||
var (
|
||||
MemoRelation_Type_name = map[int32]string{
|
||||
0: "TYPE_UNSPECIFIED",
|
||||
1: "REFERENCE",
|
||||
2: "COMMENT",
|
||||
}
|
||||
MemoRelation_Type_value = map[string]int32{
|
||||
"TYPE_UNSPECIFIED": 0,
|
||||
"REFERENCE": 1,
|
||||
"COMMENT": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x MemoRelation_Type) Enum() *MemoRelation_Type {
|
||||
p := new(MemoRelation_Type)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x MemoRelation_Type) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (MemoRelation_Type) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_v1_memo_relation_service_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (MemoRelation_Type) Type() protoreflect.EnumType {
|
||||
return &file_api_v1_memo_relation_service_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x MemoRelation_Type) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MemoRelation_Type.Descriptor instead.
|
||||
func (MemoRelation_Type) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_v1_memo_relation_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
type MemoRelation struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The name of memo.
|
||||
// Format: "memos/{uid}"
|
||||
Memo string `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"`
|
||||
// The name of related memo.
|
||||
// Format: "memos/{uid}"
|
||||
RelatedMemo string `protobuf:"bytes,2,opt,name=related_memo,json=relatedMemo,proto3" json:"related_memo,omitempty"`
|
||||
Type MemoRelation_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.api.v1.MemoRelation_Type" json:"type,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MemoRelation) Reset() {
|
||||
*x = MemoRelation{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_memo_relation_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MemoRelation) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MemoRelation) ProtoMessage() {}
|
||||
|
||||
func (x *MemoRelation) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_memo_relation_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MemoRelation.ProtoReflect.Descriptor instead.
|
||||
func (*MemoRelation) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_memo_relation_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MemoRelation) GetMemo() string {
|
||||
if x != nil {
|
||||
return x.Memo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MemoRelation) GetRelatedMemo() string {
|
||||
if x != nil {
|
||||
return x.RelatedMemo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MemoRelation) GetType() MemoRelation_Type {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MemoRelation_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
var File_api_v1_memo_relation_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_v1_memo_relation_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x22, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x72, 0x65,
|
||||
0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x76, 0x31, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74,
|
||||
0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72,
|
||||
0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79,
|
||||
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22,
|
||||
0x38, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f,
|
||||
0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a,
|
||||
0x09, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07,
|
||||
0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x42, 0xb0, 0x01, 0x0a, 0x10, 0x63, 0x6f,
|
||||
0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x18,
|
||||
0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f,
|
||||
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d,
|
||||
0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56,
|
||||
0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31,
|
||||
0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c,
|
||||
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65,
|
||||
0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_v1_memo_relation_service_proto_rawDescOnce sync.Once
|
||||
file_api_v1_memo_relation_service_proto_rawDescData = file_api_v1_memo_relation_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_v1_memo_relation_service_proto_rawDescGZIP() []byte {
|
||||
file_api_v1_memo_relation_service_proto_rawDescOnce.Do(func() {
|
||||
file_api_v1_memo_relation_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_memo_relation_service_proto_rawDescData)
|
||||
})
|
||||
return file_api_v1_memo_relation_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_v1_memo_relation_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_v1_memo_relation_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_api_v1_memo_relation_service_proto_goTypes = []interface{}{
|
||||
(MemoRelation_Type)(0), // 0: memos.api.v1.MemoRelation.Type
|
||||
(*MemoRelation)(nil), // 1: memos.api.v1.MemoRelation
|
||||
}
|
||||
var file_api_v1_memo_relation_service_proto_depIdxs = []int32{
|
||||
0, // 0: memos.api.v1.MemoRelation.type:type_name -> memos.api.v1.MemoRelation.Type
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_memo_relation_service_proto_init() }
|
||||
func file_api_v1_memo_relation_service_proto_init() {
|
||||
if File_api_v1_memo_relation_service_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_v1_memo_relation_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MemoRelation); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_v1_memo_relation_service_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_v1_memo_relation_service_proto_goTypes,
|
||||
DependencyIndexes: file_api_v1_memo_relation_service_proto_depIdxs,
|
||||
EnumInfos: file_api_v1_memo_relation_service_proto_enumTypes,
|
||||
MessageInfos: file_api_v1_memo_relation_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_v1_memo_relation_service_proto = out.File
|
||||
file_api_v1_memo_relation_service_proto_rawDesc = nil
|
||||
file_api_v1_memo_relation_service_proto_goTypes = nil
|
||||
file_api_v1_memo_relation_service_proto_depIdxs = nil
|
||||
}
|
||||
3057
proto/gen/api/v1/memo_service.pb.go
Normal file
3057
proto/gen/api/v1/memo_service.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
2404
proto/gen/api/v1/memo_service.pb.gw.go
Normal file
2404
proto/gen/api/v1/memo_service.pb.gw.go
Normal file
File diff suppressed because it is too large
Load Diff
931
proto/gen/api/v1/memo_service_grpc.pb.go
Normal file
931
proto/gen/api/v1/memo_service_grpc.pb.go
Normal file
@@ -0,0 +1,931 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: api/v1/memo_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
MemoService_CreateMemo_FullMethodName = "/memos.api.v1.MemoService/CreateMemo"
|
||||
MemoService_ListMemos_FullMethodName = "/memos.api.v1.MemoService/ListMemos"
|
||||
MemoService_SearchMemos_FullMethodName = "/memos.api.v1.MemoService/SearchMemos"
|
||||
MemoService_GetMemo_FullMethodName = "/memos.api.v1.MemoService/GetMemo"
|
||||
MemoService_UpdateMemo_FullMethodName = "/memos.api.v1.MemoService/UpdateMemo"
|
||||
MemoService_DeleteMemo_FullMethodName = "/memos.api.v1.MemoService/DeleteMemo"
|
||||
MemoService_ExportMemos_FullMethodName = "/memos.api.v1.MemoService/ExportMemos"
|
||||
MemoService_ListMemoProperties_FullMethodName = "/memos.api.v1.MemoService/ListMemoProperties"
|
||||
MemoService_RebuildMemoProperty_FullMethodName = "/memos.api.v1.MemoService/RebuildMemoProperty"
|
||||
MemoService_ListMemoTags_FullMethodName = "/memos.api.v1.MemoService/ListMemoTags"
|
||||
MemoService_RenameMemoTag_FullMethodName = "/memos.api.v1.MemoService/RenameMemoTag"
|
||||
MemoService_DeleteMemoTag_FullMethodName = "/memos.api.v1.MemoService/DeleteMemoTag"
|
||||
MemoService_SetMemoResources_FullMethodName = "/memos.api.v1.MemoService/SetMemoResources"
|
||||
MemoService_ListMemoResources_FullMethodName = "/memos.api.v1.MemoService/ListMemoResources"
|
||||
MemoService_SetMemoRelations_FullMethodName = "/memos.api.v1.MemoService/SetMemoRelations"
|
||||
MemoService_ListMemoRelations_FullMethodName = "/memos.api.v1.MemoService/ListMemoRelations"
|
||||
MemoService_CreateMemoComment_FullMethodName = "/memos.api.v1.MemoService/CreateMemoComment"
|
||||
MemoService_ListMemoComments_FullMethodName = "/memos.api.v1.MemoService/ListMemoComments"
|
||||
MemoService_GetUserMemosStats_FullMethodName = "/memos.api.v1.MemoService/GetUserMemosStats"
|
||||
MemoService_ListMemoReactions_FullMethodName = "/memos.api.v1.MemoService/ListMemoReactions"
|
||||
MemoService_UpsertMemoReaction_FullMethodName = "/memos.api.v1.MemoService/UpsertMemoReaction"
|
||||
MemoService_DeleteMemoReaction_FullMethodName = "/memos.api.v1.MemoService/DeleteMemoReaction"
|
||||
)
|
||||
|
||||
// MemoServiceClient is the client API for MemoService service.
|
||||
//
|
||||
// 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.
|
||||
type MemoServiceClient interface {
|
||||
// CreateMemo creates a memo.
|
||||
CreateMemo(ctx context.Context, in *CreateMemoRequest, opts ...grpc.CallOption) (*Memo, error)
|
||||
// ListMemos lists memos with pagination and filter.
|
||||
ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error)
|
||||
// SearchMemos searches memos.
|
||||
SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error)
|
||||
// GetMemo gets a memo.
|
||||
GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*Memo, error)
|
||||
// UpdateMemo updates a memo.
|
||||
UpdateMemo(ctx context.Context, in *UpdateMemoRequest, opts ...grpc.CallOption) (*Memo, error)
|
||||
// DeleteMemo deletes a memo.
|
||||
DeleteMemo(ctx context.Context, in *DeleteMemoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// ExportMemos exports memos.
|
||||
ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*ExportMemosResponse, error)
|
||||
// ListMemoProperties lists memo properties.
|
||||
ListMemoProperties(ctx context.Context, in *ListMemoPropertiesRequest, opts ...grpc.CallOption) (*ListMemoPropertiesResponse, error)
|
||||
// RebuildMemoProperty rebuilds a memo property.
|
||||
RebuildMemoProperty(ctx context.Context, in *RebuildMemoPropertyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// ListMemoTags lists tags for a memo.
|
||||
ListMemoTags(ctx context.Context, in *ListMemoTagsRequest, opts ...grpc.CallOption) (*ListMemoTagsResponse, error)
|
||||
// RenameMemoTag renames a tag for a memo.
|
||||
RenameMemoTag(ctx context.Context, in *RenameMemoTagRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// DeleteMemoTag deletes a tag for a memo.
|
||||
DeleteMemoTag(ctx context.Context, in *DeleteMemoTagRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// SetMemoResources sets resources for a memo.
|
||||
SetMemoResources(ctx context.Context, in *SetMemoResourcesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// ListMemoResources lists resources for a memo.
|
||||
ListMemoResources(ctx context.Context, in *ListMemoResourcesRequest, opts ...grpc.CallOption) (*ListMemoResourcesResponse, error)
|
||||
// SetMemoRelations sets relations for a memo.
|
||||
SetMemoRelations(ctx context.Context, in *SetMemoRelationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// ListMemoRelations lists relations for a memo.
|
||||
ListMemoRelations(ctx context.Context, in *ListMemoRelationsRequest, opts ...grpc.CallOption) (*ListMemoRelationsResponse, error)
|
||||
// CreateMemoComment creates a comment for a memo.
|
||||
CreateMemoComment(ctx context.Context, in *CreateMemoCommentRequest, opts ...grpc.CallOption) (*Memo, error)
|
||||
// ListMemoComments lists comments for a memo.
|
||||
ListMemoComments(ctx context.Context, in *ListMemoCommentsRequest, opts ...grpc.CallOption) (*ListMemoCommentsResponse, error)
|
||||
// GetUserMemosStats gets stats of memos for a user.
|
||||
GetUserMemosStats(ctx context.Context, in *GetUserMemosStatsRequest, opts ...grpc.CallOption) (*GetUserMemosStatsResponse, error)
|
||||
// ListMemoReactions lists reactions for a memo.
|
||||
ListMemoReactions(ctx context.Context, in *ListMemoReactionsRequest, opts ...grpc.CallOption) (*ListMemoReactionsResponse, error)
|
||||
// UpsertMemoReaction upserts a reaction for a memo.
|
||||
UpsertMemoReaction(ctx context.Context, in *UpsertMemoReactionRequest, opts ...grpc.CallOption) (*Reaction, error)
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
DeleteMemoReaction(ctx context.Context, in *DeleteMemoReactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type memoServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMemoServiceClient(cc grpc.ClientConnInterface) MemoServiceClient {
|
||||
return &memoServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) CreateMemo(ctx context.Context, in *CreateMemoRequest, opts ...grpc.CallOption) (*Memo, error) {
|
||||
out := new(Memo)
|
||||
err := c.cc.Invoke(ctx, MemoService_CreateMemo_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error) {
|
||||
out := new(ListMemosResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemos_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) {
|
||||
out := new(SearchMemosResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_SearchMemos_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*Memo, error) {
|
||||
out := new(Memo)
|
||||
err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) UpdateMemo(ctx context.Context, in *UpdateMemoRequest, opts ...grpc.CallOption) (*Memo, error) {
|
||||
out := new(Memo)
|
||||
err := c.cc.Invoke(ctx, MemoService_UpdateMemo_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) DeleteMemo(ctx context.Context, in *DeleteMemoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_DeleteMemo_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*ExportMemosResponse, error) {
|
||||
out := new(ExportMemosResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ExportMemos_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoProperties(ctx context.Context, in *ListMemoPropertiesRequest, opts ...grpc.CallOption) (*ListMemoPropertiesResponse, error) {
|
||||
out := new(ListMemoPropertiesResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoProperties_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) RebuildMemoProperty(ctx context.Context, in *RebuildMemoPropertyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_RebuildMemoProperty_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoTags(ctx context.Context, in *ListMemoTagsRequest, opts ...grpc.CallOption) (*ListMemoTagsResponse, error) {
|
||||
out := new(ListMemoTagsResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoTags_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) RenameMemoTag(ctx context.Context, in *RenameMemoTagRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_RenameMemoTag_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) DeleteMemoTag(ctx context.Context, in *DeleteMemoTagRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_DeleteMemoTag_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) SetMemoResources(ctx context.Context, in *SetMemoResourcesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_SetMemoResources_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoResources(ctx context.Context, in *ListMemoResourcesRequest, opts ...grpc.CallOption) (*ListMemoResourcesResponse, error) {
|
||||
out := new(ListMemoResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoResources_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) SetMemoRelations(ctx context.Context, in *SetMemoRelationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_SetMemoRelations_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoRelations(ctx context.Context, in *ListMemoRelationsRequest, opts ...grpc.CallOption) (*ListMemoRelationsResponse, error) {
|
||||
out := new(ListMemoRelationsResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoRelations_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) CreateMemoComment(ctx context.Context, in *CreateMemoCommentRequest, opts ...grpc.CallOption) (*Memo, error) {
|
||||
out := new(Memo)
|
||||
err := c.cc.Invoke(ctx, MemoService_CreateMemoComment_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoComments(ctx context.Context, in *ListMemoCommentsRequest, opts ...grpc.CallOption) (*ListMemoCommentsResponse, error) {
|
||||
out := new(ListMemoCommentsResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoComments_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) GetUserMemosStats(ctx context.Context, in *GetUserMemosStatsRequest, opts ...grpc.CallOption) (*GetUserMemosStatsResponse, error) {
|
||||
out := new(GetUserMemosStatsResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_GetUserMemosStats_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoReactions(ctx context.Context, in *ListMemoReactionsRequest, opts ...grpc.CallOption) (*ListMemoReactionsResponse, error) {
|
||||
out := new(ListMemoReactionsResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoReactions_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) UpsertMemoReaction(ctx context.Context, in *UpsertMemoReactionRequest, opts ...grpc.CallOption) (*Reaction, error) {
|
||||
out := new(Reaction)
|
||||
err := c.cc.Invoke(ctx, MemoService_UpsertMemoReaction_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) DeleteMemoReaction(ctx context.Context, in *DeleteMemoReactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, MemoService_DeleteMemoReaction_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MemoServiceServer is the server API for MemoService service.
|
||||
// All implementations must embed UnimplementedMemoServiceServer
|
||||
// for forward compatibility
|
||||
type MemoServiceServer interface {
|
||||
// CreateMemo creates a memo.
|
||||
CreateMemo(context.Context, *CreateMemoRequest) (*Memo, error)
|
||||
// ListMemos lists memos with pagination and filter.
|
||||
ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error)
|
||||
// SearchMemos searches memos.
|
||||
SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error)
|
||||
// GetMemo gets a memo.
|
||||
GetMemo(context.Context, *GetMemoRequest) (*Memo, error)
|
||||
// UpdateMemo updates a memo.
|
||||
UpdateMemo(context.Context, *UpdateMemoRequest) (*Memo, error)
|
||||
// DeleteMemo deletes a memo.
|
||||
DeleteMemo(context.Context, *DeleteMemoRequest) (*emptypb.Empty, error)
|
||||
// ExportMemos exports memos.
|
||||
ExportMemos(context.Context, *ExportMemosRequest) (*ExportMemosResponse, error)
|
||||
// ListMemoProperties lists memo properties.
|
||||
ListMemoProperties(context.Context, *ListMemoPropertiesRequest) (*ListMemoPropertiesResponse, error)
|
||||
// RebuildMemoProperty rebuilds a memo property.
|
||||
RebuildMemoProperty(context.Context, *RebuildMemoPropertyRequest) (*emptypb.Empty, error)
|
||||
// ListMemoTags lists tags for a memo.
|
||||
ListMemoTags(context.Context, *ListMemoTagsRequest) (*ListMemoTagsResponse, error)
|
||||
// RenameMemoTag renames a tag for a memo.
|
||||
RenameMemoTag(context.Context, *RenameMemoTagRequest) (*emptypb.Empty, error)
|
||||
// DeleteMemoTag deletes a tag for a memo.
|
||||
DeleteMemoTag(context.Context, *DeleteMemoTagRequest) (*emptypb.Empty, error)
|
||||
// SetMemoResources sets resources for a memo.
|
||||
SetMemoResources(context.Context, *SetMemoResourcesRequest) (*emptypb.Empty, error)
|
||||
// ListMemoResources lists resources for a memo.
|
||||
ListMemoResources(context.Context, *ListMemoResourcesRequest) (*ListMemoResourcesResponse, error)
|
||||
// SetMemoRelations sets relations for a memo.
|
||||
SetMemoRelations(context.Context, *SetMemoRelationsRequest) (*emptypb.Empty, error)
|
||||
// ListMemoRelations lists relations for a memo.
|
||||
ListMemoRelations(context.Context, *ListMemoRelationsRequest) (*ListMemoRelationsResponse, error)
|
||||
// CreateMemoComment creates a comment for a memo.
|
||||
CreateMemoComment(context.Context, *CreateMemoCommentRequest) (*Memo, error)
|
||||
// ListMemoComments lists comments for a memo.
|
||||
ListMemoComments(context.Context, *ListMemoCommentsRequest) (*ListMemoCommentsResponse, error)
|
||||
// GetUserMemosStats gets stats of memos for a user.
|
||||
GetUserMemosStats(context.Context, *GetUserMemosStatsRequest) (*GetUserMemosStatsResponse, error)
|
||||
// ListMemoReactions lists reactions for a memo.
|
||||
ListMemoReactions(context.Context, *ListMemoReactionsRequest) (*ListMemoReactionsResponse, error)
|
||||
// UpsertMemoReaction upserts a reaction for a memo.
|
||||
UpsertMemoReaction(context.Context, *UpsertMemoReactionRequest) (*Reaction, error)
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
DeleteMemoReaction(context.Context, *DeleteMemoReactionRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedMemoServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedMemoServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedMemoServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceServer) CreateMemo(context.Context, *CreateMemoRequest) (*Memo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateMemo not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemos not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SearchMemos not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) GetMemo(context.Context, *GetMemoRequest) (*Memo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMemo not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) UpdateMemo(context.Context, *UpdateMemoRequest) (*Memo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateMemo not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) DeleteMemo(context.Context, *DeleteMemoRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteMemo not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ExportMemos(context.Context, *ExportMemosRequest) (*ExportMemosResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ExportMemos not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoProperties(context.Context, *ListMemoPropertiesRequest) (*ListMemoPropertiesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoProperties not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) RebuildMemoProperty(context.Context, *RebuildMemoPropertyRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RebuildMemoProperty not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoTags(context.Context, *ListMemoTagsRequest) (*ListMemoTagsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoTags not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) RenameMemoTag(context.Context, *RenameMemoTagRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RenameMemoTag not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) DeleteMemoTag(context.Context, *DeleteMemoTagRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteMemoTag not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) SetMemoResources(context.Context, *SetMemoResourcesRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetMemoResources not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoResources(context.Context, *ListMemoResourcesRequest) (*ListMemoResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoResources not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) SetMemoRelations(context.Context, *SetMemoRelationsRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetMemoRelations not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoRelations(context.Context, *ListMemoRelationsRequest) (*ListMemoRelationsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoRelations not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) CreateMemoComment(context.Context, *CreateMemoCommentRequest) (*Memo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateMemoComment not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoComments(context.Context, *ListMemoCommentsRequest) (*ListMemoCommentsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoComments not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) GetUserMemosStats(context.Context, *GetUserMemosStatsRequest) (*GetUserMemosStatsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUserMemosStats not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoReactions(context.Context, *ListMemoReactionsRequest) (*ListMemoReactionsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoReactions not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) UpsertMemoReaction(context.Context, *UpsertMemoReactionRequest) (*Reaction, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpsertMemoReaction not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) DeleteMemoReaction(context.Context, *DeleteMemoReactionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteMemoReaction not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) mustEmbedUnimplementedMemoServiceServer() {}
|
||||
|
||||
// UnsafeMemoServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MemoServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMemoServiceServer interface {
|
||||
mustEmbedUnimplementedMemoServiceServer()
|
||||
}
|
||||
|
||||
func RegisterMemoServiceServer(s grpc.ServiceRegistrar, srv MemoServiceServer) {
|
||||
s.RegisterService(&MemoService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MemoService_CreateMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateMemoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).CreateMemo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_CreateMemo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).CreateMemo(ctx, req.(*CreateMemoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemosRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemos(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemos_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemos(ctx, req.(*ListMemosRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_SearchMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SearchMemosRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).SearchMemos(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_SearchMemos_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).SearchMemos(ctx, req.(*SearchMemosRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMemoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).GetMemo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_GetMemo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_UpdateMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateMemoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).UpdateMemo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_UpdateMemo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).UpdateMemo(ctx, req.(*UpdateMemoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_DeleteMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteMemoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).DeleteMemo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_DeleteMemo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).DeleteMemo(ctx, req.(*DeleteMemoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ExportMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExportMemosRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ExportMemos(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ExportMemos_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ExportMemos(ctx, req.(*ExportMemosRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoProperties_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoPropertiesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoProperties(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoProperties_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoProperties(ctx, req.(*ListMemoPropertiesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_RebuildMemoProperty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RebuildMemoPropertyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).RebuildMemoProperty(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_RebuildMemoProperty_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).RebuildMemoProperty(ctx, req.(*RebuildMemoPropertyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoTagsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoTags(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoTags_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoTags(ctx, req.(*ListMemoTagsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_RenameMemoTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RenameMemoTagRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).RenameMemoTag(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_RenameMemoTag_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).RenameMemoTag(ctx, req.(*RenameMemoTagRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_DeleteMemoTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteMemoTagRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).DeleteMemoTag(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_DeleteMemoTag_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).DeleteMemoTag(ctx, req.(*DeleteMemoTagRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_SetMemoResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetMemoResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).SetMemoResources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_SetMemoResources_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).SetMemoResources(ctx, req.(*SetMemoResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoResources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoResources_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoResources(ctx, req.(*ListMemoResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_SetMemoRelations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetMemoRelationsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).SetMemoRelations(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_SetMemoRelations_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).SetMemoRelations(ctx, req.(*SetMemoRelationsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoRelations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoRelationsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoRelations(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoRelations_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoRelations(ctx, req.(*ListMemoRelationsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_CreateMemoComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateMemoCommentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).CreateMemoComment(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_CreateMemoComment_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).CreateMemoComment(ctx, req.(*CreateMemoCommentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoComments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoCommentsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoComments(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoComments_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoComments(ctx, req.(*ListMemoCommentsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_GetUserMemosStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserMemosStatsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).GetUserMemosStats(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_GetUserMemosStats_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).GetUserMemosStats(ctx, req.(*GetUserMemosStatsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoReactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoReactionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoReactions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoReactions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoReactions(ctx, req.(*ListMemoReactionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_UpsertMemoReaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpsertMemoReactionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).UpsertMemoReaction(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_UpsertMemoReaction_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).UpsertMemoReaction(ctx, req.(*UpsertMemoReactionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_DeleteMemoReaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteMemoReactionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).DeleteMemoReaction(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_DeleteMemoReaction_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).DeleteMemoReaction(ctx, req.(*DeleteMemoReactionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// MemoService_ServiceDesc is the grpc.ServiceDesc for MemoService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MemoService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "memos.api.v1.MemoService",
|
||||
HandlerType: (*MemoServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateMemo",
|
||||
Handler: _MemoService_CreateMemo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemos",
|
||||
Handler: _MemoService_ListMemos_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SearchMemos",
|
||||
Handler: _MemoService_SearchMemos_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMemo",
|
||||
Handler: _MemoService_GetMemo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateMemo",
|
||||
Handler: _MemoService_UpdateMemo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteMemo",
|
||||
Handler: _MemoService_DeleteMemo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ExportMemos",
|
||||
Handler: _MemoService_ExportMemos_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoProperties",
|
||||
Handler: _MemoService_ListMemoProperties_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RebuildMemoProperty",
|
||||
Handler: _MemoService_RebuildMemoProperty_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoTags",
|
||||
Handler: _MemoService_ListMemoTags_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RenameMemoTag",
|
||||
Handler: _MemoService_RenameMemoTag_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteMemoTag",
|
||||
Handler: _MemoService_DeleteMemoTag_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetMemoResources",
|
||||
Handler: _MemoService_SetMemoResources_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoResources",
|
||||
Handler: _MemoService_ListMemoResources_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetMemoRelations",
|
||||
Handler: _MemoService_SetMemoRelations_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoRelations",
|
||||
Handler: _MemoService_ListMemoRelations_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateMemoComment",
|
||||
Handler: _MemoService_CreateMemoComment_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoComments",
|
||||
Handler: _MemoService_ListMemoComments_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserMemosStats",
|
||||
Handler: _MemoService_GetUserMemosStats_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoReactions",
|
||||
Handler: _MemoService_ListMemoReactions_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpsertMemoReaction",
|
||||
Handler: _MemoService_UpsertMemoReaction_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteMemoReaction",
|
||||
Handler: _MemoService_DeleteMemoReaction_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/memo_service.proto",
|
||||
}
|
||||
282
proto/gen/api/v1/reaction_service.pb.go
Normal file
282
proto/gen/api/v1/reaction_service.pb.go
Normal file
@@ -0,0 +1,282 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc (unknown)
|
||||
// source: api/v1/reaction_service.proto
|
||||
|
||||
package apiv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Reaction_Type int32
|
||||
|
||||
const (
|
||||
Reaction_TYPE_UNSPECIFIED Reaction_Type = 0
|
||||
Reaction_THUMBS_UP Reaction_Type = 1
|
||||
Reaction_THUMBS_DOWN Reaction_Type = 2
|
||||
Reaction_HEART Reaction_Type = 3
|
||||
Reaction_FIRE Reaction_Type = 4
|
||||
Reaction_CLAPPING_HANDS Reaction_Type = 5
|
||||
Reaction_LAUGH Reaction_Type = 6
|
||||
Reaction_OK_HAND Reaction_Type = 7
|
||||
Reaction_ROCKET Reaction_Type = 8
|
||||
Reaction_EYES Reaction_Type = 9
|
||||
Reaction_THINKING_FACE Reaction_Type = 10
|
||||
Reaction_CLOWN_FACE Reaction_Type = 11
|
||||
Reaction_QUESTION_MARK Reaction_Type = 12
|
||||
)
|
||||
|
||||
// Enum value maps for Reaction_Type.
|
||||
var (
|
||||
Reaction_Type_name = map[int32]string{
|
||||
0: "TYPE_UNSPECIFIED",
|
||||
1: "THUMBS_UP",
|
||||
2: "THUMBS_DOWN",
|
||||
3: "HEART",
|
||||
4: "FIRE",
|
||||
5: "CLAPPING_HANDS",
|
||||
6: "LAUGH",
|
||||
7: "OK_HAND",
|
||||
8: "ROCKET",
|
||||
9: "EYES",
|
||||
10: "THINKING_FACE",
|
||||
11: "CLOWN_FACE",
|
||||
12: "QUESTION_MARK",
|
||||
}
|
||||
Reaction_Type_value = map[string]int32{
|
||||
"TYPE_UNSPECIFIED": 0,
|
||||
"THUMBS_UP": 1,
|
||||
"THUMBS_DOWN": 2,
|
||||
"HEART": 3,
|
||||
"FIRE": 4,
|
||||
"CLAPPING_HANDS": 5,
|
||||
"LAUGH": 6,
|
||||
"OK_HAND": 7,
|
||||
"ROCKET": 8,
|
||||
"EYES": 9,
|
||||
"THINKING_FACE": 10,
|
||||
"CLOWN_FACE": 11,
|
||||
"QUESTION_MARK": 12,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Reaction_Type) Enum() *Reaction_Type {
|
||||
p := new(Reaction_Type)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Reaction_Type) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Reaction_Type) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_v1_reaction_service_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Reaction_Type) Type() protoreflect.EnumType {
|
||||
return &file_api_v1_reaction_service_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Reaction_Type) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Reaction_Type.Descriptor instead.
|
||||
func (Reaction_Type) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_v1_reaction_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
type Reaction struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// The name of the creator.
|
||||
// Format: users/{id}
|
||||
Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
|
||||
ContentId string `protobuf:"bytes,3,opt,name=content_id,json=contentId,proto3" json:"content_id,omitempty"`
|
||||
ReactionType Reaction_Type `protobuf:"varint,4,opt,name=reaction_type,json=reactionType,proto3,enum=memos.api.v1.Reaction_Type" json:"reaction_type,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Reaction) Reset() {
|
||||
*x = Reaction{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_v1_reaction_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Reaction) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Reaction) ProtoMessage() {}
|
||||
|
||||
func (x *Reaction) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_v1_reaction_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Reaction.ProtoReflect.Descriptor instead.
|
||||
func (*Reaction) Descriptor() ([]byte, []int) {
|
||||
return file_api_v1_reaction_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Reaction) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Reaction) GetCreator() string {
|
||||
if x != nil {
|
||||
return x.Creator
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Reaction) GetContentId() string {
|
||||
if x != nil {
|
||||
return x.ContentId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Reaction) GetReactionType() Reaction_Type {
|
||||
if x != nil {
|
||||
return x.ReactionType
|
||||
}
|
||||
return Reaction_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
var File_api_v1_reaction_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_v1_reaction_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0xe1, 0x02,
|
||||
0x0a, 0x08, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72,
|
||||
0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65,
|
||||
0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f,
|
||||
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
|
||||
0x74, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
|
||||
0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
|
||||
0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x48, 0x55, 0x4d, 0x42, 0x53, 0x5f, 0x55,
|
||||
0x50, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x48, 0x55, 0x4d, 0x42, 0x53, 0x5f, 0x44, 0x4f,
|
||||
0x57, 0x4e, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x48, 0x45, 0x41, 0x52, 0x54, 0x10, 0x03, 0x12,
|
||||
0x08, 0x0a, 0x04, 0x46, 0x49, 0x52, 0x45, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4c, 0x41,
|
||||
0x50, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x41, 0x4e, 0x44, 0x53, 0x10, 0x05, 0x12, 0x09, 0x0a,
|
||||
0x05, 0x4c, 0x41, 0x55, 0x47, 0x48, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x4b, 0x5f, 0x48,
|
||||
0x41, 0x4e, 0x44, 0x10, 0x07, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x4f, 0x43, 0x4b, 0x45, 0x54, 0x10,
|
||||
0x08, 0x12, 0x08, 0x0a, 0x04, 0x45, 0x59, 0x45, 0x53, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x54,
|
||||
0x48, 0x49, 0x4e, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x46, 0x41, 0x43, 0x45, 0x10, 0x0a, 0x12, 0x0e,
|
||||
0x0a, 0x0a, 0x43, 0x4c, 0x4f, 0x57, 0x4e, 0x5f, 0x46, 0x41, 0x43, 0x45, 0x10, 0x0b, 0x12, 0x11,
|
||||
0x0a, 0x0d, 0x51, 0x55, 0x45, 0x53, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x52, 0x4b, 0x10,
|
||||
0x0c, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65,
|
||||
0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
|
||||
0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31,
|
||||
0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41,
|
||||
0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70,
|
||||
0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69,
|
||||
0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_v1_reaction_service_proto_rawDescOnce sync.Once
|
||||
file_api_v1_reaction_service_proto_rawDescData = file_api_v1_reaction_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_v1_reaction_service_proto_rawDescGZIP() []byte {
|
||||
file_api_v1_reaction_service_proto_rawDescOnce.Do(func() {
|
||||
file_api_v1_reaction_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_reaction_service_proto_rawDescData)
|
||||
})
|
||||
return file_api_v1_reaction_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_v1_reaction_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_v1_reaction_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_api_v1_reaction_service_proto_goTypes = []interface{}{
|
||||
(Reaction_Type)(0), // 0: memos.api.v1.Reaction.Type
|
||||
(*Reaction)(nil), // 1: memos.api.v1.Reaction
|
||||
}
|
||||
var file_api_v1_reaction_service_proto_depIdxs = []int32{
|
||||
0, // 0: memos.api.v1.Reaction.reaction_type:type_name -> memos.api.v1.Reaction.Type
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_v1_reaction_service_proto_init() }
|
||||
func file_api_v1_reaction_service_proto_init() {
|
||||
if File_api_v1_reaction_service_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_v1_reaction_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Reaction); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_v1_reaction_service_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_v1_reaction_service_proto_goTypes,
|
||||
DependencyIndexes: file_api_v1_reaction_service_proto_depIdxs,
|
||||
EnumInfos: file_api_v1_reaction_service_proto_enumTypes,
|
||||
MessageInfos: file_api_v1_reaction_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_v1_reaction_service_proto = out.File
|
||||
file_api_v1_reaction_service_proto_rawDesc = nil
|
||||
file_api_v1_reaction_service_proto_goTypes = nil
|
||||
file_api_v1_reaction_service_proto_depIdxs = nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user