Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-04-26 19:17:29 +03:00
committed by GitHub
parent 08def4d244
commit 510fa4b379
9 changed files with 93 additions and 73 deletions

View File

@@ -28,13 +28,6 @@ var (
)
type poolMaxStreams struct{}
type poolMaxIdle struct{}
type codecsKey struct{}
type tlsAuth struct{}
type maxRecvMsgSizeKey struct{}
type maxSendMsgSizeKey struct{}
type grpcDialOptions struct{}
type grpcCallOptions struct{}
// maximum streams on a connectioin
func PoolMaxStreams(n int) client.Option {
@@ -46,6 +39,8 @@ func PoolMaxStreams(n int) client.Option {
}
}
type poolMaxIdle struct{}
// maximum idle conns of a pool
func PoolMaxIdle(d int) client.Option {
return func(o *client.Options) {
@@ -56,6 +51,8 @@ func PoolMaxIdle(d int) client.Option {
}
}
type codecsKey struct{}
// gRPC Codec to be used to encode/decode requests for a given content type
func Codec(contentType string, c encoding.Codec) client.Option {
return func(o *client.Options) {
@@ -71,6 +68,8 @@ func Codec(contentType string, c encoding.Codec) client.Option {
}
}
type maxRecvMsgSizeKey struct{}
//
// MaxRecvMsgSize set the maximum size of message that client can receive.
//
@@ -83,6 +82,8 @@ func MaxRecvMsgSize(s int) client.Option {
}
}
type maxSendMsgSizeKey struct{}
//
// MaxSendMsgSize set the maximum size of message that client can send.
//
@@ -95,6 +96,8 @@ func MaxSendMsgSize(s int) client.Option {
}
}
type grpcDialOptions struct{}
//
// DialOptions to be used to configure gRPC dial options
//
@@ -107,6 +110,8 @@ func DialOptions(opts ...grpc.DialOption) client.CallOption {
}
}
type grpcCallOptions struct{}
//
// CallOptions to be used to configure gRPC call options
//