service_grpc.pb.go raw

   1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
   2  // versions:
   3  // - protoc-gen-go-grpc v1.6.0
   4  // - protoc             (unknown)
   5  // source: orlynits/v1/service.proto
   6  
   7  package orlynitsv1
   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.64.0 or later.
  19  const _ = grpc.SupportPackageIsVersion9
  20  
  21  const (
  22  	NitsService_Ready_FullMethodName             = "/orlynits.v1.NitsService/Ready"
  23  	NitsService_GetBlockchainInfo_FullMethodName = "/orlynits.v1.NitsService/GetBlockchainInfo"
  24  	NitsService_EstimateFee_FullMethodName       = "/orlynits.v1.NitsService/EstimateFee"
  25  )
  26  
  27  // NitsServiceClient is the client API for NitsService service.
  28  //
  29  // 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.
  30  //
  31  // NitsService provides gRPC access to the Bitcoin node (nits/bitcoind)
  32  type NitsServiceClient interface {
  33  	// Ready returns whether bitcoind is responsive and synced enough to use
  34  	Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ReadyResponse, error)
  35  	// GetBlockchainInfo returns basic chain state information
  36  	GetBlockchainInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BlockchainInfoResponse, error)
  37  	// EstimateFee returns fee estimation for a given confirmation target
  38  	EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error)
  39  }
  40  
  41  type nitsServiceClient struct {
  42  	cc grpc.ClientConnInterface
  43  }
  44  
  45  func NewNitsServiceClient(cc grpc.ClientConnInterface) NitsServiceClient {
  46  	return &nitsServiceClient{cc}
  47  }
  48  
  49  func (c *nitsServiceClient) Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ReadyResponse, error) {
  50  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  51  	out := new(ReadyResponse)
  52  	err := c.cc.Invoke(ctx, NitsService_Ready_FullMethodName, in, out, cOpts...)
  53  	if err != nil {
  54  		return nil, err
  55  	}
  56  	return out, nil
  57  }
  58  
  59  func (c *nitsServiceClient) GetBlockchainInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BlockchainInfoResponse, error) {
  60  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  61  	out := new(BlockchainInfoResponse)
  62  	err := c.cc.Invoke(ctx, NitsService_GetBlockchainInfo_FullMethodName, in, out, cOpts...)
  63  	if err != nil {
  64  		return nil, err
  65  	}
  66  	return out, nil
  67  }
  68  
  69  func (c *nitsServiceClient) EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) {
  70  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  71  	out := new(EstimateFeeResponse)
  72  	err := c.cc.Invoke(ctx, NitsService_EstimateFee_FullMethodName, in, out, cOpts...)
  73  	if err != nil {
  74  		return nil, err
  75  	}
  76  	return out, nil
  77  }
  78  
  79  // NitsServiceServer is the server API for NitsService service.
  80  // All implementations must embed UnimplementedNitsServiceServer
  81  // for forward compatibility.
  82  //
  83  // NitsService provides gRPC access to the Bitcoin node (nits/bitcoind)
  84  type NitsServiceServer interface {
  85  	// Ready returns whether bitcoind is responsive and synced enough to use
  86  	Ready(context.Context, *Empty) (*ReadyResponse, error)
  87  	// GetBlockchainInfo returns basic chain state information
  88  	GetBlockchainInfo(context.Context, *Empty) (*BlockchainInfoResponse, error)
  89  	// EstimateFee returns fee estimation for a given confirmation target
  90  	EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error)
  91  	mustEmbedUnimplementedNitsServiceServer()
  92  }
  93  
  94  // UnimplementedNitsServiceServer must be embedded to have
  95  // forward compatible implementations.
  96  //
  97  // NOTE: this should be embedded by value instead of pointer to avoid a nil
  98  // pointer dereference when methods are called.
  99  type UnimplementedNitsServiceServer struct{}
 100  
 101  func (UnimplementedNitsServiceServer) Ready(context.Context, *Empty) (*ReadyResponse, error) {
 102  	return nil, status.Error(codes.Unimplemented, "method Ready not implemented")
 103  }
 104  func (UnimplementedNitsServiceServer) GetBlockchainInfo(context.Context, *Empty) (*BlockchainInfoResponse, error) {
 105  	return nil, status.Error(codes.Unimplemented, "method GetBlockchainInfo not implemented")
 106  }
 107  func (UnimplementedNitsServiceServer) EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) {
 108  	return nil, status.Error(codes.Unimplemented, "method EstimateFee not implemented")
 109  }
 110  func (UnimplementedNitsServiceServer) mustEmbedUnimplementedNitsServiceServer() {}
 111  func (UnimplementedNitsServiceServer) testEmbeddedByValue()                     {}
 112  
 113  // UnsafeNitsServiceServer may be embedded to opt out of forward compatibility for this service.
 114  // Use of this interface is not recommended, as added methods to NitsServiceServer will
 115  // result in compilation errors.
 116  type UnsafeNitsServiceServer interface {
 117  	mustEmbedUnimplementedNitsServiceServer()
 118  }
 119  
 120  func RegisterNitsServiceServer(s grpc.ServiceRegistrar, srv NitsServiceServer) {
 121  	// If the following call panics, it indicates UnimplementedNitsServiceServer was
 122  	// embedded by pointer and is nil.  This will cause panics if an
 123  	// unimplemented method is ever invoked, so we test this at initialization
 124  	// time to prevent it from happening at runtime later due to I/O.
 125  	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
 126  		t.testEmbeddedByValue()
 127  	}
 128  	s.RegisterService(&NitsService_ServiceDesc, srv)
 129  }
 130  
 131  func _NitsService_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 132  	in := new(Empty)
 133  	if err := dec(in); err != nil {
 134  		return nil, err
 135  	}
 136  	if interceptor == nil {
 137  		return srv.(NitsServiceServer).Ready(ctx, in)
 138  	}
 139  	info := &grpc.UnaryServerInfo{
 140  		Server:     srv,
 141  		FullMethod: NitsService_Ready_FullMethodName,
 142  	}
 143  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 144  		return srv.(NitsServiceServer).Ready(ctx, req.(*Empty))
 145  	}
 146  	return interceptor(ctx, in, info, handler)
 147  }
 148  
 149  func _NitsService_GetBlockchainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 150  	in := new(Empty)
 151  	if err := dec(in); err != nil {
 152  		return nil, err
 153  	}
 154  	if interceptor == nil {
 155  		return srv.(NitsServiceServer).GetBlockchainInfo(ctx, in)
 156  	}
 157  	info := &grpc.UnaryServerInfo{
 158  		Server:     srv,
 159  		FullMethod: NitsService_GetBlockchainInfo_FullMethodName,
 160  	}
 161  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 162  		return srv.(NitsServiceServer).GetBlockchainInfo(ctx, req.(*Empty))
 163  	}
 164  	return interceptor(ctx, in, info, handler)
 165  }
 166  
 167  func _NitsService_EstimateFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 168  	in := new(EstimateFeeRequest)
 169  	if err := dec(in); err != nil {
 170  		return nil, err
 171  	}
 172  	if interceptor == nil {
 173  		return srv.(NitsServiceServer).EstimateFee(ctx, in)
 174  	}
 175  	info := &grpc.UnaryServerInfo{
 176  		Server:     srv,
 177  		FullMethod: NitsService_EstimateFee_FullMethodName,
 178  	}
 179  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 180  		return srv.(NitsServiceServer).EstimateFee(ctx, req.(*EstimateFeeRequest))
 181  	}
 182  	return interceptor(ctx, in, info, handler)
 183  }
 184  
 185  // NitsService_ServiceDesc is the grpc.ServiceDesc for NitsService service.
 186  // It's only intended for direct use with grpc.RegisterService,
 187  // and not to be introspected or modified (even as a copy)
 188  var NitsService_ServiceDesc = grpc.ServiceDesc{
 189  	ServiceName: "orlynits.v1.NitsService",
 190  	HandlerType: (*NitsServiceServer)(nil),
 191  	Methods: []grpc.MethodDesc{
 192  		{
 193  			MethodName: "Ready",
 194  			Handler:    _NitsService_Ready_Handler,
 195  		},
 196  		{
 197  			MethodName: "GetBlockchainInfo",
 198  			Handler:    _NitsService_GetBlockchainInfo_Handler,
 199  		},
 200  		{
 201  			MethodName: "EstimateFee",
 202  			Handler:    _NitsService_EstimateFee_Handler,
 203  		},
 204  	},
 205  	Streams:  []grpc.StreamDesc{},
 206  	Metadata: "orlynits/v1/service.proto",
 207  }
 208