routes

package
v0.0.0-...-8aa1e91 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

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

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

Build generates an Envoy RouteConfiguration by applying a series of RouteConfigurationConfigurers.

func (*RouteConfigurationBuilder) Configure

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.

type RouteConfigurationBuilderOptFunc

type RouteConfigurationBuilderOptFunc func(builder *RouteConfigurationBuilder)

RouteConfigurationBuilderOptFunc is a convenience type adapter.

func (RouteConfigurationBuilderOptFunc) ApplyTo

type RouteConfigureFunc

type RouteConfigureFunc func(*envoy_config_route_v3.Route) error

func (RouteConfigureFunc) Configure

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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