Documentation ¶
Index ¶
- Constants
- func DisableReconnect()
- func EnableReconnect()
- func HandleEnvoyCluster(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
- func HandleEnvoyClusterLoadAssignment(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
- func HandleEnvoyListener(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
- func HandleEnvoyRouteConfiguration(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
- func HandleTypeURL(url string, client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
- func RegisterTypeURLHandleFunc(url string, f TypeURLHandleFunc)
- type ADSClient
- type ADSConfig
- type ClusterConfig
- type ServiceConfig
- type StreamClient
- type TypeURLHandleFunc
- type XDSConfig
Constants ¶
const ( EnvoyListener = "type.googleapis.com/envoy.api.v2.Listener" EnvoyCluster = "type.googleapis.com/envoy.api.v2.Cluster" EnvoyClusterLoadAssignment = "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment" EnvoyRouteConfiguration = "type.googleapis.com/envoy.api.v2.RouteConfiguration" )
default type url mosn will handle
Variables ¶
This section is empty.
Functions ¶
func DisableReconnect ¶
func DisableReconnect()
func EnableReconnect ¶
func EnableReconnect()
func HandleEnvoyCluster ¶
func HandleEnvoyCluster(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
HandleEnvoyCluster parse envoy data to mosn cluster config
func HandleEnvoyClusterLoadAssignment ¶
func HandleEnvoyClusterLoadAssignment(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
HandleEnvoyClusterLoadAssignment parse envoy data to mosn endpoint config
func HandleEnvoyListener ¶
func HandleEnvoyListener(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
HandleEnvoyListener parse envoy data to mosn listener config
func HandleEnvoyRouteConfiguration ¶
func HandleEnvoyRouteConfiguration(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
HandleEnvoyRouteConfiguration parse envoy data to mosn route config
func HandleTypeURL ¶
func HandleTypeURL(url string, client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
func RegisterTypeURLHandleFunc ¶
func RegisterTypeURLHandleFunc(url string, f TypeURLHandleFunc)
Types ¶
type ADSClient ¶
type ADSClient struct { AdsConfig *ADSConfig StreamClientMutex sync.RWMutex StreamClient ads.AggregatedDiscoveryService_StreamAggregatedResourcesClient MosnConfig *v2.MOSNConfig SendControlChan chan int RecvControlChan chan int StopChan chan int }
ADSClient communicated with pilot
type ADSConfig ¶
type ADSConfig struct { APIType core.ApiConfigSource_ApiType RefreshDelay *time.Duration Services []*ServiceConfig StreamClient *StreamClient }
ADSConfig contains ADS config from dynamic resources
func (*ADSConfig) GetStreamClient ¶
func (c *ADSConfig) GetStreamClient() ads.AggregatedDiscoveryService_StreamAggregatedResourcesClient
GetStreamClient return a grpc stream client that connected to ads
type ClusterConfig ¶
type ClusterConfig struct { LbPolicy envoy_api_v2.Cluster_LbPolicy Address []string ConnectTimeout *time.Duration TlsContext *envoy_api_v2_auth.UpstreamTlsContext }
ClusterConfig contains an cluster info from static resources
func (*ClusterConfig) GetEndpoint ¶
func (c *ClusterConfig) GetEndpoint() (string, *time.Duration)
GetEndpoint return an endpoint address by random
type ServiceConfig ¶
type ServiceConfig struct { Timeout *time.Duration ClusterConfig *ClusterConfig }
ServiceConfig for grpc service
type StreamClient ¶
type StreamClient struct { Client ads.AggregatedDiscoveryService_StreamAggregatedResourcesClient Conn *grpc.ClientConn Cancel context.CancelFunc }
StreamClient is an grpc client
type TypeURLHandleFunc ¶
type TypeURLHandleFunc func(client *ADSClient, resp *envoy_api_v2.DiscoveryResponse)
TypeURLHandleFunc is a function that used to parse ads type url data
type XDSConfig ¶
type XDSConfig struct { ADSConfig *ADSConfig Clusters map[string]*ClusterConfig }
XDSConfig contains ADS config and clusters info
func (*XDSConfig) Init ¶
func (c *XDSConfig) Init(dynamicResources *bootstrap.Bootstrap_DynamicResources, staticResources *bootstrap.Bootstrap_StaticResources) error
Init parsed ds and clusters config for xds