virtualhosts

package
v0.0.0-...-5d88859 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedirectConfigurer

type RedirectConfigurer struct {
	MatchPath    string
	NewPath      string
	Port         uint32
	AllowGetOnly bool
}

func (RedirectConfigurer) Configure

func (c RedirectConfigurer) Configure(virtualHost *envoy_config_route_v3.VirtualHost) error

type RoutesConfigurer

type RoutesConfigurer struct {
	Routes envoy_common.Routes
}

func (RoutesConfigurer) Configure

func (c RoutesConfigurer) Configure(virtualHost *envoy_config_route_v3.VirtualHost) error

type VirtualHostBuilder

type VirtualHostBuilder struct {
	// contains filtered or unexported fields
}

VirtualHostBuilder is responsible for generating an Envoy VirtualHost by applying a series of VirtualHostConfigurers.

func NewVirtualHostBuilder

func NewVirtualHostBuilder(apiVersion core_xds.APIVersion, name string) *VirtualHostBuilder

func (*VirtualHostBuilder) AddConfigurer

func (b *VirtualHostBuilder) AddConfigurer(configurer VirtualHostConfigurer)

AddConfigurer appends a given VirtualHostConfigurer to the end of the chain.

func (*VirtualHostBuilder) Build

Build generates an Envoy VirtualHost by applying a series of VirtualHostConfigurers.

func (*VirtualHostBuilder) Configure

Configure configures VirtualHostBuilder by adding individual VirtualHostConfigurers.

type VirtualHostBuilderOpt

type VirtualHostBuilderOpt interface {
	// ApplyTo adds VirtualHostConfigurer(s) to the VirtualHostBuilder.
	ApplyTo(builder *VirtualHostBuilder)
}

VirtualHostBuilderOpt is a configuration option for VirtualHostBuilder.

The goal of VirtualHostBuilderOpt is to facilitate fluent VirtualHostBuilder API.

func AddVirtualHostConfigurer

func AddVirtualHostConfigurer(c VirtualHostConfigurer) VirtualHostBuilderOpt

AddVirtualHostConfigurer production an option that adds the given configurer to the virtual host builder.

func DomainNames

func DomainNames(domainNames ...string) VirtualHostBuilderOpt

func Redirect

func Redirect(matchPath, newPath string, allowGetOnly bool, port uint32) VirtualHostBuilderOpt

Redirect for paths that match to matchPath returns 301 status code with new port and path

func RequireTLS

func RequireTLS() VirtualHostBuilderOpt

RequireTLS specifies that this virtual host must only accept TLS connections.

func Route

func Route(matchPath, newPath, cluster string, allowGetOnly bool) VirtualHostBuilderOpt

func SetResponseHeader

func SetResponseHeader(name string, value string) VirtualHostBuilderOpt

SetResponseHeader unconditionally sets the named response header to the given value.

type VirtualHostBuilderOptFunc

type VirtualHostBuilderOptFunc func(builder *VirtualHostBuilder)

VirtualHostBuilderOptFunc is a convenience type adapter.

func (VirtualHostBuilderOptFunc) ApplyTo

func (f VirtualHostBuilderOptFunc) ApplyTo(builder *VirtualHostBuilder)

type VirtualHostConfigureFunc

type VirtualHostConfigureFunc func(vh *envoy_config_route_v3.VirtualHost) error

VirtualHostConfigureFunc adapts a configuration function to the VirtualHostConfigurer interface.

func (VirtualHostConfigureFunc) Configure

type VirtualHostConfigurer

type VirtualHostConfigurer interface {
	// Configure configures a single aspect on a given Envoy VirtualHost.
	Configure(virtualHost *envoy_config_route_v3.VirtualHost) error
}

VirtualHostConfigurer is responsible for configuring a single aspect of the entire Envoy VirtualHost, such as Route, CORS, etc.

type VirtualHostMustConfigureFunc

type VirtualHostMustConfigureFunc func(vh *envoy_config_route_v3.VirtualHost)

VirtualHostMustConfigureFunc adapts a configuration function that never fails to the VirtualHostConfigurer interface.

func (VirtualHostMustConfigureFunc) Configure

type VirtualHostRouteConfigurer

type VirtualHostRouteConfigurer struct {
	MatchPath    string
	NewPath      string
	Cluster      string
	AllowGetOnly bool
}

func (VirtualHostRouteConfigurer) Configure

Jump to

Keyboard shortcuts

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