stringmatcher

package
v0.8.20 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operator

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

Operator is en enum over types of StringMatcher

func (Operator) MarshalJSON

func (o Operator) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface

func (Operator) String

func (o Operator) String() string

String implements fmt.Stringer

func (*Operator) UnmarshalJSON

func (o *Operator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface

type StringMatcher

type StringMatcher struct {
	Operator Operator `json:"operator"`
	Value    string   `json:"value"`
	// contains filtered or unexported fields
}

StringMatcher matches a string based on an operator and a value

func Contains

func Contains(value string) *StringMatcher

Contains constructs a new StringMatcher that matches using the Contains operator

func Full

func Full(value string) *StringMatcher

Full constructs a new StringMatcher that matches using the Full operator

func Prefix

func Prefix(value string) *StringMatcher

Prefix constructs a new StringMatcher that matches using the Prefix operator

func Regex

func Regex(value string) *StringMatcher

Regex constructs a new StringMatcher that matches using the Regex operator

func Suffix

func Suffix(value string) *StringMatcher

Suffix constructs a new StringMatcher that matches using the Suffix operator

func (*StringMatcher) Match

func (m *StringMatcher) Match(value string) error

Match attempts to match a string based on the StringMatcher

func (*StringMatcher) UnmarshalJSON

func (m *StringMatcher) UnmarshalJSON(b []byte) error

Unmarshal implements json.Unmarshaler

Jump to

Keyboard shortcuts

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