matcher

package
v0.9.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_gsloc_type_matcher_v1_regex_proto protoreflect.FileDescriptor
View Source
var File_gsloc_type_matcher_v1_string_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type RegexMatchAndSubstitute

type RegexMatchAndSubstitute struct {

	// The regular expression used to find portions of a string (hereafter called
	// the "subject string") that should be replaced. When a new string is
	// produced during the substitution operation, the new string is initially
	// the same as the subject string, but then all matches in the subject string
	// are replaced by the substitution string. If replacing all matches isn't
	// desired, regular expression anchors can be used to ensure a single match,
	// so as to replace just one occurrence of a pattern. Capture groups can be
	// used in the pattern to extract portions of the subject string, and then
	// referenced in the substitution string.
	Regex string `protobuf:"bytes,3,opt,name=regex,proto3" json:"regex,omitempty"`
	// The string that should be substituted into matching portions of the
	// subject string during a substitution operation to produce a new string.
	// Capture groups in the pattern can be referenced in the substitution
	// string. Note, however, that the syntax for referring to capture groups is
	// defined by the chosen regular expression engine. Google's `RE2
	// <https://github.com/google/re2>`_ regular expression engine uses a
	// backslash followed by the capture group number to denote a numbered
	// capture group. E.g., “\1“ refers to capture group 1, and “\2“ refers
	// to capture group 2.
	Substitution string `protobuf:"bytes,2,opt,name=substitution,proto3" json:"substitution,omitempty"`
	// contains filtered or unexported fields
}

Describes how to match a string and then produce a new string using a regular expression and a substitution string.

func (*RegexMatchAndSubstitute) Descriptor deprecated

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

Deprecated: Use RegexMatchAndSubstitute.ProtoReflect.Descriptor instead.

func (*RegexMatchAndSubstitute) GetRegex

func (x *RegexMatchAndSubstitute) GetRegex() string

func (*RegexMatchAndSubstitute) GetSubstitution

func (x *RegexMatchAndSubstitute) GetSubstitution() string

func (*RegexMatchAndSubstitute) ProtoMessage

func (*RegexMatchAndSubstitute) ProtoMessage()

func (*RegexMatchAndSubstitute) ProtoReflect

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

func (*RegexMatchAndSubstitute) Reset

func (x *RegexMatchAndSubstitute) Reset()

func (*RegexMatchAndSubstitute) String

func (x *RegexMatchAndSubstitute) String() string

func (*RegexMatchAndSubstitute) Validate

func (m *RegexMatchAndSubstitute) Validate() error

Validate checks the field values on RegexMatchAndSubstitute with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RegexMatchAndSubstitute) ValidateAll

func (m *RegexMatchAndSubstitute) ValidateAll() error

ValidateAll checks the field values on RegexMatchAndSubstitute with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RegexMatchAndSubstituteMultiError, or nil if none found.

type RegexMatchAndSubstituteMultiError

type RegexMatchAndSubstituteMultiError []error

RegexMatchAndSubstituteMultiError is an error wrapping multiple validation errors returned by RegexMatchAndSubstitute.ValidateAll() if the designated constraints aren't met.

func (RegexMatchAndSubstituteMultiError) AllErrors

func (m RegexMatchAndSubstituteMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RegexMatchAndSubstituteMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type RegexMatchAndSubstituteValidationError

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

RegexMatchAndSubstituteValidationError is the validation error returned by RegexMatchAndSubstitute.Validate if the designated constraints aren't met.

func (RegexMatchAndSubstituteValidationError) Cause

Cause function returns cause value.

func (RegexMatchAndSubstituteValidationError) Error

Error satisfies the builtin error interface

func (RegexMatchAndSubstituteValidationError) ErrorName

ErrorName returns error name.

func (RegexMatchAndSubstituteValidationError) Field

Field function returns field value.

func (RegexMatchAndSubstituteValidationError) Key

Key function returns key value.

func (RegexMatchAndSubstituteValidationError) Reason

Reason function returns reason value.

type StringMatcher

type StringMatcher struct {

	// Types that are assignable to MatchPattern:
	//
	//	*StringMatcher_Exact
	//	*StringMatcher_Prefix
	//	*StringMatcher_Suffix
	//	*StringMatcher_Regex
	//	*StringMatcher_Contains
	MatchPattern isStringMatcher_MatchPattern `protobuf_oneof:"match_pattern"`
	// If true, indicates the exact/prefix/suffix matching should be case insensitive. This has no
	// effect for the safe_regex match.
	// For example, the matcher *data* will match both input string *Data* and *data* if set to true.
	IgnoreCase bool `protobuf:"varint,6,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"`
	// contains filtered or unexported fields
}

Specifies the way to match a string.

func (*StringMatcher) Descriptor deprecated

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

Deprecated: Use StringMatcher.ProtoReflect.Descriptor instead.

func (*StringMatcher) GetContains

func (x *StringMatcher) GetContains() string

func (*StringMatcher) GetExact

func (x *StringMatcher) GetExact() string

func (*StringMatcher) GetIgnoreCase

func (x *StringMatcher) GetIgnoreCase() bool

func (*StringMatcher) GetMatchPattern

func (m *StringMatcher) GetMatchPattern() isStringMatcher_MatchPattern

func (*StringMatcher) GetPrefix

func (x *StringMatcher) GetPrefix() string

func (*StringMatcher) GetRegex

func (x *StringMatcher) GetRegex() string

func (*StringMatcher) GetSuffix

func (x *StringMatcher) GetSuffix() string

func (*StringMatcher) ProtoMessage

func (*StringMatcher) ProtoMessage()

func (*StringMatcher) ProtoReflect

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

func (*StringMatcher) Reset

func (x *StringMatcher) Reset()

func (*StringMatcher) String

func (x *StringMatcher) String() string

func (*StringMatcher) Validate

func (m *StringMatcher) Validate() error

Validate checks the field values on StringMatcher with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*StringMatcher) ValidateAll

func (m *StringMatcher) ValidateAll() error

ValidateAll checks the field values on StringMatcher with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in StringMatcherMultiError, or nil if none found.

type StringMatcherMultiError

type StringMatcherMultiError []error

StringMatcherMultiError is an error wrapping multiple validation errors returned by StringMatcher.ValidateAll() if the designated constraints aren't met.

func (StringMatcherMultiError) AllErrors

func (m StringMatcherMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (StringMatcherMultiError) Error

func (m StringMatcherMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type StringMatcherValidationError

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

StringMatcherValidationError is the validation error returned by StringMatcher.Validate if the designated constraints aren't met.

func (StringMatcherValidationError) Cause

Cause function returns cause value.

func (StringMatcherValidationError) Error

Error satisfies the builtin error interface

func (StringMatcherValidationError) ErrorName

func (e StringMatcherValidationError) ErrorName() string

ErrorName returns error name.

func (StringMatcherValidationError) Field

Field function returns field value.

func (StringMatcherValidationError) Key

Key function returns key value.

func (StringMatcherValidationError) Reason

Reason function returns reason value.

type StringMatcher_Contains

type StringMatcher_Contains struct {
	// The input string must have the substring specified here.
	// Note: empty contains match is not allowed, please use regex instead.
	//
	// Examples:
	//
	// * *abc* matches the value *xyz.abc.def*
	Contains string `protobuf:"bytes,7,opt,name=contains,proto3,oneof"`
}

type StringMatcher_Exact

type StringMatcher_Exact struct {
	// The input string must match exactly the string specified here.
	//
	// Examples:
	//
	// * *abc* only matches the value *abc*.
	Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof"`
}

type StringMatcher_Prefix

type StringMatcher_Prefix struct {
	// The input string must have the prefix specified here.
	// Note: empty prefix is not allowed, please use regex instead.
	//
	// Examples:
	//
	// * *abc* matches the value *abc.xyz*
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof"`
}

type StringMatcher_Regex

type StringMatcher_Regex struct {
	// The input string must match the regular expression specified here.
	Regex string `protobuf:"bytes,5,opt,name=regex,proto3,oneof"`
}

type StringMatcher_Suffix

type StringMatcher_Suffix struct {
	// The input string must have the suffix specified here.
	// Note: empty prefix is not allowed, please use regex instead.
	//
	// Examples:
	//
	// * *abc* matches the value *xyz.abc*
	Suffix string `protobuf:"bytes,3,opt,name=suffix,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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