routing

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package routing is a generated protocol buffer package.

It is generated from these files:

route_extensions.proto

It has these top-level messages:

RouteExtensions
HeaderValue
CorsPolicy

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRouteExtensionSpec

func EncodeRouteExtensionSpec(spec *RouteExtensions) *types.Struct

Types

type CorsPolicy

type CorsPolicy struct {
	// Specifies the origins that will be allowed to do CORS requests.
	//
	// An origin is allowed if either allow_origin matches.
	AllowOrigin []string `protobuf:"bytes,1,rep,name=allow_origin,json=allowOrigin" json:"allow_origin,omitempty"`
	// Specifies the content for the *access-control-allow-methods* header.
	AllowMethods string `protobuf:"bytes,2,opt,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"`
	// Specifies the content for the *access-control-allow-headers* header.
	AllowHeaders string `protobuf:"bytes,3,opt,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"`
	// Specifies the content for the *access-control-expose-headers* header.
	ExposeHeaders string `protobuf:"bytes,4,opt,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"`
	// Specifies the content for the *access-control-max-age* header.
	MaxAge *time.Duration `protobuf:"bytes,5,opt,name=max_age,json=maxAge,stdduration" json:"max_age,omitempty"`
	// Specifies whether the resource allows credentials.
	AllowCredentials bool `protobuf:"varint,6,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"`
}

Configuration for Cross-Origin Resource Sharing requests

func (*CorsPolicy) Descriptor

func (*CorsPolicy) Descriptor() ([]byte, []int)

func (*CorsPolicy) Equal

func (this *CorsPolicy) Equal(that interface{}) bool

func (*CorsPolicy) GetAllowCredentials

func (m *CorsPolicy) GetAllowCredentials() bool

func (*CorsPolicy) GetAllowHeaders

func (m *CorsPolicy) GetAllowHeaders() string

func (*CorsPolicy) GetAllowMethods

func (m *CorsPolicy) GetAllowMethods() string

func (*CorsPolicy) GetAllowOrigin

func (m *CorsPolicy) GetAllowOrigin() []string

func (*CorsPolicy) GetExposeHeaders

func (m *CorsPolicy) GetExposeHeaders() string

func (*CorsPolicy) GetMaxAge

func (m *CorsPolicy) GetMaxAge() *time.Duration

func (*CorsPolicy) ProtoMessage

func (*CorsPolicy) ProtoMessage()

func (*CorsPolicy) Reset

func (m *CorsPolicy) Reset()

func (*CorsPolicy) String

func (m *CorsPolicy) String() string

type HeaderValue

type HeaderValue struct {
	// Header name
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Header value
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Should this value be appended?
	Append bool `protobuf:"varint,3,opt,name=append,proto3" json:"append,omitempty"`
}

Header name/value pair

func (*HeaderValue) Descriptor

func (*HeaderValue) Descriptor() ([]byte, []int)

func (*HeaderValue) Equal

func (this *HeaderValue) Equal(that interface{}) bool

func (*HeaderValue) GetAppend

func (m *HeaderValue) GetAppend() bool

func (*HeaderValue) GetKey

func (m *HeaderValue) GetKey() string

func (*HeaderValue) GetValue

func (m *HeaderValue) GetValue() string

func (*HeaderValue) ProtoMessage

func (*HeaderValue) ProtoMessage()

func (*HeaderValue) Reset

func (m *HeaderValue) Reset()

func (*HeaderValue) String

func (m *HeaderValue) String() string

type Plugin

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

func (*Plugin) HttpFilters

func (p *Plugin) HttpFilters(params *plugins.HttpFilterPluginParams) []plugins.StagedHttpFilter

func (*Plugin) Init added in v0.4.2

func (p *Plugin) Init(options bootstrap.Options) error

func (*Plugin) ProcessRoute

func (p *Plugin) ProcessRoute(_ *plugins.RoutePluginParams, in *v1.Route, out *envoyroute.Route) error

type RouteExtensions

type RouteExtensions struct {
	// These headers will be added to the request before it is sent to the upstream
	AddRequestHeaders []*HeaderValue `protobuf:"bytes,1,rep,name=add_request_headers,json=addRequestHeaders" json:"add_request_headers,omitempty"`
	// These headers will be added to the response before it is returned to the downstream
	AddResponseHeaders []*HeaderValue `protobuf:"bytes,2,rep,name=add_response_headers,json=addResponseHeaders" json:"add_response_headers,omitempty"`
	// These headers will be removed from the request before it is sent to the upstream
	RemoveResponseHeaders []string `protobuf:"bytes,3,rep,name=remove_response_headers,json=removeResponseHeaders" json:"remove_response_headers,omitempty"`
	// The maximum number of retries to attempt for requests that get a 5xx response
	MaxRetries uint32 `protobuf:"varint,4,opt,name=max_retries,json=maxRetries,proto3" json:"max_retries,omitempty"`
	// If set, time out requests on this route. If not set, this will default to the connection timeout on the upstream
	Timeout *time.Duration `protobuf:"bytes,5,opt,name=timeout,stdduration" json:"timeout,omitempty"`
	// Rewrite the host header of the request to this value, if set
	HostRewrite string `protobuf:"bytes,6,opt,name=host_rewrite,json=hostRewrite,proto3" json:"host_rewrite,omitempty"`
	// Configure Cross-Origin Resource Sharing requests
	Cors *CorsPolicy `protobuf:"bytes,7,opt,name=cors" json:"cors,omitempty"`
}

RouteExtensions should be placed in the route.extensions field RouteExtensions extend the behavior of a regular route in gloo (within a virtual service)

func DecodeRouteExtensions

func DecodeRouteExtensions(generic *types.Struct) (*RouteExtensions, error)

func (*RouteExtensions) Descriptor

func (*RouteExtensions) Descriptor() ([]byte, []int)

func (*RouteExtensions) Equal

func (this *RouteExtensions) Equal(that interface{}) bool

func (*RouteExtensions) GetAddRequestHeaders

func (m *RouteExtensions) GetAddRequestHeaders() []*HeaderValue

func (*RouteExtensions) GetAddResponseHeaders

func (m *RouteExtensions) GetAddResponseHeaders() []*HeaderValue

func (*RouteExtensions) GetCors

func (m *RouteExtensions) GetCors() *CorsPolicy

func (*RouteExtensions) GetHostRewrite

func (m *RouteExtensions) GetHostRewrite() string

func (*RouteExtensions) GetMaxRetries

func (m *RouteExtensions) GetMaxRetries() uint32

func (*RouteExtensions) GetRemoveResponseHeaders

func (m *RouteExtensions) GetRemoveResponseHeaders() []string

func (*RouteExtensions) GetTimeout

func (m *RouteExtensions) GetTimeout() *time.Duration

func (*RouteExtensions) ProtoMessage

func (*RouteExtensions) ProtoMessage()

func (*RouteExtensions) Reset

func (m *RouteExtensions) Reset()

func (*RouteExtensions) String

func (m *RouteExtensions) String() string

Jump to

Keyboard shortcuts

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