matchers

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderMatcher

type HeaderMatcher struct {
	// Specifies the name of the header in the request.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Specifies the value of the header. If the value is absent a request that
	// has the name header will match, regardless of the header’s value.
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Specifies whether the header value should be treated as regex or not.
	Regex bool `protobuf:"varint,3,opt,name=regex,proto3" json:"regex,omitempty"`
	// If set to true, the result of the match will be inverted. Defaults to false.
	//
	// Examples:
	// * name=foo, invert_match=true: matches if no header named `foo` is present
	// * name=foo, value=bar, invert_match=true: matches if no header named `foo` with value `bar` is present
	// * name=foo, value=“\d{3}“, regex=true, invert_match=true: matches if no header named `foo` with a value consisting of three integers is present
	InvertMatch          bool     `protobuf:"varint,4,opt,name=invert_match,json=invertMatch,proto3" json:"invert_match,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Internally, Gloo always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.

func (*HeaderMatcher) Descriptor

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

func (*HeaderMatcher) Equal

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

func (*HeaderMatcher) GetInvertMatch

func (m *HeaderMatcher) GetInvertMatch() bool

func (*HeaderMatcher) GetName

func (m *HeaderMatcher) GetName() string

func (*HeaderMatcher) GetRegex

func (m *HeaderMatcher) GetRegex() bool

func (*HeaderMatcher) GetValue

func (m *HeaderMatcher) GetValue() string

func (*HeaderMatcher) Hash added in v1.2.13

func (m *HeaderMatcher) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*HeaderMatcher) ProtoMessage

func (*HeaderMatcher) ProtoMessage()

func (*HeaderMatcher) Reset

func (m *HeaderMatcher) Reset()

func (*HeaderMatcher) String

func (m *HeaderMatcher) String() string

func (*HeaderMatcher) XXX_DiscardUnknown

func (m *HeaderMatcher) XXX_DiscardUnknown()

func (*HeaderMatcher) XXX_Marshal

func (m *HeaderMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HeaderMatcher) XXX_Merge

func (m *HeaderMatcher) XXX_Merge(src proto.Message)

func (*HeaderMatcher) XXX_Size

func (m *HeaderMatcher) XXX_Size() int

func (*HeaderMatcher) XXX_Unmarshal

func (m *HeaderMatcher) XXX_Unmarshal(b []byte) error

type Matcher

type Matcher struct {
	// Types that are valid to be assigned to PathSpecifier:
	//	*Matcher_Prefix
	//	*Matcher_Exact
	//	*Matcher_Regex
	PathSpecifier isMatcher_PathSpecifier `protobuf_oneof:"path_specifier"`
	// Specifies a set of headers that the route should match on. The router will
	// check the request’s headers against all the specified headers in the route
	// config. A match will happen if all the headers in the route are present in
	// the request with the same values (or based on presence if the value field
	// is not in the config).
	Headers []*HeaderMatcher `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty"`
	// Specifies a set of URL query parameters on which the route should
	// match. The router will check the query string from the *path* header
	// against all the specified query parameters. If the number of specified
	// query parameters is nonzero, they all must match the *path* header's
	// query string for a match to occur.
	QueryParameters []*QueryParameterMatcher `protobuf:"bytes,7,rep,name=query_parameters,json=queryParameters,proto3" json:"query_parameters,omitempty"`
	// HTTP Method/Verb(s) to match on. If none specified, the matcher will ignore the HTTP Method
	Methods              []string `protobuf:"bytes,8,rep,name=methods,proto3" json:"methods,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Parameters for matching routes to requests received by a Gloo-managed proxy

func (*Matcher) Descriptor

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

func (*Matcher) Equal

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

func (*Matcher) GetExact

func (m *Matcher) GetExact() string

func (*Matcher) GetHeaders

func (m *Matcher) GetHeaders() []*HeaderMatcher

func (*Matcher) GetMethods

func (m *Matcher) GetMethods() []string

func (*Matcher) GetPathSpecifier

func (m *Matcher) GetPathSpecifier() isMatcher_PathSpecifier

func (*Matcher) GetPrefix

func (m *Matcher) GetPrefix() string

func (*Matcher) GetQueryParameters

func (m *Matcher) GetQueryParameters() []*QueryParameterMatcher

func (*Matcher) GetRegex

func (m *Matcher) GetRegex() string

func (*Matcher) Hash added in v1.2.13

func (m *Matcher) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*Matcher) ProtoMessage

func (*Matcher) ProtoMessage()

func (*Matcher) Reset

func (m *Matcher) Reset()

func (*Matcher) String

func (m *Matcher) String() string

func (*Matcher) XXX_DiscardUnknown

func (m *Matcher) XXX_DiscardUnknown()

func (*Matcher) XXX_Marshal

func (m *Matcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Matcher) XXX_Merge

func (m *Matcher) XXX_Merge(src proto.Message)

func (*Matcher) XXX_OneofWrappers

func (*Matcher) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Matcher) XXX_Size

func (m *Matcher) XXX_Size() int

func (*Matcher) XXX_Unmarshal

func (m *Matcher) XXX_Unmarshal(b []byte) error

type Matcher_Exact

type Matcher_Exact struct {
	Exact string `protobuf:"bytes,2,opt,name=exact,proto3,oneof" json:"exact,omitempty"`
}

func (*Matcher_Exact) Equal

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

type Matcher_Prefix

type Matcher_Prefix struct {
	Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"`
}

func (*Matcher_Prefix) Equal

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

type Matcher_Regex

type Matcher_Regex struct {
	Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof" json:"regex,omitempty"`
}

func (*Matcher_Regex) Equal

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

type QueryParameterMatcher

type QueryParameterMatcher struct {
	// Specifies the name of a key that must be present in the requested
	// *path*'s query string.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Specifies the value of the key. If the value is absent, a request
	// that contains the key in its query string will match, whether the
	// key appears with a value (e.g., "?debug=true") or not (e.g., "?debug")
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Specifies whether the query parameter value is a regular expression.
	// Defaults to false. The entire query parameter value (i.e., the part to
	// the right of the equals sign in "key=value") must match the regex.
	// E.g., the regex "\d+$" will match "123" but not "a123" or "123a".
	Regex                bool     `protobuf:"varint,3,opt,name=regex,proto3" json:"regex,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Query parameter matching treats the query string of a request's :path header as an ampersand-separated list of keys and/or key=value elements.

func (*QueryParameterMatcher) Descriptor

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

func (*QueryParameterMatcher) Equal

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

func (*QueryParameterMatcher) GetName

func (m *QueryParameterMatcher) GetName() string

func (*QueryParameterMatcher) GetRegex

func (m *QueryParameterMatcher) GetRegex() bool

func (*QueryParameterMatcher) GetValue

func (m *QueryParameterMatcher) GetValue() string

func (*QueryParameterMatcher) Hash added in v1.2.13

func (m *QueryParameterMatcher) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*QueryParameterMatcher) ProtoMessage

func (*QueryParameterMatcher) ProtoMessage()

func (*QueryParameterMatcher) Reset

func (m *QueryParameterMatcher) Reset()

func (*QueryParameterMatcher) String

func (m *QueryParameterMatcher) String() string

func (*QueryParameterMatcher) XXX_DiscardUnknown

func (m *QueryParameterMatcher) XXX_DiscardUnknown()

func (*QueryParameterMatcher) XXX_Marshal

func (m *QueryParameterMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParameterMatcher) XXX_Merge

func (m *QueryParameterMatcher) XXX_Merge(src proto.Message)

func (*QueryParameterMatcher) XXX_Size

func (m *QueryParameterMatcher) XXX_Size() int

func (*QueryParameterMatcher) XXX_Unmarshal

func (m *QueryParameterMatcher) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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