move default content type to const

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-05-24 23:11:05 +03:00
parent 7a1fdef33a
commit 0fae2e1bdd

View File

@ -22,6 +22,10 @@ import (
gmetadata "google.golang.org/grpc/metadata" gmetadata "google.golang.org/grpc/metadata"
) )
const (
defaultContentType = "application/grpc+proto"
)
type grpcClient struct { type grpcClient struct {
opts client.Options opts client.Options
pool *pool pool *pool
@ -723,7 +727,7 @@ func (g *grpcClient) getGrpcCallOptions() []grpc.CallOption {
func NewClient(opts ...client.Option) client.Client { func NewClient(opts ...client.Option) client.Client {
options := client.NewOptions(opts...) options := client.NewOptions(opts...)
// default content type for grpc // default content type for grpc
options.ContentType = "application/grpc+proto" options.ContentType = defaultContentType
rc := &grpcClient{ rc := &grpcClient{
opts: options, opts: options,