NewServerCredentials returns a new server-side transport credentials implementation which uses xDS APIs to fetch its security configuration.
(opts ServerOptions)
| 66 | // NewServerCredentials returns a new server-side transport credentials |
| 67 | // implementation which uses xDS APIs to fetch its security configuration. |
| 68 | func NewServerCredentials(opts ServerOptions) (credentials.TransportCredentials, error) { |
| 69 | if opts.FallbackCreds == nil { |
| 70 | return nil, errors.New("missing fallback credentials") |
| 71 | } |
| 72 | return &credsImpl{ |
| 73 | isClient: false, |
| 74 | fallback: opts.FallbackCreds, |
| 75 | }, nil |
| 76 | } |
| 77 | |
| 78 | // credsImpl is an implementation of the credentials.TransportCredentials |
| 79 | // interface which uses xDS APIs to fetch its security configuration. |
no outgoing calls