user_service_grpc.pb.go 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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_SearchUsers_FullMethodName = "/memos.api.v1.UserService/SearchUsers"
  22. UserService_GetUser_FullMethodName = "/memos.api.v1.UserService/GetUser"
  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. )
  35. // UserServiceClient is the client API for UserService service.
  36. //
  37. // 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.
  38. type UserServiceClient interface {
  39. // ListUsers returns a list of users.
  40. ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
  41. // SearchUsers searches users by filter.
  42. SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error)
  43. // GetUser gets a user by name.
  44. GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
  45. // GetUserAvatarBinary gets the avatar of a user.
  46. GetUserAvatarBinary(ctx context.Context, in *GetUserAvatarBinaryRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
  47. // CreateUser creates a new user.
  48. CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error)
  49. // UpdateUser updates a user.
  50. UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
  51. // DeleteUser deletes a user.
  52. DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  53. // ListAllUserStats returns all user stats.
  54. ListAllUserStats(ctx context.Context, in *ListAllUserStatsRequest, opts ...grpc.CallOption) (*ListAllUserStatsResponse, error)
  55. // GetUserStats returns the stats of a user.
  56. GetUserStats(ctx context.Context, in *GetUserStatsRequest, opts ...grpc.CallOption) (*UserStats, error)
  57. // GetUserSetting gets the setting of a user.
  58. GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error)
  59. // UpdateUserSetting updates the setting of a user.
  60. UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error)
  61. // ListUserAccessTokens returns a list of access tokens for a user.
  62. ListUserAccessTokens(ctx context.Context, in *ListUserAccessTokensRequest, opts ...grpc.CallOption) (*ListUserAccessTokensResponse, error)
  63. // CreateUserAccessToken creates a new access token for a user.
  64. CreateUserAccessToken(ctx context.Context, in *CreateUserAccessTokenRequest, opts ...grpc.CallOption) (*UserAccessToken, error)
  65. // DeleteUserAccessToken deletes an access token for a user.
  66. DeleteUserAccessToken(ctx context.Context, in *DeleteUserAccessTokenRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  67. }
  68. type userServiceClient struct {
  69. cc grpc.ClientConnInterface
  70. }
  71. func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
  72. return &userServiceClient{cc}
  73. }
  74. func (c *userServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) {
  75. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  76. out := new(ListUsersResponse)
  77. err := c.cc.Invoke(ctx, UserService_ListUsers_FullMethodName, in, out, cOpts...)
  78. if err != nil {
  79. return nil, err
  80. }
  81. return out, nil
  82. }
  83. func (c *userServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) {
  84. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  85. out := new(SearchUsersResponse)
  86. err := c.cc.Invoke(ctx, UserService_SearchUsers_FullMethodName, in, out, cOpts...)
  87. if err != nil {
  88. return nil, err
  89. }
  90. return out, nil
  91. }
  92. func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) {
  93. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  94. out := new(User)
  95. err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...)
  96. if err != nil {
  97. return nil, err
  98. }
  99. return out, nil
  100. }
  101. func (c *userServiceClient) GetUserAvatarBinary(ctx context.Context, in *GetUserAvatarBinaryRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
  102. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  103. out := new(httpbody.HttpBody)
  104. err := c.cc.Invoke(ctx, UserService_GetUserAvatarBinary_FullMethodName, in, out, cOpts...)
  105. if err != nil {
  106. return nil, err
  107. }
  108. return out, nil
  109. }
  110. func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) {
  111. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  112. out := new(User)
  113. err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, cOpts...)
  114. if err != nil {
  115. return nil, err
  116. }
  117. return out, nil
  118. }
  119. func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) {
  120. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  121. out := new(User)
  122. err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, cOpts...)
  123. if err != nil {
  124. return nil, err
  125. }
  126. return out, nil
  127. }
  128. func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  129. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  130. out := new(emptypb.Empty)
  131. err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, cOpts...)
  132. if err != nil {
  133. return nil, err
  134. }
  135. return out, nil
  136. }
  137. func (c *userServiceClient) ListAllUserStats(ctx context.Context, in *ListAllUserStatsRequest, opts ...grpc.CallOption) (*ListAllUserStatsResponse, error) {
  138. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  139. out := new(ListAllUserStatsResponse)
  140. err := c.cc.Invoke(ctx, UserService_ListAllUserStats_FullMethodName, in, out, cOpts...)
  141. if err != nil {
  142. return nil, err
  143. }
  144. return out, nil
  145. }
  146. func (c *userServiceClient) GetUserStats(ctx context.Context, in *GetUserStatsRequest, opts ...grpc.CallOption) (*UserStats, error) {
  147. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  148. out := new(UserStats)
  149. err := c.cc.Invoke(ctx, UserService_GetUserStats_FullMethodName, in, out, cOpts...)
  150. if err != nil {
  151. return nil, err
  152. }
  153. return out, nil
  154. }
  155. func (c *userServiceClient) GetUserSetting(ctx context.Context, in *GetUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) {
  156. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  157. out := new(UserSetting)
  158. err := c.cc.Invoke(ctx, UserService_GetUserSetting_FullMethodName, in, out, cOpts...)
  159. if err != nil {
  160. return nil, err
  161. }
  162. return out, nil
  163. }
  164. func (c *userServiceClient) UpdateUserSetting(ctx context.Context, in *UpdateUserSettingRequest, opts ...grpc.CallOption) (*UserSetting, error) {
  165. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  166. out := new(UserSetting)
  167. err := c.cc.Invoke(ctx, UserService_UpdateUserSetting_FullMethodName, in, out, cOpts...)
  168. if err != nil {
  169. return nil, err
  170. }
  171. return out, nil
  172. }
  173. func (c *userServiceClient) ListUserAccessTokens(ctx context.Context, in *ListUserAccessTokensRequest, opts ...grpc.CallOption) (*ListUserAccessTokensResponse, error) {
  174. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  175. out := new(ListUserAccessTokensResponse)
  176. err := c.cc.Invoke(ctx, UserService_ListUserAccessTokens_FullMethodName, in, out, cOpts...)
  177. if err != nil {
  178. return nil, err
  179. }
  180. return out, nil
  181. }
  182. func (c *userServiceClient) CreateUserAccessToken(ctx context.Context, in *CreateUserAccessTokenRequest, opts ...grpc.CallOption) (*UserAccessToken, error) {
  183. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  184. out := new(UserAccessToken)
  185. err := c.cc.Invoke(ctx, UserService_CreateUserAccessToken_FullMethodName, in, out, cOpts...)
  186. if err != nil {
  187. return nil, err
  188. }
  189. return out, nil
  190. }
  191. func (c *userServiceClient) DeleteUserAccessToken(ctx context.Context, in *DeleteUserAccessTokenRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  192. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  193. out := new(emptypb.Empty)
  194. err := c.cc.Invoke(ctx, UserService_DeleteUserAccessToken_FullMethodName, in, out, cOpts...)
  195. if err != nil {
  196. return nil, err
  197. }
  198. return out, nil
  199. }
  200. // UserServiceServer is the server API for UserService service.
  201. // All implementations must embed UnimplementedUserServiceServer
  202. // for forward compatibility.
  203. type UserServiceServer interface {
  204. // ListUsers returns a list of users.
  205. ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
  206. // SearchUsers searches users by filter.
  207. SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error)
  208. // GetUser gets a user by name.
  209. GetUser(context.Context, *GetUserRequest) (*User, error)
  210. // GetUserAvatarBinary gets the avatar of a user.
  211. GetUserAvatarBinary(context.Context, *GetUserAvatarBinaryRequest) (*httpbody.HttpBody, error)
  212. // CreateUser creates a new user.
  213. CreateUser(context.Context, *CreateUserRequest) (*User, error)
  214. // UpdateUser updates a user.
  215. UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
  216. // DeleteUser deletes a user.
  217. DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error)
  218. // ListAllUserStats returns all user stats.
  219. ListAllUserStats(context.Context, *ListAllUserStatsRequest) (*ListAllUserStatsResponse, error)
  220. // GetUserStats returns the stats of a user.
  221. GetUserStats(context.Context, *GetUserStatsRequest) (*UserStats, error)
  222. // GetUserSetting gets the setting of a user.
  223. GetUserSetting(context.Context, *GetUserSettingRequest) (*UserSetting, error)
  224. // UpdateUserSetting updates the setting of a user.
  225. UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UserSetting, error)
  226. // ListUserAccessTokens returns a list of access tokens for a user.
  227. ListUserAccessTokens(context.Context, *ListUserAccessTokensRequest) (*ListUserAccessTokensResponse, error)
  228. // CreateUserAccessToken creates a new access token for a user.
  229. CreateUserAccessToken(context.Context, *CreateUserAccessTokenRequest) (*UserAccessToken, error)
  230. // DeleteUserAccessToken deletes an access token for a user.
  231. DeleteUserAccessToken(context.Context, *DeleteUserAccessTokenRequest) (*emptypb.Empty, error)
  232. mustEmbedUnimplementedUserServiceServer()
  233. }
  234. // UnimplementedUserServiceServer must be embedded to have
  235. // forward compatible implementations.
  236. //
  237. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  238. // pointer dereference when methods are called.
  239. type UnimplementedUserServiceServer struct{}
  240. func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) {
  241. return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented")
  242. }
  243. func (UnimplementedUserServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) {
  244. return nil, status.Errorf(codes.Unimplemented, "method SearchUsers not implemented")
  245. }
  246. func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) {
  247. return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
  248. }
  249. func (UnimplementedUserServiceServer) GetUserAvatarBinary(context.Context, *GetUserAvatarBinaryRequest) (*httpbody.HttpBody, error) {
  250. return nil, status.Errorf(codes.Unimplemented, "method GetUserAvatarBinary not implemented")
  251. }
  252. func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error) {
  253. return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
  254. }
  255. func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) {
  256. return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
  257. }
  258. func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) {
  259. return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
  260. }
  261. func (UnimplementedUserServiceServer) ListAllUserStats(context.Context, *ListAllUserStatsRequest) (*ListAllUserStatsResponse, error) {
  262. return nil, status.Errorf(codes.Unimplemented, "method ListAllUserStats not implemented")
  263. }
  264. func (UnimplementedUserServiceServer) GetUserStats(context.Context, *GetUserStatsRequest) (*UserStats, error) {
  265. return nil, status.Errorf(codes.Unimplemented, "method GetUserStats not implemented")
  266. }
  267. func (UnimplementedUserServiceServer) GetUserSetting(context.Context, *GetUserSettingRequest) (*UserSetting, error) {
  268. return nil, status.Errorf(codes.Unimplemented, "method GetUserSetting not implemented")
  269. }
  270. func (UnimplementedUserServiceServer) UpdateUserSetting(context.Context, *UpdateUserSettingRequest) (*UserSetting, error) {
  271. return nil, status.Errorf(codes.Unimplemented, "method UpdateUserSetting not implemented")
  272. }
  273. func (UnimplementedUserServiceServer) ListUserAccessTokens(context.Context, *ListUserAccessTokensRequest) (*ListUserAccessTokensResponse, error) {
  274. return nil, status.Errorf(codes.Unimplemented, "method ListUserAccessTokens not implemented")
  275. }
  276. func (UnimplementedUserServiceServer) CreateUserAccessToken(context.Context, *CreateUserAccessTokenRequest) (*UserAccessToken, error) {
  277. return nil, status.Errorf(codes.Unimplemented, "method CreateUserAccessToken not implemented")
  278. }
  279. func (UnimplementedUserServiceServer) DeleteUserAccessToken(context.Context, *DeleteUserAccessTokenRequest) (*emptypb.Empty, error) {
  280. return nil, status.Errorf(codes.Unimplemented, "method DeleteUserAccessToken not implemented")
  281. }
  282. func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
  283. func (UnimplementedUserServiceServer) testEmbeddedByValue() {}
  284. // UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
  285. // Use of this interface is not recommended, as added methods to UserServiceServer will
  286. // result in compilation errors.
  287. type UnsafeUserServiceServer interface {
  288. mustEmbedUnimplementedUserServiceServer()
  289. }
  290. func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
  291. // If the following call pancis, it indicates UnimplementedUserServiceServer was
  292. // embedded by pointer and is nil. This will cause panics if an
  293. // unimplemented method is ever invoked, so we test this at initialization
  294. // time to prevent it from happening at runtime later due to I/O.
  295. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  296. t.testEmbeddedByValue()
  297. }
  298. s.RegisterService(&UserService_ServiceDesc, srv)
  299. }
  300. func _UserService_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  301. in := new(ListUsersRequest)
  302. if err := dec(in); err != nil {
  303. return nil, err
  304. }
  305. if interceptor == nil {
  306. return srv.(UserServiceServer).ListUsers(ctx, in)
  307. }
  308. info := &grpc.UnaryServerInfo{
  309. Server: srv,
  310. FullMethod: UserService_ListUsers_FullMethodName,
  311. }
  312. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  313. return srv.(UserServiceServer).ListUsers(ctx, req.(*ListUsersRequest))
  314. }
  315. return interceptor(ctx, in, info, handler)
  316. }
  317. func _UserService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  318. in := new(SearchUsersRequest)
  319. if err := dec(in); err != nil {
  320. return nil, err
  321. }
  322. if interceptor == nil {
  323. return srv.(UserServiceServer).SearchUsers(ctx, in)
  324. }
  325. info := &grpc.UnaryServerInfo{
  326. Server: srv,
  327. FullMethod: UserService_SearchUsers_FullMethodName,
  328. }
  329. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  330. return srv.(UserServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest))
  331. }
  332. return interceptor(ctx, in, info, handler)
  333. }
  334. func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  335. in := new(GetUserRequest)
  336. if err := dec(in); err != nil {
  337. return nil, err
  338. }
  339. if interceptor == nil {
  340. return srv.(UserServiceServer).GetUser(ctx, in)
  341. }
  342. info := &grpc.UnaryServerInfo{
  343. Server: srv,
  344. FullMethod: UserService_GetUser_FullMethodName,
  345. }
  346. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  347. return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest))
  348. }
  349. return interceptor(ctx, in, info, handler)
  350. }
  351. func _UserService_GetUserAvatarBinary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  352. in := new(GetUserAvatarBinaryRequest)
  353. if err := dec(in); err != nil {
  354. return nil, err
  355. }
  356. if interceptor == nil {
  357. return srv.(UserServiceServer).GetUserAvatarBinary(ctx, in)
  358. }
  359. info := &grpc.UnaryServerInfo{
  360. Server: srv,
  361. FullMethod: UserService_GetUserAvatarBinary_FullMethodName,
  362. }
  363. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  364. return srv.(UserServiceServer).GetUserAvatarBinary(ctx, req.(*GetUserAvatarBinaryRequest))
  365. }
  366. return interceptor(ctx, in, info, handler)
  367. }
  368. func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  369. in := new(CreateUserRequest)
  370. if err := dec(in); err != nil {
  371. return nil, err
  372. }
  373. if interceptor == nil {
  374. return srv.(UserServiceServer).CreateUser(ctx, in)
  375. }
  376. info := &grpc.UnaryServerInfo{
  377. Server: srv,
  378. FullMethod: UserService_CreateUser_FullMethodName,
  379. }
  380. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  381. return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
  382. }
  383. return interceptor(ctx, in, info, handler)
  384. }
  385. func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  386. in := new(UpdateUserRequest)
  387. if err := dec(in); err != nil {
  388. return nil, err
  389. }
  390. if interceptor == nil {
  391. return srv.(UserServiceServer).UpdateUser(ctx, in)
  392. }
  393. info := &grpc.UnaryServerInfo{
  394. Server: srv,
  395. FullMethod: UserService_UpdateUser_FullMethodName,
  396. }
  397. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  398. return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))
  399. }
  400. return interceptor(ctx, in, info, handler)
  401. }
  402. func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  403. in := new(DeleteUserRequest)
  404. if err := dec(in); err != nil {
  405. return nil, err
  406. }
  407. if interceptor == nil {
  408. return srv.(UserServiceServer).DeleteUser(ctx, in)
  409. }
  410. info := &grpc.UnaryServerInfo{
  411. Server: srv,
  412. FullMethod: UserService_DeleteUser_FullMethodName,
  413. }
  414. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  415. return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
  416. }
  417. return interceptor(ctx, in, info, handler)
  418. }
  419. func _UserService_ListAllUserStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  420. in := new(ListAllUserStatsRequest)
  421. if err := dec(in); err != nil {
  422. return nil, err
  423. }
  424. if interceptor == nil {
  425. return srv.(UserServiceServer).ListAllUserStats(ctx, in)
  426. }
  427. info := &grpc.UnaryServerInfo{
  428. Server: srv,
  429. FullMethod: UserService_ListAllUserStats_FullMethodName,
  430. }
  431. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  432. return srv.(UserServiceServer).ListAllUserStats(ctx, req.(*ListAllUserStatsRequest))
  433. }
  434. return interceptor(ctx, in, info, handler)
  435. }
  436. func _UserService_GetUserStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  437. in := new(GetUserStatsRequest)
  438. if err := dec(in); err != nil {
  439. return nil, err
  440. }
  441. if interceptor == nil {
  442. return srv.(UserServiceServer).GetUserStats(ctx, in)
  443. }
  444. info := &grpc.UnaryServerInfo{
  445. Server: srv,
  446. FullMethod: UserService_GetUserStats_FullMethodName,
  447. }
  448. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  449. return srv.(UserServiceServer).GetUserStats(ctx, req.(*GetUserStatsRequest))
  450. }
  451. return interceptor(ctx, in, info, handler)
  452. }
  453. func _UserService_GetUserSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  454. in := new(GetUserSettingRequest)
  455. if err := dec(in); err != nil {
  456. return nil, err
  457. }
  458. if interceptor == nil {
  459. return srv.(UserServiceServer).GetUserSetting(ctx, in)
  460. }
  461. info := &grpc.UnaryServerInfo{
  462. Server: srv,
  463. FullMethod: UserService_GetUserSetting_FullMethodName,
  464. }
  465. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  466. return srv.(UserServiceServer).GetUserSetting(ctx, req.(*GetUserSettingRequest))
  467. }
  468. return interceptor(ctx, in, info, handler)
  469. }
  470. func _UserService_UpdateUserSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  471. in := new(UpdateUserSettingRequest)
  472. if err := dec(in); err != nil {
  473. return nil, err
  474. }
  475. if interceptor == nil {
  476. return srv.(UserServiceServer).UpdateUserSetting(ctx, in)
  477. }
  478. info := &grpc.UnaryServerInfo{
  479. Server: srv,
  480. FullMethod: UserService_UpdateUserSetting_FullMethodName,
  481. }
  482. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  483. return srv.(UserServiceServer).UpdateUserSetting(ctx, req.(*UpdateUserSettingRequest))
  484. }
  485. return interceptor(ctx, in, info, handler)
  486. }
  487. func _UserService_ListUserAccessTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  488. in := new(ListUserAccessTokensRequest)
  489. if err := dec(in); err != nil {
  490. return nil, err
  491. }
  492. if interceptor == nil {
  493. return srv.(UserServiceServer).ListUserAccessTokens(ctx, in)
  494. }
  495. info := &grpc.UnaryServerInfo{
  496. Server: srv,
  497. FullMethod: UserService_ListUserAccessTokens_FullMethodName,
  498. }
  499. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  500. return srv.(UserServiceServer).ListUserAccessTokens(ctx, req.(*ListUserAccessTokensRequest))
  501. }
  502. return interceptor(ctx, in, info, handler)
  503. }
  504. func _UserService_CreateUserAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  505. in := new(CreateUserAccessTokenRequest)
  506. if err := dec(in); err != nil {
  507. return nil, err
  508. }
  509. if interceptor == nil {
  510. return srv.(UserServiceServer).CreateUserAccessToken(ctx, in)
  511. }
  512. info := &grpc.UnaryServerInfo{
  513. Server: srv,
  514. FullMethod: UserService_CreateUserAccessToken_FullMethodName,
  515. }
  516. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  517. return srv.(UserServiceServer).CreateUserAccessToken(ctx, req.(*CreateUserAccessTokenRequest))
  518. }
  519. return interceptor(ctx, in, info, handler)
  520. }
  521. func _UserService_DeleteUserAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  522. in := new(DeleteUserAccessTokenRequest)
  523. if err := dec(in); err != nil {
  524. return nil, err
  525. }
  526. if interceptor == nil {
  527. return srv.(UserServiceServer).DeleteUserAccessToken(ctx, in)
  528. }
  529. info := &grpc.UnaryServerInfo{
  530. Server: srv,
  531. FullMethod: UserService_DeleteUserAccessToken_FullMethodName,
  532. }
  533. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  534. return srv.(UserServiceServer).DeleteUserAccessToken(ctx, req.(*DeleteUserAccessTokenRequest))
  535. }
  536. return interceptor(ctx, in, info, handler)
  537. }
  538. // UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
  539. // It's only intended for direct use with grpc.RegisterService,
  540. // and not to be introspected or modified (even as a copy)
  541. var UserService_ServiceDesc = grpc.ServiceDesc{
  542. ServiceName: "memos.api.v1.UserService",
  543. HandlerType: (*UserServiceServer)(nil),
  544. Methods: []grpc.MethodDesc{
  545. {
  546. MethodName: "ListUsers",
  547. Handler: _UserService_ListUsers_Handler,
  548. },
  549. {
  550. MethodName: "SearchUsers",
  551. Handler: _UserService_SearchUsers_Handler,
  552. },
  553. {
  554. MethodName: "GetUser",
  555. Handler: _UserService_GetUser_Handler,
  556. },
  557. {
  558. MethodName: "GetUserAvatarBinary",
  559. Handler: _UserService_GetUserAvatarBinary_Handler,
  560. },
  561. {
  562. MethodName: "CreateUser",
  563. Handler: _UserService_CreateUser_Handler,
  564. },
  565. {
  566. MethodName: "UpdateUser",
  567. Handler: _UserService_UpdateUser_Handler,
  568. },
  569. {
  570. MethodName: "DeleteUser",
  571. Handler: _UserService_DeleteUser_Handler,
  572. },
  573. {
  574. MethodName: "ListAllUserStats",
  575. Handler: _UserService_ListAllUserStats_Handler,
  576. },
  577. {
  578. MethodName: "GetUserStats",
  579. Handler: _UserService_GetUserStats_Handler,
  580. },
  581. {
  582. MethodName: "GetUserSetting",
  583. Handler: _UserService_GetUserSetting_Handler,
  584. },
  585. {
  586. MethodName: "UpdateUserSetting",
  587. Handler: _UserService_UpdateUserSetting_Handler,
  588. },
  589. {
  590. MethodName: "ListUserAccessTokens",
  591. Handler: _UserService_ListUserAccessTokens_Handler,
  592. },
  593. {
  594. MethodName: "CreateUserAccessToken",
  595. Handler: _UserService_CreateUserAccessToken_Handler,
  596. },
  597. {
  598. MethodName: "DeleteUserAccessToken",
  599. Handler: _UserService_DeleteUserAccessToken_Handler,
  600. },
  601. },
  602. Streams: []grpc.StreamDesc{},
  603. Metadata: "api/v1/user_service.proto",
  604. }