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

Function clusterName

credentials/google/xds.go:61–68  ·  view source on GitHub ↗

clusterName returns the xDS cluster name stored in the attributes in the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

59// clusterName returns the xDS cluster name stored in the attributes in the
60// context.
61func clusterName(ctx context.Context) string {
62 chi := credentials.ClientHandshakeInfoFromContext(ctx)
63 if chi.Attributes == nil {
64 return ""
65 }
66 cluster, _ := xds.GetXDSHandshakeClusterName(chi.Attributes)
67 return cluster
68}
69
70// isDirectPathCluster returns true if the cluster in the context is a
71// directpath cluster, meaning ALTS should be used.

Callers 1

isDirectPathClusterFunction · 0.85

Calls 2

Tested by

no test coverage detected