Fix useragent to 'dapr-sdk-go/v1.8.0' (#421)

* Upadte version tag

Signed-off-by: hunter007 <wentao79@gmail.com>

* Fix: trim blank in SDKVersion

Signed-off-by: hunter007 <wentao79@gmail.com>

* FIx

Signed-off-by: hunter007 <wentao79@gmail.com>

---------

Signed-off-by: hunter007 <wentao79@gmail.com>
This commit is contained in:
hunter007 2023-07-06 21:08:37 +08:00 committed by GitHub
parent 4afb8314b9
commit d2cbfe3ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -22,6 +22,7 @@ import (
"net"
"os"
"strconv"
"strings"
"sync"
"time"
@ -266,7 +267,7 @@ func NewClientWithAddressContext(ctx context.Context, address string) (client Cl
ctx,
address,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUserAgent("dapr-sdk-go/"+version.SDKVersion),
grpc.WithUserAgent(userAgent()),
grpc.WithBlock(),
)
cancel()
@ -305,7 +306,7 @@ func NewClientWithSocket(socket string) (client Client, err error) {
conn, err := grpc.Dial(
addr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUserAgent("dapr-sdk-go/"+version.SDKVersion),
grpc.WithUserAgent(userAgent()),
)
if err != nil {
return nil, fmt.Errorf("error creating connection to '%s': %w", addr, err)
@ -381,3 +382,7 @@ func (c *GRPCClient) GrpcClient() pb.DaprClient {
func (c *GRPCClient) GrpcClientConn() *grpc.ClientConn {
return c.connection
}
func userAgent() string {
return "dapr-sdk-go/" + strings.TrimSpace(version.SDKVersion)
}

View File

@ -1 +1 @@
v1.7.0
v1.8.0