v2

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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 AckResponse added in v0.14.0

AckResponse response resource nonce

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

func (*ADSClient) Start

func (adsClient *ADSClient) Start()

Start adsClient send goroutine and receive goroutine send goroutine periodic request lds and cds receive goroutine handle response for both client request and server push

func (*ADSClient) Stop

func (adsClient *ADSClient) Stop()

Stop adsClient wait for send/receive goroutine graceful exit

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL