Documentation
¶
Index ¶
- Variables
- func ClusterToEnvoy(targetName string, connectTimeout, maxRequests int, ...) *v2.Cluster
- func DurationToDuration(duration time.Duration) *types.Duration
- func GenerateEnvoyConfig(n *NodeConfig)
- func GenerateListenerName(listen string, xtype ProxyType) string
- func GenerateRouteName(pathSpec string) (string, string)
- func GenerateUniqConfigName(namespace, name string) string
- func GenerateUniqueEndpointName(priority int, namespace, name string) string
- func GenerateVHostName(domains []string) string
- func GetGRPCServer() *grpc.Server
- func InitGRPCServer()
- func RemoveFromEnvoy(node *NodeConfig)
- func UInt32FromInteger(val int) *types.UInt32Value
- func UInt64FromInteger(val int) *types.UInt64Value
- func WeightedClusterToEnvoy(clusterName string, zoneWeight int) *route.WeightedCluster_ClusterWeight
- type ClusterConfig
- type ClusterLoadAssignment
- type Endpoint
- type EndpointConfig
- func (E *EndpointConfig) AddEndpoint(host string, weight int, healthy bool)
- func (E *EndpointConfig) Clear()
- func (E *EndpointConfig) GetEndpoint(host string) *Endpoint
- func (E *EndpointConfig) RemoveEndpoint(host string)
- func (E *EndpointConfig) String() string
- func (E *EndpointConfig) ToEnvoy(priority, weight int) *endpoint.LocalityLbEndpoints
- type EnvoyCertificateValidator
- type Hasher
- type HealthCheckConfig
- type HealthCheckType
- type HealthServer
- type ListenerConfig
- func (L *ListenerConfig) AddTracker(zone string)
- func (L *ListenerConfig) AddVHost(host *VirtualHost)
- func (L *ListenerConfig) AddVHosts(hosts []*VirtualHost)
- func (L *ListenerConfig) CanBeRemovedBy(zone string) bool
- func (L *ListenerConfig) FindVHost(name string) *VirtualHost
- func (L *ListenerConfig) Free()
- func (L *ListenerConfig) GenerateHCM(vhosts []*route.VirtualHost) *v22.HttpConnectionManager
- func (L *ListenerConfig) GenerateListenParts() (host string, port int64)
- func (L *ListenerConfig) GenerateTCP(clusters *v23.TcpProxy_WeightedClusters) *v23.TcpProxy
- func (L *ListenerConfig) GenerateWeightedCluster(host *route.VirtualHost) *v23.TcpProxy_WeightedClusters
- func (L *ListenerConfig) GetPriorityTracker() string
- func (L *ListenerConfig) GetTrackerCount() int
- func (L *ListenerConfig) IsTrackedBy(zone string) bool
- func (L *ListenerConfig) RemoveTracker(zone string)
- func (L *ListenerConfig) RemoveVHost(name string)
- func (L *ListenerConfig) SafeRemove(vhost, route, clusterName, zone string)
- func (L *ListenerConfig) String() string
- func (L *ListenerConfig) ToEnvoy(vhosts []*route.VirtualHost) (*v2.Listener, error)
- type Locality
- type NodeConfig
- type OutlierConfig
- type ProPsyCache
- func (P *ProPsyCache) AddTLSWatch(secretNamespace, secretName string, node *NodeConfig)
- func (P *ProPsyCache) Cleanup()
- func (P *ProPsyCache) ClearPPS(ppsName string, nodes []string, canaryName string)
- func (P *ProPsyCache) DumpNodes()
- func (P *ProPsyCache) GetEndpointSetByEndpoint(endpointName string) (*EndpointConfig, []*NodeConfig)
- func (P *ProPsyCache) GetNodes() map[string]*NodeConfig
- func (P *ProPsyCache) GetOrCreateNode(name string) *NodeConfig
- func (P *ProPsyCache) GetOrCreateTLS(namespace, name string) *TlsData
- func (P *ProPsyCache) GetTls(namespace, name string) *TlsData
- func (P *ProPsyCache) ProcessQueueOnce()
- func (P *ProPsyCache) RegisterEndpointSet(cfg *EndpointConfig, nodes []*NodeConfig)
- func (P *ProPsyCache) RemoveEndpointSet(s string, nodes []*NodeConfig)
- func (P *ProPsyCache) RemoveTLSWatch(secretNamespace, secretName string, node *NodeConfig)
- func (P *ProPsyCache) Run()
- func (C *ProPsyCache) UpdateTLS(secretNamespace, secretName string, certificate, key []byte) bool
- type PropsyCallbacks
- func (P PropsyCallbacks) OnFetchRequest(ctx context.Context, dr *api.DiscoveryRequest) error
- func (PropsyCallbacks) OnFetchResponse(*api.DiscoveryRequest, *api.DiscoveryResponse)
- func (PropsyCallbacks) OnStreamClosed(int64)
- func (P PropsyCallbacks) OnStreamOpen(ctx context.Context, streamid int64, typeurl string) error
- func (P PropsyCallbacks) OnStreamRequest(streamid int64, dr *api.DiscoveryRequest) error
- func (PropsyCallbacks) OnStreamResponse(int64, *api.DiscoveryRequest, *api.DiscoveryResponse)
- type ProxyType
- type RouteConfig
- func (R *RouteConfig) AddCluster(c *ClusterConfig)
- func (R *RouteConfig) AddClusters(configs []*ClusterConfig)
- func (R *RouteConfig) CalculateWeights() (...)
- func (R *RouteConfig) FindCluster(name string) *ClusterConfig
- func (R *RouteConfig) Free()
- func (R *RouteConfig) GeneratePrioritizedEndpoints(localZone string) ClusterLoadAssignment
- func (R *RouteConfig) GenerateUniqueRouteName() string
- func (R *RouteConfig) GetLocalBestCluster(canary bool) *ClusterConfig
- func (R *RouteConfig) RemoveCluster(name string)
- func (R *RouteConfig) String() string
- func (R *RouteConfig) ToEnvoy(routedClusters []*route.WeightedCluster_ClusterWeight) *route.Route
- type TlsData
- type VirtualHost
- func (V *VirtualHost) AddRoute(r *RouteConfig)
- func (V *VirtualHost) AddRoutes(configs []*RouteConfig)
- func (V *VirtualHost) FindRoute(name string) *RouteConfig
- func (V *VirtualHost) Free()
- func (V *VirtualHost) RemoveRoute(name string)
- func (V *VirtualHost) SafeRemoveRoute(route string, clusterName string)
- func (V *VirtualHost) String() string
- func (V *VirtualHost) ToEnvoy(routes []*route.Route) *route.VirtualHost
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalZone string
Functions ¶
func ClusterToEnvoy ¶
func ClusterToEnvoy(targetName string, connectTimeout, maxRequests int, healthCheck *HealthCheckConfig, outlier *OutlierConfig) *v2.Cluster
func GenerateEnvoyConfig ¶
func GenerateEnvoyConfig(n *NodeConfig)
func GenerateListenerName ¶
func GenerateRouteName ¶
func GenerateUniqConfigName ¶
func GenerateVHostName ¶
func GetGRPCServer ¶
func InitGRPCServer ¶
func InitGRPCServer()
func RemoveFromEnvoy ¶
func RemoveFromEnvoy(node *NodeConfig)
func UInt32FromInteger ¶
func UInt32FromInteger(val int) *types.UInt32Value
func UInt64FromInteger ¶
func UInt64FromInteger(val int) *types.UInt64Value
func WeightedClusterToEnvoy ¶
func WeightedClusterToEnvoy(clusterName string, zoneWeight int) *route.WeightedCluster_ClusterWeight
Types ¶
type ClusterConfig ¶
type ClusterConfig struct {
Name string
ConnectTimeout int
EndpointConfig *EndpointConfig
Weight int
IsCanary bool
MaxRequests int
Priority int
HealthCheck *HealthCheckConfig
Outlier *OutlierConfig
}
func (*ClusterConfig) Free ¶
func (C *ClusterConfig) Free()
func (*ClusterConfig) HasEndpoints ¶
func (C *ClusterConfig) HasEndpoints() bool
func (*ClusterConfig) IsLocalCluster ¶
func (C *ClusterConfig) IsLocalCluster() bool
func (*ClusterConfig) String ¶
func (C *ClusterConfig) String() string
func (*ClusterConfig) ToEnvoy ¶
func (C *ClusterConfig) ToEnvoy() *v2.Cluster
type ClusterLoadAssignment ¶
type ClusterLoadAssignment []*endpoint.LocalityLbEndpoints
func (*ClusterLoadAssignment) ToEnvoy ¶
func (C *ClusterLoadAssignment) ToEnvoy(clusterName string) *v2.ClusterLoadAssignment
type EndpointConfig ¶
type EndpointConfig struct {
Lock sync.Mutex
Name string
ServicePort int // used only internally
Endpoints []*Endpoint
Locality *Locality
}
func (*EndpointConfig) AddEndpoint ¶
func (E *EndpointConfig) AddEndpoint(host string, weight int, healthy bool)
func (*EndpointConfig) Clear ¶
func (E *EndpointConfig) Clear()
func (*EndpointConfig) GetEndpoint ¶
func (E *EndpointConfig) GetEndpoint(host string) *Endpoint
func (*EndpointConfig) RemoveEndpoint ¶
func (E *EndpointConfig) RemoveEndpoint(host string)
func (*EndpointConfig) String ¶
func (E *EndpointConfig) String() string
func (*EndpointConfig) ToEnvoy ¶
func (E *EndpointConfig) ToEnvoy(priority, weight int) *endpoint.LocalityLbEndpoints
type EnvoyCertificateValidator ¶
type EnvoyCertificateValidator struct {
VerifyCN bool
// contains filtered or unexported fields
}
func (*EnvoyCertificateValidator) Add ¶
func (P *EnvoyCertificateValidator) Add(ctx context.Context, streamid int64)
func (*EnvoyCertificateValidator) VerifyCtx ¶
func (P *EnvoyCertificateValidator) VerifyCtx(ctx context.Context, dr *api.DiscoveryRequest) error
func (*EnvoyCertificateValidator) VerifyStream ¶
func (P *EnvoyCertificateValidator) VerifyStream(streamid int64, dr *api.DiscoveryRequest) error
type HealthCheckConfig ¶
type HealthCheckConfig struct {
Timeout time.Duration
Interval time.Duration
UnhealthyTreshold int
HealthyTreshold int
ReuseConnection bool
HealthChecker HealthCheckType
HTTPPath string
HTTPHost string
}
func (*HealthCheckConfig) ToEnvoy ¶
func (H *HealthCheckConfig) ToEnvoy() *core.HealthCheck
type HealthCheckType ¶
type HealthCheckType int
const ( HTTPHealthCheck HealthCheckType = iota HTTP2HealthCheck TCPHealthCheck GRPCHealthCheck )
type HealthServer ¶
type HealthServer struct {
// contains filtered or unexported fields
}
func NewHealthServer ¶
func NewHealthServer(listen string) *HealthServer
func (*HealthServer) SetHealthy ¶
func (H *HealthServer) SetHealthy(healthy bool)
func (*HealthServer) SetReady ¶
func (H *HealthServer) SetReady(ready bool)
func (*HealthServer) Start ¶
func (H *HealthServer) Start()
type ListenerConfig ¶
type ListenerConfig struct {
Name string
Listen string
VirtualHosts []*VirtualHost
Type ProxyType
TrackedLocality []string
TLSSecret *TlsData
// contains filtered or unexported fields
}
func (*ListenerConfig) AddTracker ¶
func (L *ListenerConfig) AddTracker(zone string)
func (*ListenerConfig) AddVHost ¶
func (L *ListenerConfig) AddVHost(host *VirtualHost)
func (*ListenerConfig) AddVHosts ¶
func (L *ListenerConfig) AddVHosts(hosts []*VirtualHost)
func (*ListenerConfig) CanBeRemovedBy ¶
func (L *ListenerConfig) CanBeRemovedBy(zone string) bool
func (*ListenerConfig) FindVHost ¶
func (L *ListenerConfig) FindVHost(name string) *VirtualHost
func (*ListenerConfig) Free ¶
func (L *ListenerConfig) Free()
func (*ListenerConfig) GenerateHCM ¶
func (L *ListenerConfig) GenerateHCM(vhosts []*route.VirtualHost) *v22.HttpConnectionManager
func (*ListenerConfig) GenerateListenParts ¶
func (L *ListenerConfig) GenerateListenParts() (host string, port int64)
func (*ListenerConfig) GenerateTCP ¶
func (L *ListenerConfig) GenerateTCP(clusters *v23.TcpProxy_WeightedClusters) *v23.TcpProxy
func (*ListenerConfig) GenerateWeightedCluster ¶
func (L *ListenerConfig) GenerateWeightedCluster(host *route.VirtualHost) *v23.TcpProxy_WeightedClusters
func (*ListenerConfig) GetPriorityTracker ¶
func (L *ListenerConfig) GetPriorityTracker() string
func (*ListenerConfig) GetTrackerCount ¶
func (L *ListenerConfig) GetTrackerCount() int
func (*ListenerConfig) IsTrackedBy ¶
func (L *ListenerConfig) IsTrackedBy(zone string) bool
func (*ListenerConfig) RemoveTracker ¶
func (L *ListenerConfig) RemoveTracker(zone string)
func (*ListenerConfig) RemoveVHost ¶
func (L *ListenerConfig) RemoveVHost(name string)
func (*ListenerConfig) SafeRemove ¶
func (L *ListenerConfig) SafeRemove(vhost, route, clusterName, zone string)
func (*ListenerConfig) String ¶
func (L *ListenerConfig) String() string
func (*ListenerConfig) ToEnvoy ¶
func (L *ListenerConfig) ToEnvoy(vhosts []*route.VirtualHost) (*v2.Listener, error)
type Locality ¶
type Locality struct {
// Region string // region is fixed, we only change zone
Zone string
}
type NodeConfig ¶
type NodeConfig struct {
NodeName string
Listeners []*ListenerConfig
}
func (*NodeConfig) AddListener ¶
func (N *NodeConfig) AddListener(l *ListenerConfig)
func (*NodeConfig) FindListener ¶
func (N *NodeConfig) FindListener(name string) *ListenerConfig
func (*NodeConfig) Free ¶
func (N *NodeConfig) Free()
func (*NodeConfig) RemoveListener ¶
func (N *NodeConfig) RemoveListener(s string)
func (*NodeConfig) Update ¶
func (N *NodeConfig) Update()
type OutlierConfig ¶
type OutlierConfig struct {
ConsecutiveErrors int
ConsecutiveGwErrors int
Interval time.Duration
EjectionTime time.Duration
EjectionPercent int
MinimumHosts int
MinimumRequests int
}
func (*OutlierConfig) ToEnvoy ¶
func (O *OutlierConfig) ToEnvoy() *cluster.OutlierDetection
type ProPsyCache ¶
type ProPsyCache struct {
MutexEndpoints sync.Mutex
LatestPPSAdded time.Time
// contains filtered or unexported fields
}
func NewProPsyCache ¶
func NewProPsyCache() *ProPsyCache
func (*ProPsyCache) AddTLSWatch ¶
func (P *ProPsyCache) AddTLSWatch(secretNamespace, secretName string, node *NodeConfig)
func (*ProPsyCache) Cleanup ¶
func (P *ProPsyCache) Cleanup()
func (*ProPsyCache) ClearPPS ¶
func (P *ProPsyCache) ClearPPS(ppsName string, nodes []string, canaryName string)
func (*ProPsyCache) DumpNodes ¶
func (P *ProPsyCache) DumpNodes()
func (*ProPsyCache) GetEndpointSetByEndpoint ¶
func (P *ProPsyCache) GetEndpointSetByEndpoint(endpointName string) (*EndpointConfig, []*NodeConfig)
func (*ProPsyCache) GetNodes ¶
func (P *ProPsyCache) GetNodes() map[string]*NodeConfig
func (*ProPsyCache) GetOrCreateNode ¶
func (P *ProPsyCache) GetOrCreateNode(name string) *NodeConfig
func (*ProPsyCache) GetOrCreateTLS ¶
func (P *ProPsyCache) GetOrCreateTLS(namespace, name string) *TlsData
func (*ProPsyCache) GetTls ¶
func (P *ProPsyCache) GetTls(namespace, name string) *TlsData
func (*ProPsyCache) ProcessQueueOnce ¶
func (P *ProPsyCache) ProcessQueueOnce()
processes the whole queue one time
func (*ProPsyCache) RegisterEndpointSet ¶
func (P *ProPsyCache) RegisterEndpointSet(cfg *EndpointConfig, nodes []*NodeConfig)
func (*ProPsyCache) RemoveEndpointSet ¶
func (P *ProPsyCache) RemoveEndpointSet(s string, nodes []*NodeConfig)
func (*ProPsyCache) RemoveTLSWatch ¶
func (P *ProPsyCache) RemoveTLSWatch(secretNamespace, secretName string, node *NodeConfig)
func (*ProPsyCache) Run ¶
func (P *ProPsyCache) Run()
type PropsyCallbacks ¶
type PropsyCallbacks struct {
// contains filtered or unexported fields
}
func (PropsyCallbacks) OnFetchRequest ¶
func (P PropsyCallbacks) OnFetchRequest(ctx context.Context, dr *api.DiscoveryRequest) error
func (PropsyCallbacks) OnFetchResponse ¶
func (PropsyCallbacks) OnFetchResponse(*api.DiscoveryRequest, *api.DiscoveryResponse)
func (PropsyCallbacks) OnStreamClosed ¶
func (PropsyCallbacks) OnStreamClosed(int64)
func (PropsyCallbacks) OnStreamOpen ¶
func (PropsyCallbacks) OnStreamRequest ¶
func (P PropsyCallbacks) OnStreamRequest(streamid int64, dr *api.DiscoveryRequest) error
func (PropsyCallbacks) OnStreamResponse ¶
func (PropsyCallbacks) OnStreamResponse(int64, *api.DiscoveryRequest, *api.DiscoveryResponse)
type RouteConfig ¶
type RouteConfig struct {
Name string
Clusters []*ClusterConfig
PathPrefix string
PrefixRewrite string
Timeout time.Duration
}
func (*RouteConfig) AddCluster ¶
func (R *RouteConfig) AddCluster(c *ClusterConfig)
func (*RouteConfig) AddClusters ¶
func (R *RouteConfig) AddClusters(configs []*ClusterConfig)
func (*RouteConfig) CalculateWeights ¶
func (R *RouteConfig) CalculateWeights() ( totalWeight, localZoneWeight, otherZonesWeight, canariesWeight, connectTimeout, maxRequests int)
func (*RouteConfig) FindCluster ¶
func (R *RouteConfig) FindCluster(name string) *ClusterConfig
func (*RouteConfig) Free ¶
func (R *RouteConfig) Free()
func (*RouteConfig) GeneratePrioritizedEndpoints ¶
func (R *RouteConfig) GeneratePrioritizedEndpoints(localZone string) ClusterLoadAssignment
func (*RouteConfig) GenerateUniqueRouteName ¶
func (R *RouteConfig) GenerateUniqueRouteName() string
func (*RouteConfig) GetLocalBestCluster ¶
func (R *RouteConfig) GetLocalBestCluster(canary bool) *ClusterConfig
func (*RouteConfig) RemoveCluster ¶
func (R *RouteConfig) RemoveCluster(name string)
func (*RouteConfig) String ¶
func (R *RouteConfig) String() string
func (*RouteConfig) ToEnvoy ¶
func (R *RouteConfig) ToEnvoy(routedClusters []*route.WeightedCluster_ClusterWeight) *route.Route
type VirtualHost ¶
type VirtualHost struct {
Name string
Domains []string
Routes []*RouteConfig
}
func (*VirtualHost) AddRoute ¶
func (V *VirtualHost) AddRoute(r *RouteConfig)
func (*VirtualHost) AddRoutes ¶
func (V *VirtualHost) AddRoutes(configs []*RouteConfig)
func (*VirtualHost) FindRoute ¶
func (V *VirtualHost) FindRoute(name string) *RouteConfig
func (*VirtualHost) Free ¶
func (V *VirtualHost) Free()
func (*VirtualHost) RemoveRoute ¶
func (V *VirtualHost) RemoveRoute(name string)
func (*VirtualHost) SafeRemoveRoute ¶
func (V *VirtualHost) SafeRemoveRoute(route string, clusterName string)
func (*VirtualHost) String ¶
func (V *VirtualHost) String() string
func (*VirtualHost) ToEnvoy ¶
func (V *VirtualHost) ToEnvoy(routes []*route.Route) *route.VirtualHost
Click to show internal directories.
Click to hide internal directories.