...

Package bootstrap

import "google.golang.org/grpc/xds/bootstrap"
Overview
Index

Overview ▾

Package bootstrap provides the functionality to register possible options for aspects of the xDS client through the bootstrap file.

Experimental

Notice: This package is EXPERIMENTAL and may be changed or removed in a later release.

func RegisterCredentials

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.

type Credentials

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

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.