Documentation ¶
Index ¶
- func RouteAppendHeader(name string, value string) *envoy_config_core_v3.HeaderValueOption
- func RouteReplaceHeader(name string, value string) *envoy_config_core_v3.HeaderValueOption
- func VirtualHostRoute(route *RouteBuilder) envoy_virtual_hosts.VirtualHostBuilderOpt
- type CommonRouteConfigurationConfigurer
- type RouteBuilder
- type RouteConfigurationBuilder
- type RouteConfigurationBuilderOpt
- func AddRouteConfigurationConfigurer(c v3.RouteConfigurationConfigurer) RouteConfigurationBuilderOpt
- func CommonRouteConfiguration() RouteConfigurationBuilderOpt
- func IgnorePortInHostMatching() RouteConfigurationBuilderOpt
- func ResetTagsHeader() RouteConfigurationBuilderOpt
- func TagsHeader(tags mesh_proto.MultiValueTagSet) RouteConfigurationBuilderOpt
- func VirtualHost(builder *envoy_virtual_hosts.VirtualHostBuilder) RouteConfigurationBuilderOpt
- type RouteConfigurationBuilderOptFunc
- type RouteConfigureFunc
- type RouteConfigurer
- func RouteActionDirectResponse(status uint32, respStr string) RouteConfigurer
- func RouteActionIdleTimeout(timeout time.Duration) RouteConfigurer
- func RouteActionRequestTimeout(timeout time.Duration) RouteConfigurer
- func RouteAddRequestHeader(option *envoy_config_core_v3.HeaderValueOption) RouteConfigurer
- func RouteAddResponseHeader(option *envoy_config_core_v3.HeaderValueOption) RouteConfigurer
- func RouteDeleteRequestHeader(name string) RouteConfigurer
- func RouteDeleteResponseHeader(name string) RouteConfigurer
- func RouteMatchExactHeader(name string, value string) RouteConfigurer
- func RouteMatchExactPath(path string) RouteConfigurer
- func RouteMatchExactQuery(name string, value string) RouteConfigurer
- func RouteMatchPrefixHeader(name string, match string) RouteConfigurer
- func RouteMatchPrefixPath(prefix string) RouteConfigurer
- func RouteMatchPresentHeader(name string, presentMatch bool) RouteConfigurer
- func RouteMatchRegexHeader(name string, regex string) RouteConfigurer
- func RouteMatchRegexPath(regex string) RouteConfigurer
- func RouteMatchRegexQuery(name string, regex string) RouteConfigurer
- func RoutePerFilterConfig(filterName string, filterConfig *anypb.Any) RouteConfigurer
- func RouteReplaceHostHeader(host string) RouteConfigurer
- func RouteSetRewriteHostToBackendHostname(value bool) RouteConfigurer
- type RouteMustConfigureFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RouteAppendHeader ¶
func RouteAppendHeader(name string, value string) *envoy_config_core_v3.HeaderValueOption
func RouteReplaceHeader ¶
func RouteReplaceHeader(name string, value string) *envoy_config_core_v3.HeaderValueOption
func VirtualHostRoute ¶
func VirtualHostRoute(route *RouteBuilder) envoy_virtual_hosts.VirtualHostBuilderOpt
VirtualHostRoute creates an option to add the route builder to a virtual host. On execution, the builder will build the route and append it to the virtual host. Since Envoy evaluates route matches in order, route builders should be configured on virtual hosts in the intended match order.
Types ¶
type CommonRouteConfigurationConfigurer ¶
type CommonRouteConfigurationConfigurer struct{}
func (CommonRouteConfigurationConfigurer) Configure ¶
func (c CommonRouteConfigurationConfigurer) Configure(routeConfiguration *envoy_config_route_v3.RouteConfiguration) error
type RouteBuilder ¶
type RouteBuilder struct {
// contains filtered or unexported fields
}
func NewRouteBuilder ¶
func NewRouteBuilder(apiVersion core_xds.APIVersion, name string) *RouteBuilder
func (*RouteBuilder) Build ¶
func (r *RouteBuilder) Build() (envoy.NamedResource, error)
func (*RouteBuilder) Configure ¶
func (r *RouteBuilder) Configure(opts ...RouteConfigurer) *RouteBuilder
type RouteConfigurationBuilder ¶
type RouteConfigurationBuilder struct {
// contains filtered or unexported fields
}
RouteConfigurationBuilder is responsible for generating an Envoy RouteConfiguration by applying a series of RouteConfigurationConfigurers.
func NewRouteConfigurationBuilder ¶
func NewRouteConfigurationBuilder(apiVersion core_xds.APIVersion, name string) *RouteConfigurationBuilder
func (*RouteConfigurationBuilder) AddConfigurer ¶
func (b *RouteConfigurationBuilder) AddConfigurer(configurer v3.RouteConfigurationConfigurer)
AddConfigurer appends a given RouteConfigurationConfigurer to the end of the chain.
func (*RouteConfigurationBuilder) Build ¶
func (b *RouteConfigurationBuilder) Build() (envoy.NamedResource, error)
Build generates an Envoy RouteConfiguration by applying a series of RouteConfigurationConfigurers.
func (*RouteConfigurationBuilder) Configure ¶
func (b *RouteConfigurationBuilder) Configure(opts ...RouteConfigurationBuilderOpt) *RouteConfigurationBuilder
Configure configures RouteConfigurationBuilder by adding individual RouteConfigurationConfigurers.
type RouteConfigurationBuilderOpt ¶
type RouteConfigurationBuilderOpt interface { // ApplyTo adds RouteConfigurationConfigurer(s) to the RouteConfigurationBuilder. ApplyTo(builder *RouteConfigurationBuilder) }
RouteConfigurationBuilderOpt is a configuration option for RouteConfigurationBuilder.
The goal of RouteConfigurationBuilderOpt is to facilitate fluent RouteConfigurationBuilder API.
func AddRouteConfigurationConfigurer ¶
func AddRouteConfigurationConfigurer(c v3.RouteConfigurationConfigurer) RouteConfigurationBuilderOpt
AddRouteConfigurationConfigurer produces an option that adds the given configurer to the route configuration builder.
func CommonRouteConfiguration ¶
func CommonRouteConfiguration() RouteConfigurationBuilderOpt
func IgnorePortInHostMatching ¶
func IgnorePortInHostMatching() RouteConfigurationBuilderOpt
func ResetTagsHeader ¶
func ResetTagsHeader() RouteConfigurationBuilderOpt
ResetTagsHeader adds x-dubbo-tags header to the RequestHeadersToRemove list. x-dubbo-tags header is planned to be used internally, so we don't want to expose it to the destination application.
func TagsHeader ¶
func TagsHeader(tags mesh_proto.MultiValueTagSet) RouteConfigurationBuilderOpt
func VirtualHost ¶
func VirtualHost(builder *envoy_virtual_hosts.VirtualHostBuilder) RouteConfigurationBuilderOpt
type RouteConfigurationBuilderOptFunc ¶
type RouteConfigurationBuilderOptFunc func(builder *RouteConfigurationBuilder)
RouteConfigurationBuilderOptFunc is a convenience type adapter.
func (RouteConfigurationBuilderOptFunc) ApplyTo ¶
func (f RouteConfigurationBuilderOptFunc) ApplyTo(builder *RouteConfigurationBuilder)
type RouteConfigureFunc ¶
type RouteConfigureFunc func(*envoy_config_route_v3.Route) error
func (RouteConfigureFunc) Configure ¶
func (f RouteConfigureFunc) Configure(r *envoy_config_route_v3.Route) error
type RouteConfigurer ¶
type RouteConfigurer interface {
Configure(*envoy_config_route_v3.Route) error
}
func RouteActionDirectResponse ¶
func RouteActionDirectResponse(status uint32, respStr string) RouteConfigurer
RouteActionDirectResponse sets the direct response for a route
func RouteActionIdleTimeout ¶
func RouteActionIdleTimeout(timeout time.Duration) RouteConfigurer
func RouteActionRequestTimeout ¶
func RouteActionRequestTimeout(timeout time.Duration) RouteConfigurer
RouteActionRequestTimeout sets the total timeout for an upstream request.
func RouteAddRequestHeader ¶
func RouteAddRequestHeader(option *envoy_config_core_v3.HeaderValueOption) RouteConfigurer
RouteAddRequestHeader alters the given request header value.
func RouteAddResponseHeader ¶
func RouteAddResponseHeader(option *envoy_config_core_v3.HeaderValueOption) RouteConfigurer
RouteAddResponseHeader alters the given response header value.
func RouteDeleteRequestHeader ¶
func RouteDeleteRequestHeader(name string) RouteConfigurer
RouteDeleteRequestHeader deletes the given header from the HTTP request.
func RouteDeleteResponseHeader ¶
func RouteDeleteResponseHeader(name string) RouteConfigurer
RouteDeleteResponseHeader deletes the given header from the HTTP response.
func RouteMatchExactHeader ¶
func RouteMatchExactHeader(name string, value string) RouteConfigurer
RouteMatchExactHeader appends an exact match for the value of the named HTTP request header.
func RouteMatchExactPath ¶
func RouteMatchExactPath(path string) RouteConfigurer
RouteMatchExactPath updates the route to match the exact path. This replaces any previous path match specification.
func RouteMatchExactQuery ¶
func RouteMatchExactQuery(name string, value string) RouteConfigurer
RouteMatchExactQuery appends an exact match for the value of the named query parameter.
func RouteMatchPrefixHeader ¶
func RouteMatchPrefixHeader(name string, match string) RouteConfigurer
RouteMatchPrefixHeader appends a prefix match for the names HTTP request header
func RouteMatchPrefixPath ¶
func RouteMatchPrefixPath(prefix string) RouteConfigurer
RouteMatchPrefixPath updates the route to match the given path prefix. This is a byte-wise prefix, so it just checks that the request path begins with the given string. This replaces any previous path match specification.
func RouteMatchPresentHeader ¶
func RouteMatchPresentHeader(name string, presentMatch bool) RouteConfigurer
RouteMatchPresentHeader appends a present match for the names HTTP request header (presentMatch makes absent)
func RouteMatchRegexHeader ¶
func RouteMatchRegexHeader(name string, regex string) RouteConfigurer
RouteMatchRegexHeader appends a regex match for the value of the named HTTP request header.
func RouteMatchRegexPath ¶
func RouteMatchRegexPath(regex string) RouteConfigurer
RouteMatchRegexPath updates the route to match the path using the given regex. This replaces any previous path match specification.
func RouteMatchRegexQuery ¶
func RouteMatchRegexQuery(name string, regex string) RouteConfigurer
RouteMatchRegexQuery appends a regex match for the value of the named query parameter.
func RoutePerFilterConfig ¶
func RoutePerFilterConfig(filterName string, filterConfig *anypb.Any) RouteConfigurer
RoutePerFilterConfig sets an optional per-filter configuration message for this route. filterName is the name of the filter that should receive the configuration that is specified in filterConfig
func RouteReplaceHostHeader ¶
func RouteReplaceHostHeader(host string) RouteConfigurer
RouteReplaceHostHeader replaces the Host header on the forwarded request. It is an error to rewrite the header if the route is not forwarding. The route action must be configured beforehand.
func RouteSetRewriteHostToBackendHostname ¶
func RouteSetRewriteHostToBackendHostname(value bool) RouteConfigurer
type RouteMustConfigureFunc ¶
type RouteMustConfigureFunc func(*envoy_config_route_v3.Route)
func (RouteMustConfigureFunc) Configure ¶
func (f RouteMustConfigureFunc) Configure(r *envoy_config_route_v3.Route) error