workspace_setting_service_grpc.pb.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.4.0
  4. // - protoc (unknown)
  5. // source: api/v1/workspace_setting_service.proto
  6. package apiv1
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.62.0 or later.
  16. const _ = grpc.SupportPackageIsVersion8
  17. const (
  18. WorkspaceSettingService_GetWorkspaceSetting_FullMethodName = "/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting"
  19. WorkspaceSettingService_SetWorkspaceSetting_FullMethodName = "/memos.api.v1.WorkspaceSettingService/SetWorkspaceSetting"
  20. )
  21. // WorkspaceSettingServiceClient is the client API for WorkspaceSettingService service.
  22. //
  23. // 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.
  24. type WorkspaceSettingServiceClient interface {
  25. // GetWorkspaceSetting returns the setting by name.
  26. GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*WorkspaceSetting, error)
  27. // SetWorkspaceSetting updates the setting.
  28. SetWorkspaceSetting(ctx context.Context, in *SetWorkspaceSettingRequest, opts ...grpc.CallOption) (*WorkspaceSetting, error)
  29. }
  30. type workspaceSettingServiceClient struct {
  31. cc grpc.ClientConnInterface
  32. }
  33. func NewWorkspaceSettingServiceClient(cc grpc.ClientConnInterface) WorkspaceSettingServiceClient {
  34. return &workspaceSettingServiceClient{cc}
  35. }
  36. func (c *workspaceSettingServiceClient) GetWorkspaceSetting(ctx context.Context, in *GetWorkspaceSettingRequest, opts ...grpc.CallOption) (*WorkspaceSetting, error) {
  37. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  38. out := new(WorkspaceSetting)
  39. err := c.cc.Invoke(ctx, WorkspaceSettingService_GetWorkspaceSetting_FullMethodName, in, out, cOpts...)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return out, nil
  44. }
  45. func (c *workspaceSettingServiceClient) SetWorkspaceSetting(ctx context.Context, in *SetWorkspaceSettingRequest, opts ...grpc.CallOption) (*WorkspaceSetting, error) {
  46. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  47. out := new(WorkspaceSetting)
  48. err := c.cc.Invoke(ctx, WorkspaceSettingService_SetWorkspaceSetting_FullMethodName, in, out, cOpts...)
  49. if err != nil {
  50. return nil, err
  51. }
  52. return out, nil
  53. }
  54. // WorkspaceSettingServiceServer is the server API for WorkspaceSettingService service.
  55. // All implementations must embed UnimplementedWorkspaceSettingServiceServer
  56. // for forward compatibility
  57. type WorkspaceSettingServiceServer interface {
  58. // GetWorkspaceSetting returns the setting by name.
  59. GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*WorkspaceSetting, error)
  60. // SetWorkspaceSetting updates the setting.
  61. SetWorkspaceSetting(context.Context, *SetWorkspaceSettingRequest) (*WorkspaceSetting, error)
  62. mustEmbedUnimplementedWorkspaceSettingServiceServer()
  63. }
  64. // UnimplementedWorkspaceSettingServiceServer must be embedded to have forward compatible implementations.
  65. type UnimplementedWorkspaceSettingServiceServer struct {
  66. }
  67. func (UnimplementedWorkspaceSettingServiceServer) GetWorkspaceSetting(context.Context, *GetWorkspaceSettingRequest) (*WorkspaceSetting, error) {
  68. return nil, status.Errorf(codes.Unimplemented, "method GetWorkspaceSetting not implemented")
  69. }
  70. func (UnimplementedWorkspaceSettingServiceServer) SetWorkspaceSetting(context.Context, *SetWorkspaceSettingRequest) (*WorkspaceSetting, error) {
  71. return nil, status.Errorf(codes.Unimplemented, "method SetWorkspaceSetting not implemented")
  72. }
  73. func (UnimplementedWorkspaceSettingServiceServer) mustEmbedUnimplementedWorkspaceSettingServiceServer() {
  74. }
  75. // UnsafeWorkspaceSettingServiceServer may be embedded to opt out of forward compatibility for this service.
  76. // Use of this interface is not recommended, as added methods to WorkspaceSettingServiceServer will
  77. // result in compilation errors.
  78. type UnsafeWorkspaceSettingServiceServer interface {
  79. mustEmbedUnimplementedWorkspaceSettingServiceServer()
  80. }
  81. func RegisterWorkspaceSettingServiceServer(s grpc.ServiceRegistrar, srv WorkspaceSettingServiceServer) {
  82. s.RegisterService(&WorkspaceSettingService_ServiceDesc, srv)
  83. }
  84. func _WorkspaceSettingService_GetWorkspaceSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  85. in := new(GetWorkspaceSettingRequest)
  86. if err := dec(in); err != nil {
  87. return nil, err
  88. }
  89. if interceptor == nil {
  90. return srv.(WorkspaceSettingServiceServer).GetWorkspaceSetting(ctx, in)
  91. }
  92. info := &grpc.UnaryServerInfo{
  93. Server: srv,
  94. FullMethod: WorkspaceSettingService_GetWorkspaceSetting_FullMethodName,
  95. }
  96. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  97. return srv.(WorkspaceSettingServiceServer).GetWorkspaceSetting(ctx, req.(*GetWorkspaceSettingRequest))
  98. }
  99. return interceptor(ctx, in, info, handler)
  100. }
  101. func _WorkspaceSettingService_SetWorkspaceSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  102. in := new(SetWorkspaceSettingRequest)
  103. if err := dec(in); err != nil {
  104. return nil, err
  105. }
  106. if interceptor == nil {
  107. return srv.(WorkspaceSettingServiceServer).SetWorkspaceSetting(ctx, in)
  108. }
  109. info := &grpc.UnaryServerInfo{
  110. Server: srv,
  111. FullMethod: WorkspaceSettingService_SetWorkspaceSetting_FullMethodName,
  112. }
  113. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  114. return srv.(WorkspaceSettingServiceServer).SetWorkspaceSetting(ctx, req.(*SetWorkspaceSettingRequest))
  115. }
  116. return interceptor(ctx, in, info, handler)
  117. }
  118. // WorkspaceSettingService_ServiceDesc is the grpc.ServiceDesc for WorkspaceSettingService service.
  119. // It's only intended for direct use with grpc.RegisterService,
  120. // and not to be introspected or modified (even as a copy)
  121. var WorkspaceSettingService_ServiceDesc = grpc.ServiceDesc{
  122. ServiceName: "memos.api.v1.WorkspaceSettingService",
  123. HandlerType: (*WorkspaceSettingServiceServer)(nil),
  124. Methods: []grpc.MethodDesc{
  125. {
  126. MethodName: "GetWorkspaceSetting",
  127. Handler: _WorkspaceSettingService_GetWorkspaceSetting_Handler,
  128. },
  129. {
  130. MethodName: "SetWorkspaceSetting",
  131. Handler: _WorkspaceSettingService_SetWorkspaceSetting_Handler,
  132. },
  133. },
  134. Streams: []grpc.StreamDesc{},
  135. Metadata: "api/v1/workspace_setting_service.proto",
  136. }