Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype MetadataMap = MetadataMap {}
- newtype MethodName = MethodName {}
- newtype StatusDetails = StatusDetails {}
- data StatusCode
- = StatusDoNotUse
- | StatusOk
- | StatusCancelled
- | StatusUnknown
- | StatusInvalidArgument
- | StatusDeadlineExceeded
- | StatusNotFound
- | StatusAlreadyExists
- | StatusPermissionDenied
- | StatusResourceExhausted
- | StatusFailedPrecondition
- | StatusAborted
- | StatusOutOfRange
- | StatusUnimplemented
- | StatusInternal
- | StatusUnavailable
- | StatusDataLoss
- | StatusUnauthenticated
- data GRPCIOError
- data GRPCImpl
- type family MkHandler (impl :: GRPCImpl) (methodType :: GRPCMethodType) i o
- data ServiceOptions = ServiceOptions {}
- data Handler (a :: GRPCMethodType) where
- UnaryHandler :: (Message c, Message d) => MethodName -> ServerHandler c d -> Handler 'Normal
- ClientStreamHandler :: (Message c, Message d) => MethodName -> ServerReaderHandler c d -> Handler 'ClientStreaming
- ServerStreamHandler :: (Message c, Message d) => MethodName -> ServerWriterHandler c d -> Handler 'ServerStreaming
- BiDiStreamHandler :: (Message c, Message d) => MethodName -> ServerRWHandler c d -> Handler 'BiDiStreaming
- data ServerOptions = ServerOptions {
- optNormalHandlers :: [Handler 'Normal]
- optClientStreamHandlers :: [Handler 'ClientStreaming]
- optServerStreamHandlers :: [Handler 'ServerStreaming]
- optBiDiStreamHandlers :: [Handler 'BiDiStreaming]
- optServerHost :: Host
- optServerPort :: Port
- optUseCompression :: Bool
- optUserAgentPrefix :: String
- optUserAgentSuffix :: String
- optInitialMetadata :: MetadataMap
- optSSLConfig :: Maybe ServerSSLConfig
- optLogger :: String -> IO ()
- optMaxReceiveMessageLength :: Maybe Natural
- defaultOptions :: ServerOptions
- serverLoop :: ServerOptions -> IO ()
- data ServerCall a = ServerCall {
- unsafeSC :: Call
- callCQ :: CompletionQueue
- metadata :: MetadataMap
- payload :: a
- callDeadline :: TimeSpec
- serverCallCancel :: ServerCall a -> StatusCode -> String -> IO ()
- serverCallIsExpired :: ServerCall a -> IO Bool
- data NormalRequestResult = NormalRequestResult {}
- data ClientCall
- clientCallCancel :: ClientCall -> IO ()
- data AuthContext
- data AuthProperty = AuthProperty {}
- getAuthProperties :: AuthContext -> IO [AuthProperty]
- addAuthProperty :: AuthContext -> AuthProperty -> IO ()
- data ServerSSLConfig = ServerSSLConfig {}
- type ProcessMeta = AuthContext -> MetadataMap -> IO AuthProcessorResult
- data AuthProcessorResult = AuthProcessorResult {}
- data SslClientCertificateRequestType
- data ClientSSLConfig = ClientSSLConfig {}
- data ClientSSLKeyCertPair = ClientSSLKeyCertPair {}
- type ClientMetadataCreate = AuthMetadataContext -> IO ClientMetadataCreateResult
- data ClientMetadataCreateResult = ClientMetadataCreateResult {}
- data AuthMetadataContext = AuthMetadataContext {}
- type StreamSend a = a -> IO (Either GRPCIOError ())
- type StreamRecv a = IO (Either GRPCIOError (Maybe a))
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")]
.
Instances
newtype MethodName #
Instances
Eq MethodName | |
Defined in Network.GRPC.LowLevel.Call (==) :: MethodName -> MethodName -> Bool # (/=) :: MethodName -> MethodName -> Bool # | |
Show MethodName | |
Defined in Network.GRPC.LowLevel.Call showsPrec :: Int -> MethodName -> ShowS # show :: MethodName -> String # showList :: [MethodName] -> ShowS # | |
IsString MethodName | |
Defined in Network.GRPC.LowLevel.Call fromString :: String -> MethodName # |
newtype StatusDetails #
Instances
Eq StatusDetails | |
Defined in Network.GRPC.Unsafe (==) :: StatusDetails -> StatusDetails -> Bool # (/=) :: StatusDetails -> StatusDetails -> Bool # | |
Show StatusDetails | |
Defined in Network.GRPC.Unsafe showsPrec :: Int -> StatusDetails -> ShowS # show :: StatusDetails -> String # showList :: [StatusDetails] -> ShowS # | |
IsString StatusDetails | |
Defined in Network.GRPC.Unsafe fromString :: String -> StatusDetails # | |
Semigroup StatusDetails | |
Defined in Network.GRPC.Unsafe (<>) :: StatusDetails -> StatusDetails -> StatusDetails # sconcat :: NonEmpty StatusDetails -> StatusDetails # stimes :: Integral b => b -> StatusDetails -> StatusDetails # | |
Monoid StatusDetails | |
Defined in Network.GRPC.Unsafe mempty :: StatusDetails # mappend :: StatusDetails -> StatusDetails -> StatusDetails # mconcat :: [StatusDetails] -> StatusDetails # |
data StatusCode #
Instances
Enum StatusCode | |
Defined in Network.GRPC.Unsafe.Op succ :: StatusCode -> StatusCode # pred :: StatusCode -> StatusCode # toEnum :: Int -> StatusCode # fromEnum :: StatusCode -> Int # enumFrom :: StatusCode -> [StatusCode] # enumFromThen :: StatusCode -> StatusCode -> [StatusCode] # enumFromTo :: StatusCode -> StatusCode -> [StatusCode] # enumFromThenTo :: StatusCode -> StatusCode -> StatusCode -> [StatusCode] # | |
Eq StatusCode | |
Defined in Network.GRPC.Unsafe.Op (==) :: StatusCode -> StatusCode -> Bool # (/=) :: StatusCode -> StatusCode -> Bool # | |
Read StatusCode | |
Defined in Network.GRPC.Unsafe.Op readsPrec :: Int -> ReadS StatusCode # readList :: ReadS [StatusCode] # readPrec :: ReadPrec StatusCode # readListPrec :: ReadPrec [StatusCode] # | |
Show StatusCode | |
Defined in Network.GRPC.Unsafe.Op showsPrec :: Int -> StatusCode -> ShowS # show :: StatusCode -> String # showList :: [StatusCode] -> ShowS # |
data GRPCIOError #
Describes all errors that can occur while running a GRPC-related IO action.
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 |
GRPCIOShutdown | Indicates that the |
GRPCIOShutdownFailure | Thrown if a |
GRPCIOUnknownError | |
GRPCIOBadStatusCode StatusCode StatusDetails | |
GRPCIODecodeError String | |
GRPCIOInternalUnexpectedRecv String | |
GRPCIOHandlerException String |
Instances
Eq GRPCIOError | |
Defined in Network.GRPC.LowLevel.GRPC (==) :: GRPCIOError -> GRPCIOError -> Bool # (/=) :: GRPCIOError -> GRPCIOError -> Bool # | |
Show GRPCIOError | |
Defined in Network.GRPC.LowLevel.GRPC showsPrec :: Int -> GRPCIOError -> ShowS # show :: GRPCIOError -> String # showList :: [GRPCIOError] -> ShowS # | |
Exception GRPCIOError | |
Defined in Network.GRPC.LowLevel.GRPC |
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.
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.
Instances
type MkHandler 'ServerImpl 'BiDiStreaming i o Source # | |
Defined in Network.GRPC.HighLevel.Generated | |
type MkHandler 'ServerImpl 'ServerStreaming i o Source # | |
Defined in Network.GRPC.HighLevel.Generated | |
type MkHandler 'ServerImpl 'ClientStreaming i o Source # | |
Defined in Network.GRPC.HighLevel.Generated | |
type MkHandler 'ServerImpl 'Normal i o Source # | |
Defined in Network.GRPC.HighLevel.Generated |
data ServiceOptions Source #
Options for a service that was generated from a .proto file. This is
essentially ServerOptions
with the handler fields removed.
ServiceOptions | |
|
Server
data Handler (a :: GRPCMethodType) where Source #
UnaryHandler :: (Message c, Message d) => MethodName -> ServerHandler c d -> Handler 'Normal | |
ClientStreamHandler :: (Message c, Message d) => MethodName -> ServerReaderHandler c d -> Handler 'ClientStreaming | |
ServerStreamHandler :: (Message c, Message d) => MethodName -> ServerWriterHandler c d -> Handler 'ServerStreaming | |
BiDiStreamHandler :: (Message c, Message d) => MethodName -> ServerRWHandler c d -> Handler 'BiDiStreaming |
data ServerOptions Source #
ServerOptions | |
|
serverLoop :: ServerOptions -> IO () Source #
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.
ServerCall | |
|
Instances
Functor ServerCall | |
Defined in Network.GRPC.LowLevel.Call fmap :: (a -> b) -> ServerCall a -> ServerCall b # (<$) :: a -> ServerCall b -> ServerCall a # | |
Show a => Show (ServerCall a) | |
Defined in Network.GRPC.LowLevel.Call showsPrec :: Int -> ServerCall a -> ShowS # show :: ServerCall a -> String # showList :: [ServerCall a] -> ShowS # |
serverCallCancel :: ServerCall a -> StatusCode -> String -> IO () #
serverCallIsExpired :: ServerCall a -> IO Bool #
Client
data NormalRequestResult #
NormalRequestResult | |
|
Instances
Eq NormalRequestResult | |
Defined in Network.GRPC.LowLevel.Client (==) :: NormalRequestResult -> NormalRequestResult -> Bool # (/=) :: NormalRequestResult -> NormalRequestResult -> Bool # | |
Show NormalRequestResult | |
Defined in Network.GRPC.LowLevel.Client showsPrec :: Int -> NormalRequestResult -> ShowS # show :: NormalRequestResult -> String # showList :: [NormalRequestResult] -> ShowS # |
data ClientCall #
Represents one GRPC call (i.e. request) on the client.
This is used to associate send/receive Op
s with a request.
clientCallCancel :: ClientCall -> IO () #
Client and Server Auth
data AuthContext #
Context for auth. This is essentially just a set of key-value pairs that can be mutated. Note: it appears that any keys set or modified on this object do not appear in the AuthContext of the peer, so you must send along auth info in the metadata. It's currently unclear to us what the purpose of modifying this is, but we offer the ability for the sake of completeness.
Instances
Show AuthContext | |
Defined in Network.GRPC.Unsafe.Security showsPrec :: Int -> AuthContext -> ShowS # show :: AuthContext -> String # showList :: [AuthContext] -> ShowS # | |
Storable AuthContext | |
Defined in Network.GRPC.Unsafe.Security sizeOf :: AuthContext -> Int # alignment :: AuthContext -> Int # peekElemOff :: Ptr AuthContext -> Int -> IO AuthContext # pokeElemOff :: Ptr AuthContext -> Int -> AuthContext -> IO () # peekByteOff :: Ptr b -> Int -> IO AuthContext # pokeByteOff :: Ptr b -> Int -> AuthContext -> IO () # peek :: Ptr AuthContext -> IO AuthContext # poke :: Ptr AuthContext -> AuthContext -> IO () # |
data AuthProperty #
Represents one key/value pair in an AuthContext
.
Instances
Eq AuthProperty | |
Defined in Network.GRPC.Unsafe.Security (==) :: AuthProperty -> AuthProperty -> Bool # (/=) :: AuthProperty -> AuthProperty -> Bool # | |
Show AuthProperty | |
Defined in Network.GRPC.Unsafe.Security showsPrec :: Int -> AuthProperty -> ShowS # show :: AuthProperty -> String # showList :: [AuthProperty] -> ShowS # |
getAuthProperties :: AuthContext -> IO [AuthProperty] #
addAuthProperty :: AuthContext -> AuthProperty -> IO () #
Adds a new property to the given AuthContext
.
Server Auth
data ServerSSLConfig #
Configuration for SSL.
ServerSSLConfig | |
|
type ProcessMeta = AuthContext -> MetadataMap -> IO AuthProcessorResult #
A custom auth metadata processor. This can be used to implement customized auth schemes based on the metadata in the request.
data AuthProcessorResult #
AuthProcessorResult | |
|
data SslClientCertificateRequestType #
Instances
Client Auth
data ClientSSLConfig #
SSL configuration for the client. It's perfectly acceptable for both fields
to be Nothing
, in which case default fallbacks will be used for the server
root cert.
ClientSSLConfig | |
|
data ClientSSLKeyCertPair #
Instances
Show ClientSSLKeyCertPair | |
Defined in Network.GRPC.LowLevel.Client showsPrec :: Int -> ClientSSLKeyCertPair -> ShowS # show :: ClientSSLKeyCertPair -> String # showList :: [ClientSSLKeyCertPair] -> ShowS # |
type ClientMetadataCreate = AuthMetadataContext -> IO ClientMetadataCreateResult #
Optional plugin for attaching custom auth metadata to each call.
data ClientMetadataCreateResult #
ClientMetadataCreateResult | |
|
data AuthMetadataContext #
The context which a client-side auth metadata plugin sees when it runs.
AuthMetadataContext | |
|
Instances
Show AuthMetadataContext | |
Defined in Network.GRPC.Unsafe.Security showsPrec :: Int -> AuthMetadataContext -> ShowS # show :: AuthMetadataContext -> String # showList :: [AuthMetadataContext] -> ShowS # |
Streaming utilities
type StreamSend a = a -> IO (Either GRPCIOError ()) #
type StreamRecv a = IO (Either GRPCIOError (Maybe a)) #