grpc-haskell-0.1.0: Haskell implementation of gRPC layered on shared C library.
Safe HaskellNone
LanguageHaskell2010

Network.GRPC.HighLevel.Generated

Synopsis

Types

newtype MetadataMap #

Represents metadata for a given RPC, consisting of key-value pairs. Keys are allowed to be repeated. Since repeated keys are unlikely in practice, the IsList instance uses key-value pairs as items. For example, fromList [("key1","val1"),("key2","val2"),("key1","val3")].

newtype MethodName #

Constructors

MethodName 

Instances

Instances details
Eq MethodName 
Instance details

Defined in Network.GRPC.LowLevel.Call

Show MethodName 
Instance details

Defined in Network.GRPC.LowLevel.Call

IsString MethodName 
Instance details

Defined in Network.GRPC.LowLevel.Call

data GRPCMethodType #

Models the four types of RPC call supported by gRPC (and correspond to DataKinds phantom types on RegisteredMethods).

data GRPCImpl Source #

Used at the kind level as a parameter to service definitions generated by the grpc compiler, with the effect of having the field types reduce to the appropriate types for the method types.

Constructors

ServerImpl 
ClientImpl 

type family MkHandler (impl :: GRPCImpl) (methodType :: GRPCMethodType) i o Source #

GHC does not let us partially apply a type family. However, we can define a type to use as an interpreter, and then use this interpreter type fully applied to get the same effect.

newtype Host #

Constructors

Host 

Fields

Instances

Instances details
Eq Host 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

(==) :: Host -> Host -> Bool #

(/=) :: Host -> Host -> Bool #

Show Host 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

showsPrec :: Int -> Host -> ShowS #

show :: Host -> String #

showList :: [Host] -> ShowS #

IsString Host 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

fromString :: String -> Host #

newtype Port #

Constructors

Port 

Fields

Instances

Instances details
Eq Port 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

(==) :: Port -> Port -> Bool #

(/=) :: Port -> Port -> Bool #

Num Port 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

(+) :: Port -> Port -> Port #

(-) :: Port -> Port -> Port #

(*) :: Port -> Port -> Port #

negate :: Port -> Port #

abs :: Port -> Port #

signum :: Port -> Port #

fromInteger :: Integer -> Port #

Show Port 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

showsPrec :: Int -> Port -> ShowS #

show :: Port -> String #

showList :: [Port] -> ShowS #

data GRPCIOError #

Describes all errors that can occur while running a GRPC-related IO action.

Constructors

GRPCIOCallError CallError

Errors that can occur while the call is in flight. These errors come from the core gRPC library directly.

GRPCIOTimeout

Indicates that we timed out while waiting for an operation to complete on the CompletionQueue.

GRPCIOShutdown

Indicates that the CompletionQueue is shutting down and no more work can be processed. This can happen if the client or server is shutting down.

GRPCIOShutdownFailure

Thrown if a CompletionQueue fails to shut down in a reasonable amount of time.

GRPCIOUnknownError 
GRPCIOBadStatusCode StatusCode StatusDetails 
GRPCIODecodeError String 
GRPCIOInternalUnexpectedRecv String 
GRPCIOHandlerException String 

Server

data ServiceOptions Source #

Options for a service that was generated from a .proto file. This is essentially ServerOptions with the handler fields removed.

Constructors

ServiceOptions 

Fields

data ServerCall a #

Represents one registered GRPC call on the server. Contains pointers to all the C state needed to respond to a registered call.

Instances

Instances details
Functor ServerCall 
Instance details

Defined in Network.GRPC.LowLevel.Call

Methods

fmap :: (a -> b) -> ServerCall a -> ServerCall b #

(<$) :: a -> ServerCall b -> ServerCall a #

Show a => Show (ServerCall a) 
Instance details

Defined in Network.GRPC.LowLevel.Call

data ServerRequest (streamType :: GRPCMethodType) request response where Source #

Constructors

ServerNormalRequest :: ServerCallMetadata -> request -> ServerRequest 'Normal request response 
ServerReaderRequest :: ServerCallMetadata -> StreamRecv request -> ServerRequest 'ClientStreaming request response 
ServerWriterRequest :: ServerCallMetadata -> request -> StreamSend response -> ServerRequest 'ServerStreaming request response 
ServerBiDiRequest :: ServerCallMetadata -> StreamRecv request -> StreamSend response -> ServerRequest 'BiDiStreaming request response 

Server Auth

data ServerSSLConfig #

Configuration for SSL.

Constructors

ServerSSLConfig 

Fields

Client

data ClientConfig #

Configuration necessary to set up a client.

Constructors

ClientConfig 

Fields

data ClientRequest (streamType :: GRPCMethodType) request response where Source #

Constructors

ClientNormalRequest :: request -> TimeoutSeconds -> MetadataMap -> ClientRequest 'Normal request response 
ClientWriterRequest :: TimeoutSeconds -> MetadataMap -> (StreamSend request -> IO ()) -> ClientRequest 'ClientStreaming request response 
ClientReaderRequest :: request -> TimeoutSeconds -> MetadataMap -> (ClientCall -> MetadataMap -> StreamRecv response -> IO ()) -> ClientRequest 'ServerStreaming request response

The final field will be invoked once, and it should repeatedly invoke its final argument (of type (StreamRecv response)) in order to obtain the streaming response incrementally.

ClientBiDiRequest :: TimeoutSeconds -> MetadataMap -> (ClientCall -> MetadataMap -> StreamRecv response -> StreamSend request -> WritesDone -> IO ()) -> ClientRequest 'BiDiStreaming request response