matchers

package
v1.6.0-beta19 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_core_matchers_matchers_proto protoreflect.FileDescriptor

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"`
	// contains filtered or unexported fields
}

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 deprecated

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

Deprecated: Use HeaderMatcher.ProtoReflect.Descriptor instead.

func (*HeaderMatcher) Equal

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

Equal function

func (*HeaderMatcher) GetInvertMatch

func (x *HeaderMatcher) GetInvertMatch() bool

func (*HeaderMatcher) GetName

func (x *HeaderMatcher) GetName() string

func (*HeaderMatcher) GetRegex

func (x *HeaderMatcher) GetRegex() bool

func (*HeaderMatcher) GetValue

func (x *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) ProtoReflect added in v1.6.0

func (x *HeaderMatcher) ProtoReflect() protoreflect.Message

func (*HeaderMatcher) Reset

func (x *HeaderMatcher) Reset()

func (*HeaderMatcher) String

func (x *HeaderMatcher) String() string

type Matcher

type Matcher struct {

	// Types that are assignable 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"`
	// contains filtered or unexported fields
}

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

func (*Matcher) Descriptor deprecated

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

Deprecated: Use Matcher.ProtoReflect.Descriptor instead.

func (*Matcher) Equal

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

Equal function

func (*Matcher) GetExact

func (x *Matcher) GetExact() string

func (*Matcher) GetHeaders

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

func (*Matcher) GetMethods

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

func (*Matcher) GetPathSpecifier

func (m *Matcher) GetPathSpecifier() isMatcher_PathSpecifier

func (*Matcher) GetPrefix

func (x *Matcher) GetPrefix() string

func (*Matcher) GetQueryParameters

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

func (*Matcher) GetRegex

func (x *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) ProtoReflect added in v1.6.0

func (x *Matcher) ProtoReflect() protoreflect.Message

func (*Matcher) Reset

func (x *Matcher) Reset()

func (*Matcher) String

func (x *Matcher) String() string

type Matcher_Exact

type Matcher_Exact struct {
	// If specified, the route is an exact path rule meaning that the path must
	// exactly match the *:path* header once the query string is removed.
	Exact string `protobuf:"bytes,2,opt,name=exact,proto3,oneof"`
}

type Matcher_Prefix

type Matcher_Prefix struct {
	// If specified, the route is a prefix rule meaning that the prefix must
	// match the beginning of the *:path* header.
	Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3,oneof"`
}

type Matcher_Regex

type Matcher_Regex struct {
	// If specified, the route is a regular expression rule meaning that the
	// regex must match the *:path* header once the query string is removed. The entire path
	// (without the query string) must match the regex. The rule will not match if only a
	// sub-sequence of the *:path* header matches the regex. The regex grammar is defined `here
	// <http://en.cppreference.com/w/cpp/regex/ecmascript>`_.
	//
	// Examples:<br/>
	//
	// * The regex */b[io]t* matches the path */bit*<br/>
	// * The regex */b[io]t* matches the path */bot*<br/>
	// * The regex */b[io]t* does not match the path */bite*<br/>
	// * The regex */b[io]t* does not match the path */bit/bot*<br/><br/>
	//
	// Note that the complexity of the regex is constrained by the regex engine's "program size" setting.
	// If your regex is too complex, you may need to adjust the `regexMaxProgramSize` field
	// in the `GlooOptions` section of your `Settings` resource
	Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof"`
}

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"`
	// contains filtered or unexported fields
}

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 deprecated

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

Deprecated: Use QueryParameterMatcher.ProtoReflect.Descriptor instead.

func (*QueryParameterMatcher) Equal

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

Equal function

func (*QueryParameterMatcher) GetName

func (x *QueryParameterMatcher) GetName() string

func (*QueryParameterMatcher) GetRegex

func (x *QueryParameterMatcher) GetRegex() bool

func (*QueryParameterMatcher) GetValue

func (x *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) ProtoReflect added in v1.6.0

func (x *QueryParameterMatcher) ProtoReflect() protoreflect.Message

func (*QueryParameterMatcher) Reset

func (x *QueryParameterMatcher) Reset()

func (*QueryParameterMatcher) String

func (x *QueryParameterMatcher) String() string

Jump to

Keyboard shortcuts

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