func RegisterCredentials(c Credentials)
RegisterCredentials registers Credentials used for connecting to the xds management server.
NOTE: this function must only be called during initialization time (i.e. in an init() function), and is not thread-safe. If multiple credentials are registered with the same name, the one registered last will take effect.
Credentials interface encapsulates a credentials.Bundle builder that can be used for communicating with the xDS Management server.
type Credentials interface { // Build returns a credential bundle associated with this credential, and // a function to cleans up additional resources associated with this bundle // when it is no longer needed. Build(config json.RawMessage) (credentials.Bundle, func(), error) // Name returns the credential name associated with this credential. Name() string }
func GetCredentials(name string) Credentials
GetCredentials returns the credentials associated with a given name. If no credentials are registered with the name, nil will be returned.