neutrinorpc.NeutrinoKitClient.scala Maven / Gradle / Ivy
The newest version!
// Generated by Pekko gRPC. DO NOT EDIT.
package neutrinorpc
import scala.concurrent.ExecutionContext
import org.apache.pekko
import pekko.actor.ClassicActorSystemProvider
import pekko.grpc.GrpcChannel
import pekko.grpc.GrpcClientCloseException
import pekko.grpc.GrpcClientSettings
import pekko.grpc.scaladsl.PekkoGrpcClient
import pekko.grpc.internal.NettyClientUtils
import pekko.grpc.PekkoGrpcGenerated
import pekko.grpc.scaladsl.SingleResponseRequestBuilder
import pekko.grpc.internal.ScalaUnaryRequestBuilder
// Not sealed so users can extend to write their stubs
@PekkoGrpcGenerated
trait NeutrinoKitClient extends NeutrinoKit with NeutrinoKitClientPowerApi with PekkoGrpcClient
@PekkoGrpcGenerated
object NeutrinoKitClient {
def apply(settings: GrpcClientSettings)(implicit sys: ClassicActorSystemProvider): NeutrinoKitClient =
new DefaultNeutrinoKitClient(GrpcChannel(settings), isChannelOwned = true)
def apply(channel: GrpcChannel)(implicit sys: ClassicActorSystemProvider): NeutrinoKitClient =
new DefaultNeutrinoKitClient(channel, isChannelOwned = false)
private class DefaultNeutrinoKitClient(channel: GrpcChannel, isChannelOwned: Boolean)(implicit sys: ClassicActorSystemProvider) extends NeutrinoKitClient {
import NeutrinoKit.MethodDescriptors._
private implicit val ex: ExecutionContext = sys.classicSystem.dispatcher
private val settings = channel.settings
private val options = NettyClientUtils.callOptions(settings)
private def statusRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(statusDescriptor, channel, options, settings)
private def addPeerRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(addPeerDescriptor, channel, options, settings)
private def disconnectPeerRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(disconnectPeerDescriptor, channel, options, settings)
private def isBannedRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(isBannedDescriptor, channel, options, settings)
private def getBlockHeaderRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(getBlockHeaderDescriptor, channel, options, settings)
private def getBlockRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(getBlockDescriptor, channel, options, settings)
private def getCFilterRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(getCFilterDescriptor, channel, options, settings)
private def getBlockHashRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaUnaryRequestBuilder(getBlockHashDescriptor, channel, options, settings)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer status(neutrinorpc.StatusRequest) if possible.
*/
override def status(): SingleResponseRequestBuilder[neutrinorpc.StatusRequest, neutrinorpc.StatusResponse] =
statusRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of status
*/
def status(in: neutrinorpc.StatusRequest): scala.concurrent.Future[neutrinorpc.StatusResponse] =
status().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer addPeer(neutrinorpc.AddPeerRequest) if possible.
*/
override def addPeer(): SingleResponseRequestBuilder[neutrinorpc.AddPeerRequest, neutrinorpc.AddPeerResponse] =
addPeerRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of addPeer
*/
def addPeer(in: neutrinorpc.AddPeerRequest): scala.concurrent.Future[neutrinorpc.AddPeerResponse] =
addPeer().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer disconnectPeer(neutrinorpc.DisconnectPeerRequest) if possible.
*/
override def disconnectPeer(): SingleResponseRequestBuilder[neutrinorpc.DisconnectPeerRequest, neutrinorpc.DisconnectPeerResponse] =
disconnectPeerRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of disconnectPeer
*/
def disconnectPeer(in: neutrinorpc.DisconnectPeerRequest): scala.concurrent.Future[neutrinorpc.DisconnectPeerResponse] =
disconnectPeer().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer isBanned(neutrinorpc.IsBannedRequest) if possible.
*/
override def isBanned(): SingleResponseRequestBuilder[neutrinorpc.IsBannedRequest, neutrinorpc.IsBannedResponse] =
isBannedRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of isBanned
*/
def isBanned(in: neutrinorpc.IsBannedRequest): scala.concurrent.Future[neutrinorpc.IsBannedResponse] =
isBanned().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getBlockHeader(neutrinorpc.GetBlockHeaderRequest) if possible.
*/
override def getBlockHeader(): SingleResponseRequestBuilder[neutrinorpc.GetBlockHeaderRequest, neutrinorpc.GetBlockHeaderResponse] =
getBlockHeaderRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of getBlockHeader
*/
def getBlockHeader(in: neutrinorpc.GetBlockHeaderRequest): scala.concurrent.Future[neutrinorpc.GetBlockHeaderResponse] =
getBlockHeader().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getBlock(neutrinorpc.GetBlockRequest) if possible.
*/
override def getBlock(): SingleResponseRequestBuilder[neutrinorpc.GetBlockRequest, neutrinorpc.GetBlockResponse] =
getBlockRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of getBlock
*/
def getBlock(in: neutrinorpc.GetBlockRequest): scala.concurrent.Future[neutrinorpc.GetBlockResponse] =
getBlock().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getCFilter(neutrinorpc.GetCFilterRequest) if possible.
*/
override def getCFilter(): SingleResponseRequestBuilder[neutrinorpc.GetCFilterRequest, neutrinorpc.GetCFilterResponse] =
getCFilterRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of getCFilter
*/
def getCFilter(in: neutrinorpc.GetCFilterRequest): scala.concurrent.Future[neutrinorpc.GetCFilterResponse] =
getCFilter().invoke(in)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getBlockHash(neutrinorpc.GetBlockHashRequest) if possible.
*/
override def getBlockHash(): SingleResponseRequestBuilder[neutrinorpc.GetBlockHashRequest, neutrinorpc.GetBlockHashResponse] =
getBlockHashRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of getBlockHash
*/
def getBlockHash(in: neutrinorpc.GetBlockHashRequest): scala.concurrent.Future[neutrinorpc.GetBlockHashResponse] =
getBlockHash().invoke(in)
override def close(): scala.concurrent.Future[pekko.Done] =
if (isChannelOwned) channel.close()
else throw new GrpcClientCloseException()
override def closed: scala.concurrent.Future[pekko.Done] = channel.closed()
}
}
@PekkoGrpcGenerated
trait NeutrinoKitClientPowerApi {
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer status(neutrinorpc.StatusRequest) if possible.
*/
def status(): SingleResponseRequestBuilder[neutrinorpc.StatusRequest, neutrinorpc.StatusResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer addPeer(neutrinorpc.AddPeerRequest) if possible.
*/
def addPeer(): SingleResponseRequestBuilder[neutrinorpc.AddPeerRequest, neutrinorpc.AddPeerResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer disconnectPeer(neutrinorpc.DisconnectPeerRequest) if possible.
*/
def disconnectPeer(): SingleResponseRequestBuilder[neutrinorpc.DisconnectPeerRequest, neutrinorpc.DisconnectPeerResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer isBanned(neutrinorpc.IsBannedRequest) if possible.
*/
def isBanned(): SingleResponseRequestBuilder[neutrinorpc.IsBannedRequest, neutrinorpc.IsBannedResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getBlockHeader(neutrinorpc.GetBlockHeaderRequest) if possible.
*/
def getBlockHeader(): SingleResponseRequestBuilder[neutrinorpc.GetBlockHeaderRequest, neutrinorpc.GetBlockHeaderResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getBlock(neutrinorpc.GetBlockRequest) if possible.
*/
def getBlock(): SingleResponseRequestBuilder[neutrinorpc.GetBlockRequest, neutrinorpc.GetBlockResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getCFilter(neutrinorpc.GetCFilterRequest) if possible.
*/
def getCFilter(): SingleResponseRequestBuilder[neutrinorpc.GetCFilterRequest, neutrinorpc.GetCFilterResponse] = ???
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer getBlockHash(neutrinorpc.GetBlockHashRequest) if possible.
*/
def getBlockHash(): SingleResponseRequestBuilder[neutrinorpc.GetBlockHashRequest, neutrinorpc.GetBlockHashResponse] = ???
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy