dubbo.apache.org/dubbo-go/v3@v3.1.1/xds/client/resource/version/version.go (about)

     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  See the NOTICE file distributed with
     4   * this work for additional information regarding copyright ownership.
     5   * The ASF licenses this file to You under the Apache License, Version 2.0
     6   * (the "License"); you may not use this file except in compliance with
     7   * the License.  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   *
    20   * Copyright 2020 gRPC authors.
    21   *
    22   */
    23  
    24  // Package version defines constants to distinguish between supported xDS API
    25  // versions.
    26  package version
    27  
    28  // TransportAPI refers to the API version for xDS transport protocol. This
    29  // describes the xDS gRPC endpoint and version of DiscoveryRequest/Response used
    30  // on the wire.
    31  type TransportAPI int
    32  
    33  const (
    34  	// TransportV2 refers to the v2 xDS transport protocol.
    35  	TransportV2 TransportAPI = iota
    36  	// TransportV3 refers to the v3 xDS transport protocol.
    37  	TransportV3
    38  )
    39  
    40  // Resource URLs. We need to be able to accept either version of the resource
    41  // regardless of the version of the transport protocol in use.
    42  const (
    43  	googleapiPrefix = "type.googleapis.com/"
    44  
    45  	V2ListenerType    = "envoy.api.v2.Listener"
    46  	V2RouteConfigType = "envoy.api.v2.RouteConfiguration"
    47  	V2ClusterType     = "envoy.api.v2.Cluster"
    48  	V2EndpointsType   = "envoy.api.v2.ClusterLoadAssignment"
    49  
    50  	V2ListenerURL        = googleapiPrefix + V2ListenerType
    51  	V2RouteConfigURL     = googleapiPrefix + V2RouteConfigType
    52  	V2ClusterURL         = googleapiPrefix + V2ClusterType
    53  	V2EndpointsURL       = googleapiPrefix + V2EndpointsType
    54  	V2HTTPConnManagerURL = googleapiPrefix + "envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"
    55  
    56  	V3ListenerType    = "envoy.config.listener.v3.Listener"
    57  	V3RouteConfigType = "envoy.config.route.v3.RouteConfiguration"
    58  	V3ClusterType     = "envoy.config.cluster.v3.Cluster"
    59  	V3EndpointsType   = "envoy.config.endpoint.v3.ClusterLoadAssignment"
    60  
    61  	V3ListenerURL             = googleapiPrefix + V3ListenerType
    62  	V3RouteConfigURL          = googleapiPrefix + V3RouteConfigType
    63  	V3ClusterURL              = googleapiPrefix + V3ClusterType
    64  	V3EndpointsURL            = googleapiPrefix + V3EndpointsType
    65  	V3HTTPConnManagerURL      = googleapiPrefix + "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
    66  	V3UpstreamTLSContextURL   = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext"
    67  	V3DownstreamTLSContextURL = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext"
    68  )