Documentation ¶
Index ¶
- func BuildClusterName(direction TrafficDirection, subsetName, hostname string, port int) string
- func BuildMetaProtocolRouteName(host string, port int) string
- func GetHashPolicy(dr *DestinationRuleWrapper, subsetName string) string
- func IsFQDNEquals(name1, ns1, name2, ns2 string) bool
- func Struct2JSON(ojb interface{}) interface{}
- type DestinationRuleWrapper
- type EnvoyFilterContext
- type EnvoyFilterWrapper
- type GatewayWrapper
- type ServiceEntryWrapper
- type TrafficDirection
- type VirtualServiceWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClusterName ¶
func BuildClusterName(direction TrafficDirection, subsetName, hostname string, port int) string
BuildClusterName the cluster name referencing service instances for a given service name, a subset and a port, which is the same as the cluster name generated by Istio.
func BuildMetaProtocolRouteName ¶
BuildMetaProtocolRouteName the route name for a given metaProtocol service
func GetHashPolicy ¶
func GetHashPolicy(dr *DestinationRuleWrapper, subsetName string) string
GetHashPolicy return consistent hash policy in dr it will be overridden if subset named as subsetName in param is not nil
func IsFQDNEquals ¶
IsFQDNEquals return true if two FQDN name equals, false if not
func Struct2JSON ¶
func Struct2JSON(ojb interface{}) interface{}
Struct2JSON convert a go struct to a json object
Types ¶
type DestinationRuleWrapper ¶
type DestinationRuleWrapper struct { istioconfig.Meta Spec *networking.DestinationRule }
DestinationRuleWrapper wraps an Istio DestinationRule and its metadata, including name, annotations and labels.
type EnvoyFilterContext ¶
type EnvoyFilterContext struct { // Global Mesh config MeshConfig mesh.Holder // Gateway describes the gateway for which we need to generate the EnvoyFilter. // ServiceEntry will be ignored when this field specified. Gateway *GatewayWrapper // ServiceEntry describes the service for which we need to generate the EnvoyFilter. ServiceEntry *ServiceEntryWrapper // VirtualService is the related VirtualService of the ServiceEntry, which defines the routing rules for the service. // Only one VirtualService is allowed for a Service. // The value of VirtualService is nil in case that no VirtualService defined for the service. VirtualService *VirtualServiceWrapper // VirtualService is the related VirtualService of the ServiceEntry, which defines the routing rules for the service. // Only one VirtualService is allowed for a Service. // The value of VirtualService is nil in case that no VirtualService defined for the service. MetaRouter *metaprotocol.MetaRouter }
EnvoyFilterContext provides an aggregate API for EnvoyFilter generator
type EnvoyFilterWrapper ¶
type EnvoyFilterWrapper struct { Name string Namespace string Envoyfilter *networking.EnvoyFilter }
EnvoyFilterWrapper wraps an Istio EnvoyFilterWrapper and its name, which is used as an unique identifier in Istio. If two Envoyfilters with the same name have been created, the previous one sill be replaced by the latter one
type GatewayWrapper ¶
type GatewayWrapper struct { istioconfig.Meta Spec *networking.Gateway }
GatewayWrapper wraps an Istio Gateway and its metadata, including name, annotations and labels.
type ServiceEntryWrapper ¶
type ServiceEntryWrapper struct { istioconfig.Meta Spec *networking.ServiceEntry }
ServiceEntryWrapper wraps an Istio ServiceEntry and its metadata, including name, annotations and labels. Meta can be used to pass in some additional information that is needed for EnvoyFilter generation. For example, we use an "interface" annotation to pass the dubbo interface to the Dubbo generator.
type TrafficDirection ¶
type TrafficDirection string
TrafficDirection defines whether traffic exists a service instance or enters a service instance
const ( // TrafficDirectionInbound indicates inbound traffic TrafficDirectionInbound TrafficDirection = "inbound" // TrafficDirectionOutbound indicates outbound traffic TrafficDirectionOutbound TrafficDirection = "outbound" )
type VirtualServiceWrapper ¶
type VirtualServiceWrapper struct { istioconfig.Meta Spec *networking.VirtualService }
VirtualServiceWrapper wraps an Istio VirtualService and its metadata, including name, annotations and labels.