gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/grpc/xds/internal/xdsclient/xdsresource/version/version.go (about)

     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.
    21  package 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.
    26  type TransportAPI int
    27  
    28  const (
    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.
    37  const (
    38  	googleapiPrefix = "type.googleapis.com/"
    39  
    40  	V2ListenerType    = "envoy.api.v2.Listener"
    41  	V2RouteConfigType = "envoy.api.v2.RouteConfiguration"
    42  	V2ClusterType     = "envoy.api.v2.Cluster"
    43  	V2EndpointsType   = "envoy.api.v2.ClusterLoadAssignment"
    44  
    45  	V2ListenerURL        = googleapiPrefix + V2ListenerType
    46  	V2RouteConfigURL     = googleapiPrefix + V2RouteConfigType
    47  	V2ClusterURL         = googleapiPrefix + V2ClusterType
    48  	V2EndpointsURL       = googleapiPrefix + V2EndpointsType
    49  	V2HTTPConnManagerURL = googleapiPrefix + "envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"
    50  
    51  	V3ListenerType    = "envoy.config.listener.v3.Listener"
    52  	V3RouteConfigType = "envoy.config.route.v3.RouteConfiguration"
    53  	V3ClusterType     = "envoy.config.cluster.v3.Cluster"
    54  	V3EndpointsType   = "envoy.config.endpoint.v3.ClusterLoadAssignment"
    55  
    56  	V3ListenerURL             = googleapiPrefix + V3ListenerType
    57  	V3RouteConfigURL          = googleapiPrefix + V3RouteConfigType
    58  	V3ClusterURL              = googleapiPrefix + V3ClusterType
    59  	V3EndpointsURL            = googleapiPrefix + V3EndpointsType
    60  	V3HTTPConnManagerURL      = googleapiPrefix + "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
    61  	V3UpstreamTLSContextURL   = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext"
    62  	V3DownstreamTLSContextURL = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext"
    63  )