1/* 2 * 3 * Copyright 2020 gRPC authors. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19// Package version defines constants to distinguish between supported xDS API 20// versions. 21package version 22 23// TransportAPI refers to the API version for xDS transport protocol. This 24// describes the xDS gRPC endpoint and version of DiscoveryRequest/Response used 25// on the wire. 26type TransportAPI int 27 28const ( 29 // TransportV2 refers to the v2 xDS transport protocol. 30 TransportV2 TransportAPI = iota 31 // TransportV3 refers to the v3 xDS transport protocol. 32 TransportV3 33) 34 35// Resource URLs. We need to be able to accept either version of the resource 36// regardless of the version of the transport protocol in use. 37const ( 38 V2ListenerURL = "type.googleapis.com/envoy.api.v2.Listener" 39 V2RouteConfigURL = "type.googleapis.com/envoy.api.v2.RouteConfiguration" 40 V2ClusterURL = "type.googleapis.com/envoy.api.v2.Cluster" 41 V2EndpointsURL = "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment" 42 V2HTTPConnManagerURL = "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager" 43 44 V3ListenerURL = "type.googleapis.com/envoy.config.listener.v3.Listener" 45 V3RouteConfigURL = "type.googleapis.com/envoy.config.route.v3.RouteConfiguration" 46 V3ClusterURL = "type.googleapis.com/envoy.config.cluster.v3.Cluster" 47 V3EndpointsURL = "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment" 48 V3HTTPConnManagerURL = "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager" 49 V3UpstreamTLSContextURL = "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext" 50 V3DownstreamTLSContextURL = "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext" 51) 52