MCPcopy
hub / github.com/grpc/grpc-go / WithUserAgent

Function WithUserAgent

dialoptions.go:565–569  ·  view source on GitHub ↗

WithUserAgent returns a DialOption that specifies a user agent string for all the RPCs.

(s string)

Source from the content-addressed store, hash-verified

563// WithUserAgent returns a DialOption that specifies a user agent string for all
564// the RPCs.
565func WithUserAgent(s string) DialOption {
566 return newFuncDialOption(func(o *dialOptions) {
567 o.copts.UserAgent = s + " " + grpcUA
568 })
569}
570
571// WithKeepaliveParams returns a DialOption that specifies keepalive parameters
572// for the client transport.

Callers 6

TestGRPCLB_BasicMethod · 0.92
configDialMethod · 0.92
testPickExtraMetadataFunction · 0.92
clientConnMethod · 0.92

Calls 1

newFuncDialOptionFunction · 0.85

Tested by 5

TestGRPCLB_BasicMethod · 0.74
configDialMethod · 0.74
testPickExtraMetadataFunction · 0.74
clientConnMethod · 0.74