feat:support custom callopts on client side
Signed-off-by: haoyun <yun.hao@daocloud.io>
This commit is contained in:
@@ -34,6 +34,7 @@ type clientOpts struct {
|
||||
defaultPlatform platforms.MatchComparer
|
||||
services *services
|
||||
dialOptions []grpc.DialOption
|
||||
callOptions []grpc.CallOption
|
||||
timeout time.Duration
|
||||
}
|
||||
|
||||
@@ -75,6 +76,14 @@ func WithDialOpts(opts []grpc.DialOption) ClientOpt {
|
||||
}
|
||||
}
|
||||
|
||||
// WithCallOpts allows grpc.CallOptions to be set on the connection
|
||||
func WithCallOpts(opts []grpc.CallOption) ClientOpt {
|
||||
return func(c *clientOpts) error {
|
||||
c.callOptions = opts
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithServices sets services used by the client.
|
||||
func WithServices(opts ...ServicesOpt) ClientOpt {
|
||||
return func(c *clientOpts) error {
|
||||
|
||||
Reference in New Issue
Block a user