I am trying to use GoLang grpc library to make a dial. The GRPC.dial has a method signature like this:
func Dial(target string, opts ...DialOption) (*ClientConn, error)
and DialOption is a type like this:
DialOptions func(*dialOptions)
dialOptions is itself a struct with other parameters but I want to pass userAgent string in transport.ConnectOptions which is another struct:
type dialOptions struct {
unaryInt UnaryClientInterceptor
streamInt StreamClientInterceptor
...
...
...
copts transport.ConnectOptions
}
type ConnectOptions struct {
// UserAgent is the application user agent.
UserAgent string
...
...
}
How can I pass my user-agent in the along with the Dial function?
The library is linked here.