user_service_grpc.pb.go 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc (unknown)
  5. // source: api/v1/user_service.proto
  6. package apiv1
  7. import (
  8. context "context"
  9. httpbody "google.golang.org/genproto/googleapis/api/httpbody"
  10. grpc "google.golang.org/grpc"
  11. codes "google.golang.org/grpc/codes"
  12. status "google.golang.org/grpc/status"
  13. emptypb "google.golang.org/protobuf/types/known/emptypb"
  14. )
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the grpc package it is being compiled against.
  17. // Requires gRPC-Go v1.64.0 or later.
  18. const _ = grpc.SupportPackageIsVersion9
  19. const (
  20. UserService_ListUsers_FullMethodName = "/memos.api.v1.UserService/ListUsers"
  21. UserService_GetUser_FullMethodName = "/memos.api.v1.UserService/GetUser"
  22. UserService_GetUserByUsername_FullMethodName = "/memos.api.v1.UserService/GetUserByUsername"
  23. UserService_GetUserAvatarBinary_FullMethodName = "/memos.api.v1.UserService/GetUserAvatarBinary"
  24. UserService_CreateUser_FullMethodName = "/memos.api.v1.UserService/CreateUser"
  25. UserService_UpdateUser_FullMethodName = "/memos.api.v1.UserService/UpdateUser"
  26. UserService_DeleteUser_FullMethodName = "/memos.api.v1.UserService/DeleteUser"
  27. UserService_ListAllUserStats_FullMethodName = "/memos.api.v1.UserService/ListAllUserStats"
  28. UserService_GetUserStats_FullMethodName = "/memos.api.v1.UserService/GetUserStats"
  29. UserService_GetUserSetting_FullMethodName = "/memos.api.v1.UserService/GetUserSetting"
  30. UserService_UpdateUserSetting_FullMethodName = "/memos.api.v1.UserService/UpdateUserSetting"
  31. UserService_ListUserAccessTokens_FullMethodName = "/memos.api.v1.UserService/ListUserAccessTokens"
  32. UserService_CreateUserAccessToken_FullMethodName = "/memos.api.v1.UserService/CreateUserAccessToken"
  33. UserService_DeleteUserAccessToken_FullMethodName = "/memos.api.v1.UserService/DeleteUserAccessToken"
  34. UserService_ListShortcuts_FullMethodName = "/memos.api.v1.UserService/ListShortcuts"
  35. UserService_CreateShortcut_FullMethodName = "/memos.api.v1.UserService/CreateShortcut"
  36. UserService_UpdateShortcut_FullMethodName = "/memos.api.v1.UserService/UpdateShortcut"
  37. UserService_DeleteShortcut_FullMethodName = "/memos.api.v1.UserService/DeleteShortcut"
  38. )
  39. // UserServiceClient is the client API for UserService service.
  40. //
  41. // 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.
  42. type UserServiceClient interface {
  43. // ListUsers returns a list of users.
  44. ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
  45. // GetUser gets a user by name.
  46. GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
  47. // GetUserByUsername gets a user by username.
  48. GetUserByUsername(ctx context.Context, in *GetUserByUsernameRequest, opts ...grpc.CallOption) (*User, error)
  49. // GetUserAvatarBinary gets the avatar of a user.
  50. GetUserAvatarBinary(ctx context.Context, in *GetUserAvatarBinaryRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
  51. // CreateUser creates a new user.
  52. CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error)
  53. // UpdateUser updates a user.
  54. UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
  55. // DeleteUser deletes a user.
  56. DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  57. // ListAllUserStats returns all user stats.
  58. ListAllUserStats(ctx context.Context, in *ListAllUserStatsRequest, opts ...grpc.CallOption) (*ListAllUserStatsResponse, error)
  59. // GetUserStats returns the stats of a user.
  60. GetUserStats(ctx context.Context, in *GetUserStatsRequest, opts ...grpc.CallOption) (*UserStats, error)
  61. // GetUserSetting gets the setting of a user.
  62. GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error)
  63. // UpdateUserSetting updates the setting of a user.
  64. UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error)
  65. // ListUserAccessTokens returns a list of access tokens for a user.
  66. ListUserAccessTokens(ctx context.Context, in *ListUserAccessTokensRequest, opts ...grpc.CallOption) (*ListUserAccessTokensResponse, error)
  67. // CreateUserAccessToken creates a new access token for a user.
  68. CreateUserAccessToken(ctx context.Context, in *CreateUserAccessTokenRequest, opts ...grpc.CallOption) (*UserAccessToken, error)
  69. // DeleteUserAccessToken deletes an access token for a user.
  70. DeleteUserAccessToken(ctx context.Context, in *DeleteUserAccessTokenRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  71. // ListShortcuts returns a list of shortcuts for a user.
  72. ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error)
  73. // CreateShortcut creates a new shortcut for a user.
  74. CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
  75. // UpdateShortcut updates a shortcut for a user.
  76. UpdateShortcut(ctx context.Context, in *UpdateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error)
  77. // DeleteShortcut deletes a shortcut for a user.
  78. DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  79. }
  80. type userServiceClient struct {
  81. cc grpc.ClientConnInterface
  82. }
  83. func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
  84. return &userServiceClient{cc}
  85. }
  86. func (c *userServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) {
  87. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  88. out := new(ListUsersResponse)
  89. err := c.cc.Invoke(ctx, UserService_ListUsers_FullMethodName, in, out, cOpts...)
  90. if err != nil {
  91. return nil, err
  92. }
  93. return out, nil
  94. }
  95. func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) {
  96. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  97. out := new(User)
  98. err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...)
  99. if err != nil {
  100. return nil, err
  101. }
  102. return out, nil
  103. }
  104. func (c *userServiceClient) GetUserByUsername(ctx context.Context, in *GetUserByUsernameRequest, opts ...grpc.CallOption) (*User, error) {
  105. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  106. out := new(User)
  107. err := c.cc.Invoke(ctx, UserService_GetUserByUsername_FullMethodName, in, out, cOpts...)
  108. if err != nil {
  109. return nil, err
  110. }
  111. return out, nil
  112. }
  113. func (c *userServiceClient) GetUserAvatarBinary(ctx context.Context, in *GetUserAvatarBinaryRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
  114. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  115. out := new(httpbody.HttpBody)
  116. err := c.cc.Invoke(ctx, UserService_GetUserAvatarBinary_FullMethodName, in, out, cOpts...)
  117. if err != nil {
  118. return nil, err
  119. }
  120. return out, nil
  121. }
  122. func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) {
  123. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  124. out := new(User)
  125. err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, cOpts...)
  126. if err != nil {
  127. return nil, err
  128. }
  129. return out, nil
  130. }
  131. func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) {
  132. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  133. out := new(User)
  134. err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, cOpts...)
  135. if err != nil {
  136. return nil, err
  137. }
  138. return out, nil
  139. }
  140. func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  141. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  142. out := new(emptypb.Empty)
  143. err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, cOpts...)
  144. if err != nil {
  145. return nil, err
  146. }
  147. return out, nil
  148. }
  149. func (c *userServiceClient) ListAllUserStats(ctx context.Context, in *ListAllUserStatsRequest, opts ...grpc.CallOption) (*ListAllUserStatsResponse, error) {
  150. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  151. out := new(ListAllUserStatsResponse)
  152. err := c.cc.Invoke(ctx, UserService_ListAllUserStats_FullMethodName, in, out, cOpts...)
  153. if err != nil {
  154. return nil, err
  155. }
  156. return out, nil
  157. }
  158. func (c *userServiceClient) GetUserStats(ctx context.Context, in *GetUserStatsRequest, opts ...grpc.CallOption) (*UserStats, error) {
  159. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  160. out := new(UserStats)
  161. err := c.cc.Invoke(ctx, UserService_GetUserStats_FullMethodName, in, out, cOpts...)
  162. if err != nil {
  163. return nil, err
  164. }
  165. return out, nil
  166. }
  167. func (c *userServiceClient) GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) {
  168. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  169. out := new(UserSetting)
  170. err := c.cc.Invoke(ctx, UserService_GetUserSetting_FullMethodName, in, out, cOpts...)
  171. if err != nil {
  172. return nil, err
  173. }
  174. return out, nil
  175. }
  176. func (c *userServiceClient) UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) {
  177. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  178. out := new(UserSetting)
  179. err := c.cc.Invoke(ctx, UserService_UpdateUserSetting_FullMethodName, in, out, cOpts...)
  180. if err != nil {
  181. return nil, err
  182. }
  183. return out, nil
  184. }
  185. func (c *userServiceClient) ListUserAccessTokens(ctx context.Context, in *ListUserAccessTokensRequest, opts ...grpc.CallOption) (*ListUserAccessTokensResponse, error) {
  186. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  187. out := new(ListUserAccessTokensResponse)
  188. err := c.cc.Invoke(ctx, UserService_ListUserAccessTokens_FullMethodName, in, out, cOpts...)
  189. if err != nil {
  190. return nil, err
  191. }
  192. return out, nil
  193. }
  194. func (c *userServiceClient) CreateUserAccessToken(ctx context.Context, in *CreateUserAccessTokenRequest, opts ...grpc.CallOption) (*UserAccessToken, error) {
  195. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  196. out := new(UserAccessToken)
  197. err := c.cc.Invoke(ctx, UserService_CreateUserAccessToken_FullMethodName, in, out, cOpts...)
  198. if err != nil {
  199. return nil, err
  200. }
  201. return out, nil
  202. }
  203. func (c *userServiceClient) DeleteUserAccessToken(ctx context.Context, in *DeleteUserAccessTokenRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  204. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  205. out := new(emptypb.Empty)
  206. err := c.cc.Invoke(ctx, UserService_DeleteUserAccessToken_FullMethodName, in, out, cOpts...)
  207. if err != nil {
  208. return nil, err
  209. }
  210. return out, nil
  211. }
  212. func (c *userServiceClient) ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error) {
  213. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  214. out := new(ListShortcutsResponse)
  215. err := c.cc.Invoke(ctx, UserService_ListShortcuts_FullMethodName, in, out, cOpts...)
  216. if err != nil {
  217. return nil, err
  218. }
  219. return out, nil
  220. }
  221. func (c *userServiceClient) CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
  222. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  223. out := new(Shortcut)
  224. err := c.cc.Invoke(ctx, UserService_CreateShortcut_FullMethodName, in, out, cOpts...)
  225. if err != nil {
  226. return nil, err
  227. }
  228. return out, nil
  229. }
  230. func (c *userServiceClient) UpdateShortcut(ctx context.Context, in *UpdateShortcutRequest, opts ...grpc.CallOption) (*Shortcut, error) {
  231. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  232. out := new(Shortcut)
  233. err := c.cc.Invoke(ctx, UserService_UpdateShortcut_FullMethodName, in, out, cOpts...)
  234. if err != nil {
  235. return nil, err
  236. }
  237. return out, nil
  238. }
  239. func (c *userServiceClient) DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  240. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  241. out := new(emptypb.Empty)
  242. err := c.cc.Invoke(ctx, UserService_DeleteShortcut_FullMethodName, in, out, cOpts...)
  243. if err != nil {
  244. return nil, err
  245. }
  246. return out, nil
  247. }
  248. // UserServiceServer is the server API for UserService service.
  249. // All implementations must embed UnimplementedUserServiceServer
  250. // for forward compatibility.
  251. type UserServiceServer interface {
  252. // ListUsers returns a list of users.
  253. ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
  254. // GetUser gets a user by name.
  255. GetUser(context.Context, *GetUserRequest) (*User, error)
  256. // GetUserByUsername gets a user by username.
  257. GetUserByUsername(context.Context, *GetUserByUsernameRequest) (*User, error)
  258. // GetUserAvatarBinary gets the avatar of a user.
  259. GetUserAvatarBinary(context.Context, *GetUserAvatarBinaryRequest) (*httpbody.HttpBody, error)
  260. // CreateUser creates a new user.
  261. CreateUser(context.Context, *CreateUserRequest) (*User, error)
  262. // UpdateUser updates a user.
  263. UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
  264. // DeleteUser deletes a user.
  265. DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error)
  266. // ListAllUserStats returns all user stats.
  267. ListAllUserStats(context.Context, *ListAllUserStatsRequest) (*ListAllUserStatsResponse, error)
  268. // GetUserStats returns the stats of a user.
  269. GetUserStats(context.Context, *GetUserStatsRequest) (*UserStats, error)
  270. // GetUserSetting gets the setting of a user.
  271. GetUserSetting(context.Context, *GetUserSettingRequest) (*UserSetting, error)
  272. // UpdateUserSetting updates the setting of a user.
  273. UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UserSetting, error)
  274. // ListUserAccessTokens returns a list of access tokens for a user.
  275. ListUserAccessTokens(context.Context, *ListUserAccessTokensRequest) (*ListUserAccessTokensResponse, error)
  276. // CreateUserAccessToken creates a new access token for a user.
  277. CreateUserAccessToken(context.Context, *CreateUserAccessTokenRequest) (*UserAccessToken, error)
  278. // DeleteUserAccessToken deletes an access token for a user.
  279. DeleteUserAccessToken(context.Context, *DeleteUserAccessTokenRequest) (*emptypb.Empty, error)
  280. // ListShortcuts returns a list of shortcuts for a user.
  281. ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error)
  282. // CreateShortcut creates a new shortcut for a user.
  283. CreateShortcut(context.Context, *CreateShortcutRequest) (*Shortcut, error)
  284. // UpdateShortcut updates a shortcut for a user.
  285. UpdateShortcut(context.Context, *UpdateShortcutRequest) (*Shortcut, error)
  286. // DeleteShortcut deletes a shortcut for a user.
  287. DeleteShortcut(context.Context, *DeleteShortcutRequest) (*emptypb.Empty, error)
  288. mustEmbedUnimplementedUserServiceServer()
  289. }
  290. // UnimplementedUserServiceServer must be embedded to have
  291. // forward compatible implementations.
  292. //
  293. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  294. // pointer dereference when methods are called.
  295. type UnimplementedUserServiceServer struct{}
  296. func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) {
  297. return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented")
  298. }
  299. func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) {
  300. return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
  301. }
  302. func (UnimplementedUserServiceServer) GetUserByUsername(context.Context, *GetUserByUsernameRequest) (*User, error) {
  303. return nil, status.Errorf(codes.Unimplemented, "method GetUserByUsername not implemented")
  304. }
  305. func (UnimplementedUserServiceServer) GetUserAvatarBinary(context.Context, *GetUserAvatarBinaryRequest) (*httpbody.HttpBody, error) {
  306. return nil, status.Errorf(codes.Unimplemented, "method GetUserAvatarBinary not implemented")
  307. }
  308. func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error) {
  309. return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
  310. }
  311. func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) {
  312. return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
  313. }
  314. func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) {
  315. return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
  316. }
  317. func (UnimplementedUserServiceServer) ListAllUserStats(context.Context, *ListAllUserStatsRequest) (*ListAllUserStatsResponse, error) {
  318. return nil, status.Errorf(codes.Unimplemented, "method ListAllUserStats not implemented")
  319. }
  320. func (UnimplementedUserServiceServer) GetUserStats(context.Context, *GetUserStatsRequest) (*UserStats, error) {
  321. return nil, status.Errorf(codes.Unimplemented, "method GetUserStats not implemented")
  322. }
  323. func (UnimplementedUserServiceServer) GetUserSetting(context.Context, *GetUserSettingRequest) (*UserSetting, error) {
  324. return nil, status.Errorf(codes.Unimplemented, "method GetUserSetting not implemented")
  325. }
  326. func (UnimplementedUserServiceServer) UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UserSetting, error) {
  327. return nil, status.Errorf(codes.Unimplemented, "method UpdateUserSetting not implemented")
  328. }
  329. func (UnimplementedUserServiceServer) ListUserAccessTokens(context.Context, *ListUserAccessTokensRequest) (*ListUserAccessTokensResponse, error) {
  330. return nil, status.Errorf(codes.Unimplemented, "method ListUserAccessTokens not implemented")
  331. }
  332. func (UnimplementedUserServiceServer) CreateUserAccessToken(context.Context, *CreateUserAccessTokenRequest) (*UserAccessToken, error) {
  333. return nil, status.Errorf(codes.Unimplemented, "method CreateUserAccessToken not implemented")
  334. }
  335. func (UnimplementedUserServiceServer) DeleteUserAccessToken(context.Context, *DeleteUserAccessTokenRequest) (*emptypb.Empty, error) {
  336. return nil, status.Errorf(codes.Unimplemented, "method DeleteUserAccessToken not implemented")
  337. }
  338. func (UnimplementedUserServiceServer) ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error) {
  339. return nil, status.Errorf(codes.Unimplemented, "method ListShortcuts not implemented")
  340. }
  341. func (UnimplementedUserServiceServer) CreateShortcut(context.Context, *CreateShortcutRequest) (*Shortcut, error) {
  342. return nil, status.Errorf(codes.Unimplemented, "method CreateShortcut not implemented")
  343. }
  344. func (UnimplementedUserServiceServer) UpdateShortcut(context.Context, *UpdateShortcutRequest) (*Shortcut, error) {
  345. return nil, status.Errorf(codes.Unimplemented, "method UpdateShortcut not implemented")
  346. }
  347. func (UnimplementedUserServiceServer) DeleteShortcut(context.Context, *DeleteShortcutRequest) (*emptypb.Empty, error) {
  348. return nil, status.Errorf(codes.Unimplemented, "method DeleteShortcut not implemented")
  349. }
  350. func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
  351. func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
  352. // UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
  353. // Use of this interface is not recommended, as added methods to UserServiceServer will
  354. // result in compilation errors.
  355. type UnsafeUserServiceServer interface {
  356. mustEmbedUnimplementedUserServiceServer()
  357. }
  358. func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
  359. // If the following call pancis, it indicates UnimplementedUserServiceServer was
  360. // embedded by pointer and is nil. This will cause panics if an
  361. // unimplemented method is ever invoked, so we test this at initialization
  362. // time to prevent it from happening at runtime later due to I/O.
  363. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  364. t.testEmbeddedByValue()
  365. }
  366. s.RegisterService(&UserService_ServiceDesc, srv)
  367. }
  368. func _UserService_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  369. in := new(ListUsersRequest)
  370. if err := dec(in); err != nil {
  371. return nil, err
  372. }
  373. if interceptor == nil {
  374. return srv.(UserServiceServer).ListUsers(ctx, in)
  375. }
  376. info := &grpc.UnaryServerInfo{
  377. Server: srv,
  378. FullMethod: UserService_ListUsers_FullMethodName,
  379. }
  380. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  381. return srv.(UserServiceServer).ListUsers(ctx, req.(*ListUsersRequest))
  382. }
  383. return interceptor(ctx, in, info, handler)
  384. }
  385. func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  386. in := new(GetUserRequest)
  387. if err := dec(in); err != nil {
  388. return nil, err
  389. }
  390. if interceptor == nil {
  391. return srv.(UserServiceServer).GetUser(ctx, in)
  392. }
  393. info := &grpc.UnaryServerInfo{
  394. Server: srv,
  395. FullMethod: UserService_GetUser_FullMethodName,
  396. }
  397. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  398. return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest))
  399. }
  400. return interceptor(ctx, in, info, handler)
  401. }
  402. func _UserService_GetUserByUsername_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  403. in := new(GetUserByUsernameRequest)
  404. if err := dec(in); err != nil {
  405. return nil, err
  406. }
  407. if interceptor == nil {
  408. return srv.(UserServiceServer).GetUserByUsername(ctx, in)
  409. }
  410. info := &grpc.UnaryServerInfo{
  411. Server: srv,
  412. FullMethod: UserService_GetUserByUsername_FullMethodName,
  413. }
  414. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  415. return srv.(UserServiceServer).GetUserByUsername(ctx, req.(*GetUserByUsernameRequest))
  416. }
  417. return interceptor(ctx, in, info, handler)
  418. }
  419. func _UserService_GetUserAvatarBinary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  420. in := new(GetUserAvatarBinaryRequest)
  421. if err := dec(in); err != nil {
  422. return nil, err
  423. }
  424. if interceptor == nil {
  425. return srv.(UserServiceServer).GetUserAvatarBinary(ctx, in)
  426. }
  427. info := &grpc.UnaryServerInfo{
  428. Server: srv,
  429. FullMethod: UserService_GetUserAvatarBinary_FullMethodName,
  430. }
  431. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  432. return srv.(UserServiceServer).GetUserAvatarBinary(ctx, req.(*GetUserAvatarBinaryRequest))
  433. }
  434. return interceptor(ctx, in, info, handler)
  435. }
  436. func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  437. in := new(CreateUserRequest)
  438. if err := dec(in); err != nil {
  439. return nil, err
  440. }
  441. if interceptor == nil {
  442. return srv.(UserServiceServer).CreateUser(ctx, in)
  443. }
  444. info := &grpc.UnaryServerInfo{
  445. Server: srv,
  446. FullMethod: UserService_CreateUser_FullMethodName,
  447. }
  448. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  449. return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
  450. }
  451. return interceptor(ctx, in, info, handler)
  452. }
  453. func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  454. in := new(UpdateUserRequest)
  455. if err := dec(in); err != nil {
  456. return nil, err
  457. }
  458. if interceptor == nil {
  459. return srv.(UserServiceServer).UpdateUser(ctx, in)
  460. }
  461. info := &grpc.UnaryServerInfo{
  462. Server: srv,
  463. FullMethod: UserService_UpdateUser_FullMethodName,
  464. }
  465. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  466. return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))
  467. }
  468. return interceptor(ctx, in, info, handler)
  469. }
  470. func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  471. in := new(DeleteUserRequest)
  472. if err := dec(in); err != nil {
  473. return nil, err
  474. }
  475. if interceptor == nil {
  476. return srv.(UserServiceServer).DeleteUser(ctx, in)
  477. }
  478. info := &grpc.UnaryServerInfo{
  479. Server: srv,
  480. FullMethod: UserService_DeleteUser_FullMethodName,
  481. }
  482. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  483. return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
  484. }
  485. return interceptor(ctx, in, info, handler)
  486. }
  487. func _UserService_ListAllUserStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  488. in := new(ListAllUserStatsRequest)
  489. if err := dec(in); err != nil {
  490. return nil, err
  491. }
  492. if interceptor == nil {
  493. return srv.(UserServiceServer).ListAllUserStats(ctx, in)
  494. }
  495. info := &grpc.UnaryServerInfo{
  496. Server: srv,
  497. FullMethod: UserService_ListAllUserStats_FullMethodName,
  498. }
  499. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  500. return srv.(UserServiceServer).ListAllUserStats(ctx, req.(*ListAllUserStatsRequest))
  501. }
  502. return interceptor(ctx, in, info, handler)
  503. }
  504. func _UserService_GetUserStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  505. in := new(GetUserStatsRequest)
  506. if err := dec(in); err != nil {
  507. return nil, err
  508. }
  509. if interceptor == nil {
  510. return srv.(UserServiceServer).GetUserStats(ctx, in)
  511. }
  512. info := &grpc.UnaryServerInfo{
  513. Server: srv,
  514. FullMethod: UserService_GetUserStats_FullMethodName,
  515. }
  516. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  517. return srv.(UserServiceServer).GetUserStats(ctx, req.(*GetUserStatsRequest))
  518. }
  519. return interceptor(ctx, in, info, handler)
  520. }
  521. func _UserService_GetUserSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  522. in := new(GetUserSettingRequest)
  523. if err := dec(in); err != nil {
  524. return nil, err
  525. }
  526. if interceptor == nil {
  527. return srv.(UserServiceServer).GetUserSetting(ctx, in)
  528. }
  529. info := &grpc.UnaryServerInfo{
  530. Server: srv,
  531. FullMethod: UserService_GetUserSetting_FullMethodName,
  532. }
  533. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  534. return srv.(UserServiceServer).GetUserSetting(ctx, req.(*GetUserSettingRequest))
  535. }
  536. return interceptor(ctx, in, info, handler)
  537. }
  538. func _UserService_UpdateUserSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  539. in := new(UpdateUserSettingRequest)
  540. if err := dec(in); err != nil {
  541. return nil, err
  542. }
  543. if interceptor == nil {
  544. return srv.(UserServiceServer).UpdateUserSetting(ctx, in)
  545. }
  546. info := &grpc.UnaryServerInfo{
  547. Server: srv,
  548. FullMethod: UserService_UpdateUserSetting_FullMethodName,
  549. }
  550. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  551. return srv.(UserServiceServer).UpdateUserSetting(ctx, req.(*UpdateUserSettingRequest))
  552. }
  553. return interceptor(ctx, in, info, handler)
  554. }
  555. func _UserService_ListUserAccessTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  556. in := new(ListUserAccessTokensRequest)
  557. if err := dec(in); err != nil {
  558. return nil, err
  559. }
  560. if interceptor == nil {
  561. return srv.(UserServiceServer).ListUserAccessTokens(ctx, in)
  562. }
  563. info := &grpc.UnaryServerInfo{
  564. Server: srv,
  565. FullMethod: UserService_ListUserAccessTokens_FullMethodName,
  566. }
  567. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  568. return srv.(UserServiceServer).ListUserAccessTokens(ctx, req.(*ListUserAccessTokensRequest))
  569. }
  570. return interceptor(ctx, in, info, handler)
  571. }
  572. func _UserService_CreateUserAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  573. in := new(CreateUserAccessTokenRequest)
  574. if err := dec(in); err != nil {
  575. return nil, err
  576. }
  577. if interceptor == nil {
  578. return srv.(UserServiceServer).CreateUserAccessToken(ctx, in)
  579. }
  580. info := &grpc.UnaryServerInfo{
  581. Server: srv,
  582. FullMethod: UserService_CreateUserAccessToken_FullMethodName,
  583. }
  584. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  585. return srv.(UserServiceServer).CreateUserAccessToken(ctx, req.(*CreateUserAccessTokenRequest))
  586. }
  587. return interceptor(ctx, in, info, handler)
  588. }
  589. func _UserService_DeleteUserAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  590. in := new(DeleteUserAccessTokenRequest)
  591. if err := dec(in); err != nil {
  592. return nil, err
  593. }
  594. if interceptor == nil {
  595. return srv.(UserServiceServer).DeleteUserAccessToken(ctx, in)
  596. }
  597. info := &grpc.UnaryServerInfo{
  598. Server: srv,
  599. FullMethod: UserService_DeleteUserAccessToken_FullMethodName,
  600. }
  601. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  602. return srv.(UserServiceServer).DeleteUserAccessToken(ctx, req.(*DeleteUserAccessTokenRequest))
  603. }
  604. return interceptor(ctx, in, info, handler)
  605. }
  606. func _UserService_ListShortcuts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  607. in := new(ListShortcutsRequest)
  608. if err := dec(in); err != nil {
  609. return nil, err
  610. }
  611. if interceptor == nil {
  612. return srv.(UserServiceServer).ListShortcuts(ctx, in)
  613. }
  614. info := &grpc.UnaryServerInfo{
  615. Server: srv,
  616. FullMethod: UserService_ListShortcuts_FullMethodName,
  617. }
  618. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  619. return srv.(UserServiceServer).ListShortcuts(ctx, req.(*ListShortcutsRequest))
  620. }
  621. return interceptor(ctx, in, info, handler)
  622. }
  623. func _UserService_CreateShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  624. in := new(CreateShortcutRequest)
  625. if err := dec(in); err != nil {
  626. return nil, err
  627. }
  628. if interceptor == nil {
  629. return srv.(UserServiceServer).CreateShortcut(ctx, in)
  630. }
  631. info := &grpc.UnaryServerInfo{
  632. Server: srv,
  633. FullMethod: UserService_CreateShortcut_FullMethodName,
  634. }
  635. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  636. return srv.(UserServiceServer).CreateShortcut(ctx, req.(*CreateShortcutRequest))
  637. }
  638. return interceptor(ctx, in, info, handler)
  639. }
  640. func _UserService_UpdateShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  641. in := new(UpdateShortcutRequest)
  642. if err := dec(in); err != nil {
  643. return nil, err
  644. }
  645. if interceptor == nil {
  646. return srv.(UserServiceServer).UpdateShortcut(ctx, in)
  647. }
  648. info := &grpc.UnaryServerInfo{
  649. Server: srv,
  650. FullMethod: UserService_UpdateShortcut_FullMethodName,
  651. }
  652. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  653. return srv.(UserServiceServer).UpdateShortcut(ctx, req.(*UpdateShortcutRequest))
  654. }
  655. return interceptor(ctx, in, info, handler)
  656. }
  657. func _UserService_DeleteShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  658. in := new(DeleteShortcutRequest)
  659. if err := dec(in); err != nil {
  660. return nil, err
  661. }
  662. if interceptor == nil {
  663. return srv.(UserServiceServer).DeleteShortcut(ctx, in)
  664. }
  665. info := &grpc.UnaryServerInfo{
  666. Server: srv,
  667. FullMethod: UserService_DeleteShortcut_FullMethodName,
  668. }
  669. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  670. return srv.(UserServiceServer).DeleteShortcut(ctx, req.(*DeleteShortcutRequest))
  671. }
  672. return interceptor(ctx, in, info, handler)
  673. }
  674. // UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
  675. // It's only intended for direct use with grpc.RegisterService,
  676. // and not to be introspected or modified (even as a copy)
  677. var UserService_ServiceDesc = grpc.ServiceDesc{
  678. ServiceName: "memos.api.v1.UserService",
  679. HandlerType: (*UserServiceServer)(nil),
  680. Methods: []grpc.MethodDesc{
  681. {
  682. MethodName: "ListUsers",
  683. Handler: _UserService_ListUsers_Handler,
  684. },
  685. {
  686. MethodName: "GetUser",
  687. Handler: _UserService_GetUser_Handler,
  688. },
  689. {
  690. MethodName: "GetUserByUsername",
  691. Handler: _UserService_GetUserByUsername_Handler,
  692. },
  693. {
  694. MethodName: "GetUserAvatarBinary",
  695. Handler: _UserService_GetUserAvatarBinary_Handler,
  696. },
  697. {
  698. MethodName: "CreateUser",
  699. Handler: _UserService_CreateUser_Handler,
  700. },
  701. {
  702. MethodName: "UpdateUser",
  703. Handler: _UserService_UpdateUser_Handler,
  704. },
  705. {
  706. MethodName: "DeleteUser",
  707. Handler: _UserService_DeleteUser_Handler,
  708. },
  709. {
  710. MethodName: "ListAllUserStats",
  711. Handler: _UserService_ListAllUserStats_Handler,
  712. },
  713. {
  714. MethodName: "GetUserStats",
  715. Handler: _UserService_GetUserStats_Handler,
  716. },
  717. {
  718. MethodName: "GetUserSetting",
  719. Handler: _UserService_GetUserSetting_Handler,
  720. },
  721. {
  722. MethodName: "UpdateUserSetting",
  723. Handler: _UserService_UpdateUserSetting_Handler,
  724. },
  725. {
  726. MethodName: "ListUserAccessTokens",
  727. Handler: _UserService_ListUserAccessTokens_Handler,
  728. },
  729. {
  730. MethodName: "CreateUserAccessToken",
  731. Handler: _UserService_CreateUserAccessToken_Handler,
  732. },
  733. {
  734. MethodName: "DeleteUserAccessToken",
  735. Handler: _UserService_DeleteUserAccessToken_Handler,
  736. },
  737. {
  738. MethodName: "ListShortcuts",
  739. Handler: _UserService_ListShortcuts_Handler,
  740. },
  741. {
  742. MethodName: "CreateShortcut",
  743. Handler: _UserService_CreateShortcut_Handler,
  744. },
  745. {
  746. MethodName: "UpdateShortcut",
  747. Handler: _UserService_UpdateShortcut_Handler,
  748. },
  749. {
  750. MethodName: "DeleteShortcut",
  751. Handler: _UserService_DeleteShortcut_Handler,
  752. },
  753. },
  754. Streams: []grpc.StreamDesc{},
  755. Metadata: "api/v1/user_service.proto",
  756. }