Documentation ¶
Overview ¶
Package xds contains types that need to be shared between code under google.golang.org/grpc/xds/... and the rest of gRPC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupBootstrapFile ¶
func SetupBootstrapFile(opts BootstrapOptions) (func(), error)
SetupBootstrapFile creates a temporary file with bootstrap contents, based on the passed in options, and updates the bootstrap environment variable to point to this file.
Returns a cleanup function which will be non-nil if the setup process was completed successfully. It is the responsibility of the caller to invoke the cleanup function at the end of the test.
Types ¶
type BootstrapOptions ¶
type BootstrapOptions struct { // Version is the xDS transport protocol version. Version TransportAPI // NodeID is the node identifier of the gRPC client/server node in the // proxyless service mesh. NodeID string // ServerURI is the address of the management server. ServerURI string // ServerListenerResourceNameTemplate is the Listener resource name to fetch. ServerListenerResourceNameTemplate string // CertificateProviders is the certificate providers configuration. CertificateProviders map[string]json.RawMessage }
BootstrapOptions wraps the parameters passed to SetupBootstrapFile.
type StringMatcher ¶
type StringMatcher struct {
// contains filtered or unexported fields
}
StringMatcher contains match criteria for matching a string, and is an internal representation of the `StringMatcher` proto defined at https://github.com/envoyproxy/envoy/blob/main/api/envoy/type/matcher/v3/string.proto.
func StringMatcherForTesting ¶
func StringMatcherForTesting(exact, prefix, suffix, contains *string, regex *regexp.Regexp, ignoreCase bool) StringMatcher
StringMatcherForTesting is a helper function to create a StringMatcher based on the given arguments. Intended only for testing purposes.
func StringMatcherFromProto ¶
func StringMatcherFromProto(matcherProto *v3matcherpb.StringMatcher) (StringMatcher, error)
StringMatcherFromProto is a helper function to create a StringMatcher from the corresponding StringMatcher proto.
Returns a non-nil error if matcherProto is invalid.
func (StringMatcher) Equal ¶
func (sm StringMatcher) Equal(other StringMatcher) bool
Equal returns true if other and sm are equivalent to each other.
func (StringMatcher) ExactMatch ¶
func (sm StringMatcher) ExactMatch() string
ExactMatch returns the value of the configured exact match or an empty string if exact match criteria was not specified.
func (StringMatcher) Match ¶
func (sm StringMatcher) Match(input string) bool
Match returns true if input matches the criteria in the given StringMatcher.
type TransportAPI ¶
type TransportAPI int
TransportAPI refers to the API version for xDS transport protocol.
const ( // TransportV2 refers to the v2 xDS transport protocol. TransportV2 TransportAPI = iota // TransportV3 refers to the v3 xDS transport protocol. TransportV3 )