Safe Haskell | None |
---|---|
Language | Haskell2010 |
For further information over initialization of the connection, consult the http2-client-grpc docs.
Synopsis
- data GRpcConnection (s :: Package') (p :: GRpcMessageProtocol)
- initGRpc :: MonadIO m => GrpcClientConfig -> Proxy p -> forall s. m (Either ClientError (GRpcConnection s p))
- initGRpcZipkin :: (MonadIO m, MonadTrace m) => GrpcClientConfig -> Proxy p -> Text -> forall s. m (Either ClientError (GRpcConnection s p))
- data GRpcMessageProtocol
- msgProtoBuf :: Proxy 'MsgProtoBuf
- msgAvro :: Proxy 'MsgAvro
- data GrpcClientConfig
- grpcClientConfigSimple :: HostName -> PortNumber -> UseTlsOrNot -> GrpcClientConfig
- data CompressMode
- data GRpcReply a
- module Optics.Core
- module Mu.Schema.Optics
Initialization of the gRPC client
data GRpcConnection (s :: Package') (p :: GRpcMessageProtocol) Source #
Represents a connection to the service s
.
Instances
(pkg ~ 'Package ('Just pkgName) '[service], service ~ 'Service serviceName methods, SearchMethodOptic p methods m t, KnownName serviceName, KnownName pkgName, KnownName m, MkRPC p) => LabelOptic m A_Getter (GRpcConnection pkg p) (GRpcConnection pkg p) t t Source # | |
Defined in Mu.GRpc.Client.Optics labelOptic :: Optic A_Getter NoIx (GRpcConnection pkg p) (GRpcConnection pkg p) t t # |
:: MonadIO m | |
=> GrpcClientConfig | gRPC configuration |
-> Proxy p | |
-> forall s. m (Either ClientError (GRpcConnection s p)) |
Initializes a connection to a gRPC server. Usually the service you are connecting to is inferred from the usage later on. However, it can also be made explicit by using
initGRpc config msgProtoBuf @Service
:: (MonadIO m, MonadTrace m) | |
=> GrpcClientConfig | gRPC configuration |
-> Proxy p | |
-> Text | |
-> forall s. m (Either ClientError (GRpcConnection s p)) |
Initializes a connection to a gRPC server, creating a new span for distributed tracing. Usually the service you are connecting to is inferred from the usage later on. However, it can also be made explicit by using
initGRpcZipkin config msgProtoBuf "person" @Service
data GRpcMessageProtocol #
Serialization formats supported with gRPC.
MsgProtoBuf | Protocol Buffers. |
MsgAvro | Avro. |
Instances
Eq GRpcMessageProtocol | |
Defined in Mu.GRpc.Bridge (==) :: GRpcMessageProtocol -> GRpcMessageProtocol -> Bool # (/=) :: GRpcMessageProtocol -> GRpcMessageProtocol -> Bool # | |
Show GRpcMessageProtocol | |
Defined in Mu.GRpc.Bridge showsPrec :: Int -> GRpcMessageProtocol -> ShowS # show :: GRpcMessageProtocol -> String # showList :: [GRpcMessageProtocol] -> ShowS # |
msgProtoBuf :: Proxy 'MsgProtoBuf #
Choose Protocol Buffers as serialization format for gRPC. This value is commonly used to create a client or server.
Choose Avro as serialization format for gRPC. This value is commonly used to create a client or server.
data GrpcClientConfig #
Configuration to setup a GrpcClient.
grpcClientConfigSimple :: HostName -> PortNumber -> UseTlsOrNot -> GrpcClientConfig #
Request arguments and responses
data CompressMode #
GRpcTooMuchConcurrency TooMuchConcurrency | |
GRpcErrorCode ErrorCode | |
GRpcErrorString String | |
GRpcClientError ClientError | |
GRpcOk a |
Re-exported for convenience
module Optics.Core
module Mu.Schema.Optics