module Database.IAVL.RPC where
import Data.ProtoLens.Message (defMessage)
import Network.GRPC.Client (RPC (..), RawReply)
import Network.GRPC.Client.Helpers (GrpcClient, rawUnary)
import Network.HTTP2.Client (ClientIO, TooMuchConcurrency)
import qualified Proto.Google.Protobuf.Empty as PT (Empty)
import qualified Proto.Iavl.Api as Api
get
:: GrpcClient
-> Api.GetRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.GetResponse))
get = rawUnary (RPC :: RPC Api.IAVLService "get")
getVersioned
:: GrpcClient
-> Api.GetVersionedRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.GetResponse))
getVersioned = rawUnary (RPC :: RPC Api.IAVLService "getVersioned")
getVersionedWithProof
:: GrpcClient
-> Api.GetVersionedRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.GetWithProofResponse))
getVersionedWithProof = rawUnary (RPC :: RPC Api.IAVLService "getVersionedWithProof")
getWithProof
:: GrpcClient
-> Api.GetRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.GetWithProofResponse))
getWithProof = rawUnary (RPC :: RPC Api.IAVLService "getWithProof")
set
:: GrpcClient
-> Api.SetRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.SetResponse))
set = rawUnary (RPC :: RPC Api.IAVLService "set")
remove
:: GrpcClient
-> Api.RemoveRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.RemoveResponse))
remove = rawUnary (RPC :: RPC Api.IAVLService "remove")
saveVersion
:: GrpcClient
-> ClientIO (Either TooMuchConcurrency (RawReply Api.SaveVersionResponse))
saveVersion gc = rawUnary (RPC :: RPC Api.IAVLService "saveVersion") gc defMessage
deleteVersion
:: GrpcClient
-> Api.DeleteVersionRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.DeleteVersionResponse))
deleteVersion = rawUnary (RPC :: RPC Api.IAVLService "deleteVersion")
version
:: GrpcClient
-> ClientIO (Either TooMuchConcurrency (RawReply Api.VersionResponse))
version gc = rawUnary (RPC :: RPC Api.IAVLService "version") gc defMessage
hash
:: GrpcClient
-> ClientIO (Either TooMuchConcurrency (RawReply Api.HashResponse))
hash gc = rawUnary (RPC :: RPC Api.IAVLService "hash") gc defMessage
versionExists
:: GrpcClient
-> Api.VersionExistsRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.VersionExistsResponse))
versionExists = rawUnary (RPC :: RPC Api.IAVLService "versionExists")
verify
:: GrpcClient
-> Api.VerifyRequest
-> ClientIO (Either TooMuchConcurrency (RawReply PT.Empty))
verify = rawUnary (RPC :: RPC Api.IAVLService "verify")
verifyItem
:: GrpcClient
-> Api.VerifyItemRequest
-> ClientIO (Either TooMuchConcurrency (RawReply PT.Empty))
verifyItem = rawUnary (RPC :: RPC Api.IAVLService "verifyItem")
verifyAbsence
:: GrpcClient
-> Api.VerifyAbsenceRequest
-> ClientIO (Either TooMuchConcurrency (RawReply PT.Empty))
verifyAbsence = rawUnary (RPC :: RPC Api.IAVLService "verifyAbsence")
rollback
:: GrpcClient
-> ClientIO (Either TooMuchConcurrency (RawReply PT.Empty))
rollback gc = rawUnary (RPC :: RPC Api.IAVLService "rollback") gc defMessage
has
:: GrpcClient
-> Api.HasRequest
-> ClientIO (Either TooMuchConcurrency (RawReply Api.HasResponse))
has = rawUnary (RPC :: RPC Api.IAVLService "has")