github.com/InjectiveLabs/sdk-go@v1.53.0/exchange/auction_rpc/pb/goadesign_goagen_injective_auction_rpc_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: goadesign_goagen_injective_auction_rpc.proto
     6  
     7  package injective_auction_rpcpb
     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  // InjectiveAuctionRPCClient is the client API for InjectiveAuctionRPC 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 InjectiveAuctionRPCClient interface {
    25  	// Provide historical auction info for a given auction
    26  	AuctionEndpoint(ctx context.Context, in *AuctionEndpointRequest, opts ...grpc.CallOption) (*AuctionEndpointResponse, error)
    27  	// Provide the historical auctions info
    28  	Auctions(ctx context.Context, in *AuctionsRequest, opts ...grpc.CallOption) (*AuctionsResponse, error)
    29  	// StreamBids streams new bids of an auction.
    30  	StreamBids(ctx context.Context, in *StreamBidsRequest, opts ...grpc.CallOption) (InjectiveAuctionRPC_StreamBidsClient, error)
    31  }
    32  
    33  type injectiveAuctionRPCClient struct {
    34  	cc grpc.ClientConnInterface
    35  }
    36  
    37  func NewInjectiveAuctionRPCClient(cc grpc.ClientConnInterface) InjectiveAuctionRPCClient {
    38  	return &injectiveAuctionRPCClient{cc}
    39  }
    40  
    41  func (c *injectiveAuctionRPCClient) AuctionEndpoint(ctx context.Context, in *AuctionEndpointRequest, opts ...grpc.CallOption) (*AuctionEndpointResponse, error) {
    42  	out := new(AuctionEndpointResponse)
    43  	err := c.cc.Invoke(ctx, "/injective_auction_rpc.InjectiveAuctionRPC/AuctionEndpoint", in, out, opts...)
    44  	if err != nil {
    45  		return nil, err
    46  	}
    47  	return out, nil
    48  }
    49  
    50  func (c *injectiveAuctionRPCClient) Auctions(ctx context.Context, in *AuctionsRequest, opts ...grpc.CallOption) (*AuctionsResponse, error) {
    51  	out := new(AuctionsResponse)
    52  	err := c.cc.Invoke(ctx, "/injective_auction_rpc.InjectiveAuctionRPC/Auctions", in, out, opts...)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	return out, nil
    57  }
    58  
    59  func (c *injectiveAuctionRPCClient) StreamBids(ctx context.Context, in *StreamBidsRequest, opts ...grpc.CallOption) (InjectiveAuctionRPC_StreamBidsClient, error) {
    60  	stream, err := c.cc.NewStream(ctx, &InjectiveAuctionRPC_ServiceDesc.Streams[0], "/injective_auction_rpc.InjectiveAuctionRPC/StreamBids", opts...)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  	x := &injectiveAuctionRPCStreamBidsClient{stream}
    65  	if err := x.ClientStream.SendMsg(in); err != nil {
    66  		return nil, err
    67  	}
    68  	if err := x.ClientStream.CloseSend(); err != nil {
    69  		return nil, err
    70  	}
    71  	return x, nil
    72  }
    73  
    74  type InjectiveAuctionRPC_StreamBidsClient interface {
    75  	Recv() (*StreamBidsResponse, error)
    76  	grpc.ClientStream
    77  }
    78  
    79  type injectiveAuctionRPCStreamBidsClient struct {
    80  	grpc.ClientStream
    81  }
    82  
    83  func (x *injectiveAuctionRPCStreamBidsClient) Recv() (*StreamBidsResponse, error) {
    84  	m := new(StreamBidsResponse)
    85  	if err := x.ClientStream.RecvMsg(m); err != nil {
    86  		return nil, err
    87  	}
    88  	return m, nil
    89  }
    90  
    91  // InjectiveAuctionRPCServer is the server API for InjectiveAuctionRPC service.
    92  // All implementations must embed UnimplementedInjectiveAuctionRPCServer
    93  // for forward compatibility
    94  type InjectiveAuctionRPCServer interface {
    95  	// Provide historical auction info for a given auction
    96  	AuctionEndpoint(context.Context, *AuctionEndpointRequest) (*AuctionEndpointResponse, error)
    97  	// Provide the historical auctions info
    98  	Auctions(context.Context, *AuctionsRequest) (*AuctionsResponse, error)
    99  	// StreamBids streams new bids of an auction.
   100  	StreamBids(*StreamBidsRequest, InjectiveAuctionRPC_StreamBidsServer) error
   101  	mustEmbedUnimplementedInjectiveAuctionRPCServer()
   102  }
   103  
   104  // UnimplementedInjectiveAuctionRPCServer must be embedded to have forward compatible implementations.
   105  type UnimplementedInjectiveAuctionRPCServer struct {
   106  }
   107  
   108  func (UnimplementedInjectiveAuctionRPCServer) AuctionEndpoint(context.Context, *AuctionEndpointRequest) (*AuctionEndpointResponse, error) {
   109  	return nil, status.Errorf(codes.Unimplemented, "method AuctionEndpoint not implemented")
   110  }
   111  func (UnimplementedInjectiveAuctionRPCServer) Auctions(context.Context, *AuctionsRequest) (*AuctionsResponse, error) {
   112  	return nil, status.Errorf(codes.Unimplemented, "method Auctions not implemented")
   113  }
   114  func (UnimplementedInjectiveAuctionRPCServer) StreamBids(*StreamBidsRequest, InjectiveAuctionRPC_StreamBidsServer) error {
   115  	return status.Errorf(codes.Unimplemented, "method StreamBids not implemented")
   116  }
   117  func (UnimplementedInjectiveAuctionRPCServer) mustEmbedUnimplementedInjectiveAuctionRPCServer() {}
   118  
   119  // UnsafeInjectiveAuctionRPCServer may be embedded to opt out of forward compatibility for this service.
   120  // Use of this interface is not recommended, as added methods to InjectiveAuctionRPCServer will
   121  // result in compilation errors.
   122  type UnsafeInjectiveAuctionRPCServer interface {
   123  	mustEmbedUnimplementedInjectiveAuctionRPCServer()
   124  }
   125  
   126  func RegisterInjectiveAuctionRPCServer(s grpc.ServiceRegistrar, srv InjectiveAuctionRPCServer) {
   127  	s.RegisterService(&InjectiveAuctionRPC_ServiceDesc, srv)
   128  }
   129  
   130  func _InjectiveAuctionRPC_AuctionEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   131  	in := new(AuctionEndpointRequest)
   132  	if err := dec(in); err != nil {
   133  		return nil, err
   134  	}
   135  	if interceptor == nil {
   136  		return srv.(InjectiveAuctionRPCServer).AuctionEndpoint(ctx, in)
   137  	}
   138  	info := &grpc.UnaryServerInfo{
   139  		Server:     srv,
   140  		FullMethod: "/injective_auction_rpc.InjectiveAuctionRPC/AuctionEndpoint",
   141  	}
   142  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   143  		return srv.(InjectiveAuctionRPCServer).AuctionEndpoint(ctx, req.(*AuctionEndpointRequest))
   144  	}
   145  	return interceptor(ctx, in, info, handler)
   146  }
   147  
   148  func _InjectiveAuctionRPC_Auctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   149  	in := new(AuctionsRequest)
   150  	if err := dec(in); err != nil {
   151  		return nil, err
   152  	}
   153  	if interceptor == nil {
   154  		return srv.(InjectiveAuctionRPCServer).Auctions(ctx, in)
   155  	}
   156  	info := &grpc.UnaryServerInfo{
   157  		Server:     srv,
   158  		FullMethod: "/injective_auction_rpc.InjectiveAuctionRPC/Auctions",
   159  	}
   160  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   161  		return srv.(InjectiveAuctionRPCServer).Auctions(ctx, req.(*AuctionsRequest))
   162  	}
   163  	return interceptor(ctx, in, info, handler)
   164  }
   165  
   166  func _InjectiveAuctionRPC_StreamBids_Handler(srv interface{}, stream grpc.ServerStream) error {
   167  	m := new(StreamBidsRequest)
   168  	if err := stream.RecvMsg(m); err != nil {
   169  		return err
   170  	}
   171  	return srv.(InjectiveAuctionRPCServer).StreamBids(m, &injectiveAuctionRPCStreamBidsServer{stream})
   172  }
   173  
   174  type InjectiveAuctionRPC_StreamBidsServer interface {
   175  	Send(*StreamBidsResponse) error
   176  	grpc.ServerStream
   177  }
   178  
   179  type injectiveAuctionRPCStreamBidsServer struct {
   180  	grpc.ServerStream
   181  }
   182  
   183  func (x *injectiveAuctionRPCStreamBidsServer) Send(m *StreamBidsResponse) error {
   184  	return x.ServerStream.SendMsg(m)
   185  }
   186  
   187  // InjectiveAuctionRPC_ServiceDesc is the grpc.ServiceDesc for InjectiveAuctionRPC service.
   188  // It's only intended for direct use with grpc.RegisterService,
   189  // and not to be introspected or modified (even as a copy)
   190  var InjectiveAuctionRPC_ServiceDesc = grpc.ServiceDesc{
   191  	ServiceName: "injective_auction_rpc.InjectiveAuctionRPC",
   192  	HandlerType: (*InjectiveAuctionRPCServer)(nil),
   193  	Methods: []grpc.MethodDesc{
   194  		{
   195  			MethodName: "AuctionEndpoint",
   196  			Handler:    _InjectiveAuctionRPC_AuctionEndpoint_Handler,
   197  		},
   198  		{
   199  			MethodName: "Auctions",
   200  			Handler:    _InjectiveAuctionRPC_Auctions_Handler,
   201  		},
   202  	},
   203  	Streams: []grpc.StreamDesc{
   204  		{
   205  			StreamName:    "StreamBids",
   206  			Handler:       _InjectiveAuctionRPC_StreamBids_Handler,
   207  			ServerStreams: true,
   208  		},
   209  	},
   210  	Metadata: "goadesign_goagen_injective_auction_rpc.proto",
   211  }