Documentation ¶
Index ¶
- func FilterStageComparison(a, b FilterStage) int
- func StagedFilterListContainsName(filters StagedHttpFilterList, filterName string) bool
- type EndpointPlugin
- type FilterStage
- type HttpConnectionManagerPlugin
- type HttpFilterPlugin
- type InitParams
- type ListenerPlugin
- type Params
- type Plugin
- type PluginRegistry
- type ResourceGeneratorPlugin
- type RouteActionParams
- type RouteActionPlugin
- type RouteParams
- type RoutePlugin
- type StagedHttpFilter
- type StagedHttpFilterList
- type StagedNetworkFilter
- type StagedNetworkFilterList
- type TcpFilterChainPlugin
- type Upgradable
- type UpstreamPlugin
- type VirtualHostParams
- type VirtualHostPlugin
- type WeightedDestinationPlugin
- type WellKnownFilterStage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterStageComparison ¶ added in v0.18.27
func FilterStageComparison(a, b FilterStage) int
FilterStageComparison helps implement the sort.Interface Less function for use in other implementations of sort.Interface returns -1 if less than, 0 if equal, 1 if greater than It is not sufficient to return a Less bool because calling functions need to know if equal or greater when Less is false
func StagedFilterListContainsName ¶ added in v1.8.0
func StagedFilterListContainsName(filters StagedHttpFilterList, filterName string) bool
Types ¶
type EndpointPlugin ¶ added in v1.4.0
type EndpointPlugin interface { Plugin ProcessEndpoints(params Params, in *v1.Upstream, out *envoy_config_endpoint_v3.ClusterLoadAssignment) error }
Endpoint is called after the envoy ClusterLoadAssignment has been created for the input Upstream, and allows the endpoints to be edited before being sent to envoy via EDS If one wishes to also modify the corresponding envoy Cluster the above UpstreamPlugin interface should be used.
type FilterStage ¶
type FilterStage struct { RelativeTo WellKnownFilterStage Weight int }
func AfterStage ¶ added in v0.18.27
func AfterStage(wellKnown WellKnownFilterStage) FilterStage
func BeforeStage ¶ added in v0.18.27
func BeforeStage(wellKnown WellKnownFilterStage) FilterStage
func DuringStage ¶ added in v0.18.27
func DuringStage(wellKnown WellKnownFilterStage) FilterStage
func RelativeToStage ¶ added in v0.18.27
func RelativeToStage(wellKnown WellKnownFilterStage, weight int) FilterStage
type HttpConnectionManagerPlugin ¶ added in v1.9.25
type HttpConnectionManagerPlugin interface { Plugin ProcessHcmNetworkFilter(params Params, parentListener *v1.Listener, listener *v1.HttpListener, out *envoyhttp.HttpConnectionManager) error }
HttpConnectionManager Plugins
type HttpFilterPlugin ¶
type HttpFilterPlugin interface { Plugin HttpFilters(params Params, listener *v1.HttpListener) ([]StagedHttpFilter, error) }
type ListenerPlugin ¶
type Plugin ¶
type Plugin interface {
Init(params InitParams) error
}
type PluginRegistry ¶ added in v1.9.25
type PluginRegistry interface { GetPlugins() []Plugin GetListenerPlugins() []ListenerPlugin GetTcpFilterChainPlugins() []TcpFilterChainPlugin GetHttpFilterPlugins() []HttpFilterPlugin GetHttpConnectionManagerPlugins() []HttpConnectionManagerPlugin }
A PluginRegistry is used to provide Plugins to relevant translators Historically, all plugins were passed around as an argument, and each translator would iterate over all plugins, and only apply the relevant ones. This interface enables translators to only know of the relevant plugins NOTE:
This is not complete. As translators are modified, we can gradually expose more methods on a PluginRegistry
type ResourceGeneratorPlugin ¶ added in v1.6.10
type ResourceGeneratorPlugin interface { Plugin GeneratedResources(params Params, inClusters []*envoy_config_cluster_v3.Cluster, inEndpoints []*envoy_config_endpoint_v3.ClusterLoadAssignment, inRouteConfigurations []*envoy_config_route_v3.RouteConfiguration, inListeners []*envoy_config_listener_v3.Listener, ) ([]*envoy_config_cluster_v3.Cluster, []*envoy_config_endpoint_v3.ClusterLoadAssignment, []*envoy_config_route_v3.RouteConfiguration, []*envoy_config_listener_v3.Listener, error) }
Generation plugins
type RouteActionParams ¶ added in v0.18.32
type RouteActionParams struct { RouteParams Route *v1.Route }
type RouteActionPlugin ¶
type RouteActionPlugin interface { Plugin ProcessRouteAction(params RouteActionParams, inAction *v1.RouteAction, out *envoy_config_route_v3.RouteAction) error }
note: any route action plugin can be implemented as a route plugin suggestion: if your plugin requires configuration from a RoutePlugin field, implement the RoutePlugin interface
type RouteParams ¶ added in v0.14.0
type RouteParams struct { VirtualHostParams VirtualHost *v1.VirtualHost }
type RoutePlugin ¶
type RoutePlugin interface { Plugin ProcessRoute(params RouteParams, in *v1.Route, out *envoy_config_route_v3.Route) error }
type StagedHttpFilter ¶
type StagedHttpFilter struct { HttpFilter *envoyhttp.HttpFilter Stage FilterStage }
func NewStagedFilter ¶ added in v0.11.1
func NewStagedFilter(name string, stage FilterStage) StagedHttpFilter
func NewStagedFilterWithConfig ¶ added in v0.11.1
func NewStagedFilterWithConfig(name string, config proto.Message, stage FilterStage) (StagedHttpFilter, error)
type StagedHttpFilterList ¶ added in v0.18.27
type StagedHttpFilterList []StagedHttpFilter
func (StagedHttpFilterList) Len ¶ added in v0.18.27
func (s StagedHttpFilterList) Len() int
func (StagedHttpFilterList) Less ¶ added in v0.18.27
func (s StagedHttpFilterList) Less(i, j int) bool
filters by Relative Stage, Weighting, Name, Config Type-Url, Config Value, and (to ensure stability) index. The assumption is that if two filters are in the same stage, their order doesn't matter, and we just need to make sure it is stable.
func (StagedHttpFilterList) Swap ¶ added in v0.18.27
func (s StagedHttpFilterList) Swap(i, j int)
type StagedNetworkFilter ¶ added in v1.9.25
type StagedNetworkFilter struct { NetworkFilter *envoy_config_listener_v3.Filter Stage FilterStage }
type StagedNetworkFilterList ¶ added in v1.9.25
type StagedNetworkFilterList []StagedNetworkFilter
func (StagedNetworkFilterList) Len ¶ added in v1.9.25
func (s StagedNetworkFilterList) Len() int
func (StagedNetworkFilterList) Less ¶ added in v1.9.25
func (s StagedNetworkFilterList) Less(i, j int) bool
filters by Relative Stage, Weighting, Name, and (to ensure stability) index
func (StagedNetworkFilterList) Swap ¶ added in v1.9.25
func (s StagedNetworkFilterList) Swap(i, j int)
type TcpFilterChainPlugin ¶ added in v1.9.25
type TcpFilterChainPlugin interface { Plugin CreateTcpFilterChains(params Params, parentListener *v1.Listener, in *v1.TcpListener) ([]*envoy_config_listener_v3.FilterChain, error) }
type Upgradable ¶ added in v1.6.0
Upgradable plugins are those which can be replaced by another version with enhanced functionality. Identified by PluginName().
type UpstreamPlugin ¶
type UpstreamPlugin interface { Plugin ProcessUpstream(params Params, in *v1.Upstream, out *envoy_config_cluster_v3.Cluster) error }
UpstreamPlugin is called after the envoy Cluster has been created for the input Upstream, and allows the cluster to be edited before being sent to envoy via CDS
type VirtualHostParams ¶ added in v0.15.0
type VirtualHostPlugin ¶
type VirtualHostPlugin interface { Plugin ProcessVirtualHost(params VirtualHostParams, in *v1.VirtualHost, out *envoy_config_route_v3.VirtualHost) error }
type WeightedDestinationPlugin ¶ added in v0.18.7
type WeightedDestinationPlugin interface { Plugin ProcessWeightedDestination( params RouteParams, in *v1.WeightedDestination, out *envoy_config_route_v3.WeightedCluster_ClusterWeight, ) error }
type WellKnownFilterStage ¶ added in v0.18.27
type WellKnownFilterStage int
WellKnownFilterStages are represented by an integer that reflects their relative ordering
const ( FaultStage WellKnownFilterStage = iota // Fault injection // First Filter Stage CorsStage // Cors stage WafStage // Web application firewall stage AuthNStage // Authentication stage AuthZStage // Authorization stage RateLimitStage // Rate limiting stage AcceptedStage // Request passed all the checks and will be forwarded upstream OutAuthStage // Add auth for the upstream (i.e. aws λ) RouteStage // Request is going to upstream // Last Filter Stage )
If new well known filter stages are added, they should be inserted in a position corresponding to their order
Directories ¶
Path | Synopsis |
---|---|
mocks
Package mock_consul is a generated GoMock package.
|
Package mock_consul is a generated GoMock package. |
internal
|
|
mocks
Package mock_kubernetes is a generated GoMock package.
|
Package mock_kubernetes is a generated GoMock package. |
mocks
Package mock_cache is a generated GoMock package.
|
Package mock_cache is a generated GoMock package. |