workspace_service_grpc.pb.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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/workspace_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.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. WorkspaceService_GetWorkspaceProfile_FullMethodName = "/memos.api.v1.WorkspaceService/GetWorkspaceProfile"
  19. )
  20. // WorkspaceServiceClient is the client API for WorkspaceService service.
  21. //
  22. // 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.
  23. type WorkspaceServiceClient interface {
  24. // GetWorkspaceProfile returns the workspace profile.
  25. GetWorkspaceProfile(ctx context.Context, in *GetWorkspaceProfileRequest, opts ...grpc.CallOption) (*WorkspaceProfile, error)
  26. }
  27. type workspaceServiceClient struct {
  28. cc grpc.ClientConnInterface
  29. }
  30. func NewWorkspaceServiceClient(cc grpc.ClientConnInterface) WorkspaceServiceClient {
  31. return &workspaceServiceClient{cc}
  32. }
  33. func (c *workspaceServiceClient) GetWorkspaceProfile(ctx context.Context, in *GetWorkspaceProfileRequest, opts ...grpc.CallOption) (*WorkspaceProfile, error) {
  34. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  35. out := new(WorkspaceProfile)
  36. err := c.cc.Invoke(ctx, WorkspaceService_GetWorkspaceProfile_FullMethodName, in, out, cOpts...)
  37. if err != nil {
  38. return nil, err
  39. }
  40. return out, nil
  41. }
  42. // WorkspaceServiceServer is the server API for WorkspaceService service.
  43. // All implementations must embed UnimplementedWorkspaceServiceServer
  44. // for forward compatibility.
  45. type WorkspaceServiceServer interface {
  46. // GetWorkspaceProfile returns the workspace profile.
  47. GetWorkspaceProfile(context.Context, *GetWorkspaceProfileRequest) (*WorkspaceProfile, error)
  48. mustEmbedUnimplementedWorkspaceServiceServer()
  49. }
  50. // UnimplementedWorkspaceServiceServer must be embedded to have
  51. // forward compatible implementations.
  52. //
  53. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  54. // pointer dereference when methods are called.
  55. type UnimplementedWorkspaceServiceServer struct{}
  56. func (UnimplementedWorkspaceServiceServer) GetWorkspaceProfile(context.Context, *GetWorkspaceProfileRequest) (*WorkspaceProfile, error) {
  57. return nil, status.Errorf(codes.Unimplemented, "method GetWorkspaceProfile not implemented")
  58. }
  59. func (UnimplementedWorkspaceServiceServer) mustEmbedUnimplementedWorkspaceServiceServer() {}
  60. func (UnimplementedWorkspaceServiceServer) testEmbeddedByValue() {}
  61. // UnsafeWorkspaceServiceServer may be embedded to opt out of forward compatibility for this service.
  62. // Use of this interface is not recommended, as added methods to WorkspaceServiceServer will
  63. // result in compilation errors.
  64. type UnsafeWorkspaceServiceServer interface {
  65. mustEmbedUnimplementedWorkspaceServiceServer()
  66. }
  67. func RegisterWorkspaceServiceServer(s grpc.ServiceRegistrar, srv WorkspaceServiceServer) {
  68. // If the following call pancis, it indicates UnimplementedWorkspaceServiceServer was
  69. // embedded by pointer and is nil. This will cause panics if an
  70. // unimplemented method is ever invoked, so we test this at initialization
  71. // time to prevent it from happening at runtime later due to I/O.
  72. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  73. t.testEmbeddedByValue()
  74. }
  75. s.RegisterService(&WorkspaceService_ServiceDesc, srv)
  76. }
  77. func _WorkspaceService_GetWorkspaceProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  78. in := new(GetWorkspaceProfileRequest)
  79. if err := dec(in); err != nil {
  80. return nil, err
  81. }
  82. if interceptor == nil {
  83. return srv.(WorkspaceServiceServer).GetWorkspaceProfile(ctx, in)
  84. }
  85. info := &grpc.UnaryServerInfo{
  86. Server: srv,
  87. FullMethod: WorkspaceService_GetWorkspaceProfile_FullMethodName,
  88. }
  89. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  90. return srv.(WorkspaceServiceServer).GetWorkspaceProfile(ctx, req.(*GetWorkspaceProfileRequest))
  91. }
  92. return interceptor(ctx, in, info, handler)
  93. }
  94. // WorkspaceService_ServiceDesc is the grpc.ServiceDesc for WorkspaceService service.
  95. // It's only intended for direct use with grpc.RegisterService,
  96. // and not to be introspected or modified (even as a copy)
  97. var WorkspaceService_ServiceDesc = grpc.ServiceDesc{
  98. ServiceName: "memos.api.v1.WorkspaceService",
  99. HandlerType: (*WorkspaceServiceServer)(nil),
  100. Methods: []grpc.MethodDesc{
  101. {
  102. MethodName: "GetWorkspaceProfile",
  103. Handler: _WorkspaceService_GetWorkspaceProfile_Handler,
  104. },
  105. },
  106. Streams: []grpc.StreamDesc{},
  107. Metadata: "api/v1/workspace_service.proto",
  108. }