NewClientCredentials returns a new client-side transport credentials implementation which uses xDS APIs to fetch its security configuration.
(opts ClientOptions)
| 45 | // NewClientCredentials returns a new client-side transport credentials |
| 46 | // implementation which uses xDS APIs to fetch its security configuration. |
| 47 | func 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. |
no outgoing calls