github.com/diadata-org/diadata@v1.4.593/pkg/dia/helpers/signer/protoc/signer_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.19.4 5 // source: protoc/signer.proto 6 7 package signer 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 // SignerClient is the client API for Signer 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 SignerClient interface { 25 Sign(ctx context.Context, in *DataToSign, opts ...grpc.CallOption) (*SignedData, error) 26 } 27 28 type signerClient struct { 29 cc grpc.ClientConnInterface 30 } 31 32 func NewSignerClient(cc grpc.ClientConnInterface) SignerClient { 33 return &signerClient{cc} 34 } 35 36 func (c *signerClient) Sign(ctx context.Context, in *DataToSign, opts ...grpc.CallOption) (*SignedData, error) { 37 out := new(SignedData) 38 err := c.cc.Invoke(ctx, "/rpc.Signer/Sign", in, out, opts...) 39 if err != nil { 40 return nil, err 41 } 42 return out, nil 43 } 44 45 // SignerServer is the server API for Signer service. 46 // All implementations must embed UnimplementedSignerServer 47 // for forward compatibility 48 type SignerServer interface { 49 Sign(context.Context, *DataToSign) (*SignedData, error) 50 mustEmbedUnimplementedSignerServer() 51 } 52 53 // UnimplementedSignerServer must be embedded to have forward compatible implementations. 54 type UnimplementedSignerServer struct { 55 } 56 57 func (UnimplementedSignerServer) Sign(context.Context, *DataToSign) (*SignedData, error) { 58 return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented") 59 } 60 func (UnimplementedSignerServer) mustEmbedUnimplementedSignerServer() {} 61 62 // UnsafeSignerServer may be embedded to opt out of forward compatibility for this service. 63 // Use of this interface is not recommended, as added methods to SignerServer will 64 // result in compilation errors. 65 type UnsafeSignerServer interface { 66 mustEmbedUnimplementedSignerServer() 67 } 68 69 func RegisterSignerServer(s grpc.ServiceRegistrar, srv SignerServer) { 70 s.RegisterService(&Signer_ServiceDesc, srv) 71 } 72 73 func _Signer_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 74 in := new(DataToSign) 75 if err := dec(in); err != nil { 76 return nil, err 77 } 78 if interceptor == nil { 79 return srv.(SignerServer).Sign(ctx, in) 80 } 81 info := &grpc.UnaryServerInfo{ 82 Server: srv, 83 FullMethod: "/rpc.Signer/Sign", 84 } 85 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 86 return srv.(SignerServer).Sign(ctx, req.(*DataToSign)) 87 } 88 return interceptor(ctx, in, info, handler) 89 } 90 91 // Signer_ServiceDesc is the grpc.ServiceDesc for Signer service. 92 // It's only intended for direct use with grpc.RegisterService, 93 // and not to be introspected or modified (even as a copy) 94 var Signer_ServiceDesc = grpc.ServiceDesc{ 95 ServiceName: "rpc.Signer", 96 HandlerType: (*SignerServer)(nil), 97 Methods: []grpc.MethodDesc{ 98 { 99 MethodName: "Sign", 100 Handler: _Signer_Sign_Handler, 101 }, 102 }, 103 Streams: []grpc.StreamDesc{}, 104 Metadata: "protoc/signer.proto", 105 }