Documentation ¶
Index ¶
- type RedirectConfigurer
- type RoutesConfigurer
- type VirtualHostBuilder
- type VirtualHostBuilderOpt
- func AddVirtualHostConfigurer(c VirtualHostConfigurer) VirtualHostBuilderOpt
- func DomainNames(domainNames ...string) VirtualHostBuilderOpt
- func Redirect(matchPath, newPath string, allowGetOnly bool, port uint32) VirtualHostBuilderOpt
- func RequireTLS() VirtualHostBuilderOpt
- func Route(matchPath, newPath, cluster string, allowGetOnly bool) VirtualHostBuilderOpt
- func Routes(routes envoy_common.Routes) VirtualHostBuilderOpt
- func SetResponseHeader(name string, value string) VirtualHostBuilderOpt
- type VirtualHostBuilderOptFunc
- type VirtualHostConfigureFunc
- type VirtualHostConfigurer
- type VirtualHostMustConfigureFunc
- type VirtualHostRouteConfigurer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedirectConfigurer ¶
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 ¶
func (b *VirtualHostBuilder) Build() (envoy.NamedResource, error)
Build generates an Envoy VirtualHost by applying a series of VirtualHostConfigurers.
func (*VirtualHostBuilder) Configure ¶
func (b *VirtualHostBuilder) Configure(opts ...VirtualHostBuilderOpt) *VirtualHostBuilder
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 Routes ¶
func Routes(routes envoy_common.Routes) 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 ¶
func (f VirtualHostConfigureFunc) Configure(vh *envoy_config_route_v3.VirtualHost) error
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 ¶
func (f VirtualHostMustConfigureFunc) Configure(vh *envoy_config_route_v3.VirtualHost) error
type VirtualHostRouteConfigurer ¶
type VirtualHostRouteConfigurer struct { MatchPath string NewPath string Cluster string AllowGetOnly bool }
func (VirtualHostRouteConfigurer) Configure ¶
func (c VirtualHostRouteConfigurer) Configure(virtualHost *envoy_config_route_v3.VirtualHost) error