github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/internal/addon/plugin/proto/plugin_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.3.0 4 // - protoc v3.12.4 5 // source: plugin.proto 6 7 package proto 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 ) 15 16 // This is a compile-time assertion to ensure that this generated file 17 // is compatible with the grpc package it is being compiled against. 18 // Requires gRPC-Go v1.32.0 or later. 19 const _ = grpc.SupportPackageIsVersion7 20 21 const ( 22 RuleSetService_ListRules_FullMethodName = "/proto.RuleSetService/ListRules" 23 RuleSetService_Apply_FullMethodName = "/proto.RuleSetService/Apply" 24 ) 25 26 // RuleSetServiceClient is the client API for RuleSetService service. 27 // 28 // 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. 29 type RuleSetServiceClient interface { 30 ListRules(ctx context.Context, in *ListRulesRequest, opts ...grpc.CallOption) (*ListRulesResponse, error) 31 Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) 32 } 33 34 type ruleSetServiceClient struct { 35 cc grpc.ClientConnInterface 36 } 37 38 func NewRuleSetServiceClient(cc grpc.ClientConnInterface) RuleSetServiceClient { 39 return &ruleSetServiceClient{cc} 40 } 41 42 func (c *ruleSetServiceClient) ListRules(ctx context.Context, in *ListRulesRequest, opts ...grpc.CallOption) (*ListRulesResponse, error) { 43 out := new(ListRulesResponse) 44 err := c.cc.Invoke(ctx, RuleSetService_ListRules_FullMethodName, in, out, opts...) 45 if err != nil { 46 return nil, err 47 } 48 return out, nil 49 } 50 51 func (c *ruleSetServiceClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) { 52 out := new(ApplyResponse) 53 err := c.cc.Invoke(ctx, RuleSetService_Apply_FullMethodName, in, out, opts...) 54 if err != nil { 55 return nil, err 56 } 57 return out, nil 58 } 59 60 // RuleSetServiceServer is the server API for RuleSetService service. 61 // All implementations must embed UnimplementedRuleSetServiceServer 62 // for forward compatibility 63 type RuleSetServiceServer interface { 64 ListRules(context.Context, *ListRulesRequest) (*ListRulesResponse, error) 65 Apply(context.Context, *ApplyRequest) (*ApplyResponse, error) 66 mustEmbedUnimplementedRuleSetServiceServer() 67 } 68 69 // UnimplementedRuleSetServiceServer must be embedded to have forward compatible implementations. 70 type UnimplementedRuleSetServiceServer struct { 71 } 72 73 func (UnimplementedRuleSetServiceServer) ListRules(context.Context, *ListRulesRequest) (*ListRulesResponse, error) { 74 return nil, status.Errorf(codes.Unimplemented, "method ListRules not implemented") 75 } 76 func (UnimplementedRuleSetServiceServer) Apply(context.Context, *ApplyRequest) (*ApplyResponse, error) { 77 return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented") 78 } 79 func (UnimplementedRuleSetServiceServer) mustEmbedUnimplementedRuleSetServiceServer() {} 80 81 // UnsafeRuleSetServiceServer may be embedded to opt out of forward compatibility for this service. 82 // Use of this interface is not recommended, as added methods to RuleSetServiceServer will 83 // result in compilation errors. 84 type UnsafeRuleSetServiceServer interface { 85 mustEmbedUnimplementedRuleSetServiceServer() 86 } 87 88 func RegisterRuleSetServiceServer(s grpc.ServiceRegistrar, srv RuleSetServiceServer) { 89 s.RegisterService(&RuleSetService_ServiceDesc, srv) 90 } 91 92 func _RuleSetService_ListRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 93 in := new(ListRulesRequest) 94 if err := dec(in); err != nil { 95 return nil, err 96 } 97 if interceptor == nil { 98 return srv.(RuleSetServiceServer).ListRules(ctx, in) 99 } 100 info := &grpc.UnaryServerInfo{ 101 Server: srv, 102 FullMethod: RuleSetService_ListRules_FullMethodName, 103 } 104 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 105 return srv.(RuleSetServiceServer).ListRules(ctx, req.(*ListRulesRequest)) 106 } 107 return interceptor(ctx, in, info, handler) 108 } 109 110 func _RuleSetService_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 111 in := new(ApplyRequest) 112 if err := dec(in); err != nil { 113 return nil, err 114 } 115 if interceptor == nil { 116 return srv.(RuleSetServiceServer).Apply(ctx, in) 117 } 118 info := &grpc.UnaryServerInfo{ 119 Server: srv, 120 FullMethod: RuleSetService_Apply_FullMethodName, 121 } 122 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 123 return srv.(RuleSetServiceServer).Apply(ctx, req.(*ApplyRequest)) 124 } 125 return interceptor(ctx, in, info, handler) 126 } 127 128 // RuleSetService_ServiceDesc is the grpc.ServiceDesc for RuleSetService service. 129 // It's only intended for direct use with grpc.RegisterService, 130 // and not to be introspected or modified (even as a copy) 131 var RuleSetService_ServiceDesc = grpc.ServiceDesc{ 132 ServiceName: "proto.RuleSetService", 133 HandlerType: (*RuleSetServiceServer)(nil), 134 Methods: []grpc.MethodDesc{ 135 { 136 MethodName: "ListRules", 137 Handler: _RuleSetService_ListRules_Handler, 138 }, 139 { 140 MethodName: "Apply", 141 Handler: _RuleSetService_Apply_Handler, 142 }, 143 }, 144 Streams: []grpc.StreamDesc{}, 145 Metadata: "plugin.proto", 146 }