istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pilot/pkg/xds/v3/model.go (about) 1 // Copyright Istio Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package v3 16 17 import ( 18 "istio.io/istio/pkg/model" 19 ) 20 21 const ( 22 ClusterType = model.ClusterType 23 EndpointType = model.EndpointType 24 ListenerType = model.ListenerType 25 RouteType = model.RouteType 26 SecretType = model.SecretType 27 ExtensionConfigurationType = model.ExtensionConfigurationType 28 NameTableType = model.NameTableType 29 HealthInfoType = model.HealthInfoType 30 ProxyConfigType = model.ProxyConfigType 31 DebugType = model.DebugType 32 BootstrapType = model.BootstrapType 33 AddressType = model.AddressType 34 WorkloadType = model.WorkloadType 35 WorkloadAuthorizationType = model.WorkloadAuthorizationType 36 37 // nolint 38 HttpProtocolOptionsType = "envoy.extensions.upstreams.http.v3.HttpProtocolOptions" 39 ) 40 41 // GetShortType returns an abbreviated form of a type, useful for logging or human friendly messages 42 func GetShortType(typeURL string) string { 43 return model.GetShortType(typeURL) 44 } 45 46 // GetMetricType returns the form of a type reported for metrics 47 func GetMetricType(typeURL string) string { 48 return model.GetMetricType(typeURL) 49 } 50 51 // GetResourceType returns resource form of an abbreviated form 52 func GetResourceType(shortType string) string { 53 return model.GetResourceType(shortType) 54 } 55 56 // IsEnvoyType checks whether the typeURL is a valid Envoy type. 57 func IsEnvoyType(typeURL string) bool { 58 return model.IsEnvoyType(typeURL) 59 }