vitess.io/vitess@v0.16.2/go/vt/proto/automationservice/automationservice_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.2.0 4 // - protoc v3.21.3 5 // source: automationservice.proto 6 7 package automationservice 8 9 import ( 10 context "context" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 automation "vitess.io/vitess/go/vt/proto/automation" 15 ) 16 17 // This is a compile-time assertion to ensure that this generated file 18 // is compatible with the grpc package it is being compiled against. 19 // Requires gRPC-Go v1.32.0 or later. 20 const _ = grpc.SupportPackageIsVersion7 21 22 // AutomationClient is the client API for Automation service. 23 // 24 // 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. 25 type AutomationClient interface { 26 // Start a cluster operation. 27 EnqueueClusterOperation(ctx context.Context, in *automation.EnqueueClusterOperationRequest, opts ...grpc.CallOption) (*automation.EnqueueClusterOperationResponse, error) 28 // TODO(mberlin): Polling this is bad. Implement a subscribe mechanism to wait for changes? 29 // Get all details of an active cluster operation. 30 GetClusterOperationDetails(ctx context.Context, in *automation.GetClusterOperationDetailsRequest, opts ...grpc.CallOption) (*automation.GetClusterOperationDetailsResponse, error) 31 } 32 33 type automationClient struct { 34 cc grpc.ClientConnInterface 35 } 36 37 func NewAutomationClient(cc grpc.ClientConnInterface) AutomationClient { 38 return &automationClient{cc} 39 } 40 41 func (c *automationClient) EnqueueClusterOperation(ctx context.Context, in *automation.EnqueueClusterOperationRequest, opts ...grpc.CallOption) (*automation.EnqueueClusterOperationResponse, error) { 42 out := new(automation.EnqueueClusterOperationResponse) 43 err := c.cc.Invoke(ctx, "/automationservice.Automation/EnqueueClusterOperation", in, out, opts...) 44 if err != nil { 45 return nil, err 46 } 47 return out, nil 48 } 49 50 func (c *automationClient) GetClusterOperationDetails(ctx context.Context, in *automation.GetClusterOperationDetailsRequest, opts ...grpc.CallOption) (*automation.GetClusterOperationDetailsResponse, error) { 51 out := new(automation.GetClusterOperationDetailsResponse) 52 err := c.cc.Invoke(ctx, "/automationservice.Automation/GetClusterOperationDetails", in, out, opts...) 53 if err != nil { 54 return nil, err 55 } 56 return out, nil 57 } 58 59 // AutomationServer is the server API for Automation service. 60 // All implementations must embed UnimplementedAutomationServer 61 // for forward compatibility 62 type AutomationServer interface { 63 // Start a cluster operation. 64 EnqueueClusterOperation(context.Context, *automation.EnqueueClusterOperationRequest) (*automation.EnqueueClusterOperationResponse, error) 65 // TODO(mberlin): Polling this is bad. Implement a subscribe mechanism to wait for changes? 66 // Get all details of an active cluster operation. 67 GetClusterOperationDetails(context.Context, *automation.GetClusterOperationDetailsRequest) (*automation.GetClusterOperationDetailsResponse, error) 68 mustEmbedUnimplementedAutomationServer() 69 } 70 71 // UnimplementedAutomationServer must be embedded to have forward compatible implementations. 72 type UnimplementedAutomationServer struct { 73 } 74 75 func (UnimplementedAutomationServer) EnqueueClusterOperation(context.Context, *automation.EnqueueClusterOperationRequest) (*automation.EnqueueClusterOperationResponse, error) { 76 return nil, status.Errorf(codes.Unimplemented, "method EnqueueClusterOperation not implemented") 77 } 78 func (UnimplementedAutomationServer) GetClusterOperationDetails(context.Context, *automation.GetClusterOperationDetailsRequest) (*automation.GetClusterOperationDetailsResponse, error) { 79 return nil, status.Errorf(codes.Unimplemented, "method GetClusterOperationDetails not implemented") 80 } 81 func (UnimplementedAutomationServer) mustEmbedUnimplementedAutomationServer() {} 82 83 // UnsafeAutomationServer may be embedded to opt out of forward compatibility for this service. 84 // Use of this interface is not recommended, as added methods to AutomationServer will 85 // result in compilation errors. 86 type UnsafeAutomationServer interface { 87 mustEmbedUnimplementedAutomationServer() 88 } 89 90 func RegisterAutomationServer(s grpc.ServiceRegistrar, srv AutomationServer) { 91 s.RegisterService(&Automation_ServiceDesc, srv) 92 } 93 94 func _Automation_EnqueueClusterOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 95 in := new(automation.EnqueueClusterOperationRequest) 96 if err := dec(in); err != nil { 97 return nil, err 98 } 99 if interceptor == nil { 100 return srv.(AutomationServer).EnqueueClusterOperation(ctx, in) 101 } 102 info := &grpc.UnaryServerInfo{ 103 Server: srv, 104 FullMethod: "/automationservice.Automation/EnqueueClusterOperation", 105 } 106 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 107 return srv.(AutomationServer).EnqueueClusterOperation(ctx, req.(*automation.EnqueueClusterOperationRequest)) 108 } 109 return interceptor(ctx, in, info, handler) 110 } 111 112 func _Automation_GetClusterOperationDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 113 in := new(automation.GetClusterOperationDetailsRequest) 114 if err := dec(in); err != nil { 115 return nil, err 116 } 117 if interceptor == nil { 118 return srv.(AutomationServer).GetClusterOperationDetails(ctx, in) 119 } 120 info := &grpc.UnaryServerInfo{ 121 Server: srv, 122 FullMethod: "/automationservice.Automation/GetClusterOperationDetails", 123 } 124 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 125 return srv.(AutomationServer).GetClusterOperationDetails(ctx, req.(*automation.GetClusterOperationDetailsRequest)) 126 } 127 return interceptor(ctx, in, info, handler) 128 } 129 130 // Automation_ServiceDesc is the grpc.ServiceDesc for Automation service. 131 // It's only intended for direct use with grpc.RegisterService, 132 // and not to be introspected or modified (even as a copy) 133 var Automation_ServiceDesc = grpc.ServiceDesc{ 134 ServiceName: "automationservice.Automation", 135 HandlerType: (*AutomationServer)(nil), 136 Methods: []grpc.MethodDesc{ 137 { 138 MethodName: "EnqueueClusterOperation", 139 Handler: _Automation_EnqueueClusterOperation_Handler, 140 }, 141 { 142 MethodName: "GetClusterOperationDetails", 143 Handler: _Automation_GetClusterOperationDetails_Handler, 144 }, 145 }, 146 Streams: []grpc.StreamDesc{}, 147 Metadata: "automationservice.proto", 148 }