@ -115,7 +115,7 @@ func Invoke(ctx context.Context, method string, args, reply proto.Message, cc *C
|
|||||||
Delay: false,
|
Delay: false,
|
||||||
}
|
}
|
||||||
ts := 0
|
ts := 0
|
||||||
var lastErr error // record the error happened in the last iteration
|
var lastErr error // record the error that happened
|
||||||
for {
|
for {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
|
@ -49,7 +49,6 @@ import (
|
|||||||
type dialOptions struct {
|
type dialOptions struct {
|
||||||
protocol string
|
protocol string
|
||||||
authOptions []credentials.Credentials
|
authOptions []credentials.Credentials
|
||||||
// TBD: other options
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DialOption configures how we set up the connection including auth
|
// DialOption configures how we set up the connection including auth
|
||||||
@ -64,8 +63,8 @@ func WithClientTLS(creds credentials.TransportAuthenticator) DialOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithComputeEngine returns a DialOption which sets a
|
// WithComputeEngine returns a DialOption which sets
|
||||||
// credentials which uses application default credentials as provided to
|
// credentials which use application default credentials as provided to
|
||||||
// Google Compute Engine. Note that TLS credentials is typically also
|
// Google Compute Engine. Note that TLS credentials is typically also
|
||||||
// needed. If it is the case, users need to pass WithTLS option too.
|
// needed. If it is the case, users need to pass WithTLS option too.
|
||||||
func WithComputeEngine(creds credentials.Credentials) DialOption {
|
func WithComputeEngine(creds credentials.Credentials) DialOption {
|
||||||
@ -76,7 +75,7 @@ func WithComputeEngine(creds credentials.Credentials) DialOption {
|
|||||||
|
|
||||||
// Dial creates a client connection the given target.
|
// Dial creates a client connection the given target.
|
||||||
// TODO(zhaoq): Have an option to make Dial return immediately without waiting
|
// TODO(zhaoq): Have an option to make Dial return immediately without waiting
|
||||||
// for connection complete.
|
// for connection to complete.
|
||||||
func Dial(target string, opts ...DialOption) (*ClientConn, error) {
|
func Dial(target string, opts ...DialOption) (*ClientConn, error) {
|
||||||
if target == "" {
|
if target == "" {
|
||||||
return nil, fmt.Errorf("rpc.Dial: target is empty")
|
return nil, fmt.Errorf("rpc.Dial: target is empty")
|
||||||
|
Reference in New Issue
Block a user