diff options
Diffstat (limited to 'vendor/google.golang.org/grpc/internal/internal.go')
-rw-r--r-- | vendor/google.golang.org/grpc/internal/internal.go | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 0708383..eaa54d4 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go | |||
@@ -15,20 +15,36 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | 17 | ||
18 | // Package internal contains gRPC-internal code for testing, to avoid polluting | 18 | // Package internal contains gRPC-internal code, to avoid polluting |
19 | // the godoc of the top-level grpc package. | 19 | // the godoc of the top-level grpc package. It must not import any grpc |
20 | // symbols to avoid circular dependencies. | ||
20 | package internal | 21 | package internal |
21 | 22 | ||
22 | // TestingCloseConns closes all existing transports but keeps | 23 | import "context" |
23 | // grpcServer.lis accepting new connections. | ||
24 | // | ||
25 | // The provided grpcServer must be of type *grpc.Server. It is untyped | ||
26 | // for circular dependency reasons. | ||
27 | var TestingCloseConns func(grpcServer interface{}) | ||
28 | 24 | ||
29 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. | 25 | var ( |
30 | // It must be called before Serve and requires TLS credentials. | 26 | // WithContextDialer is exported by dialoptions.go |
31 | // | 27 | WithContextDialer interface{} // func(context.Context, string) (net.Conn, error) grpc.DialOption |
32 | // The provided grpcServer must be of type *grpc.Server. It is untyped | 28 | // WithResolverBuilder is exported by dialoptions.go |
33 | // for circular dependency reasons. | 29 | WithResolverBuilder interface{} // func (resolver.Builder) grpc.DialOption |
34 | var TestingUseHandlerImpl func(grpcServer interface{}) | 30 | // WithHealthCheckFunc is not exported by dialoptions.go |
31 | WithHealthCheckFunc interface{} // func (HealthChecker) DialOption | ||
32 | // HealthCheckFunc is used to provide client-side LB channel health checking | ||
33 | HealthCheckFunc HealthChecker | ||
34 | // BalancerUnregister is exported by package balancer to unregister a balancer. | ||
35 | BalancerUnregister func(name string) | ||
36 | ) | ||
37 | |||
38 | // HealthChecker defines the signature of the client-side LB channel health checking function. | ||
39 | type HealthChecker func(ctx context.Context, newStream func() (interface{}, error), reportHealth func(bool), serviceName string) error | ||
40 | |||
41 | const ( | ||
42 | // CredsBundleModeFallback switches GoogleDefaultCreds to fallback mode. | ||
43 | CredsBundleModeFallback = "fallback" | ||
44 | // CredsBundleModeBalancer switches GoogleDefaultCreds to grpclb balancer | ||
45 | // mode. | ||
46 | CredsBundleModeBalancer = "balancer" | ||
47 | // CredsBundleModeBackendFromBalancer switches GoogleDefaultCreds to mode | ||
48 | // that supports backend returned by grpclb balancer. | ||
49 | CredsBundleModeBackendFromBalancer = "backend-from-balancer" | ||
50 | ) | ||