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

Function NewClientCredentials

credentials/xds/xds.go:47–55  ·  view source on GitHub ↗

NewClientCredentials returns a new client-side transport credentials implementation which uses xDS APIs to fetch its security configuration.

(opts ClientOptions)

Source from the content-addressed store, hash-verified

45// NewClientCredentials returns a new client-side transport credentials
46// implementation which uses xDS APIs to fetch its security configuration.
47func NewClientCredentials(opts ClientOptions) (credentials.TransportCredentials, error) {
48 if opts.FallbackCreds == nil {
49 return nil, errors.New("missing fallback credentials")
50 }
51 return &credsImpl{
52 isClient: true,
53 fallback: opts.FallbackCreds,
54 }, nil
55}
56
57// ServerOptions contains parameters to configure a new server-side xDS
58// credentials implementation.

Calls

no outgoing calls