Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidFilterFormat = errors.New("invalid filter format") ErrUnknownFieldName = errors.New("unknown field name") ErrUnsupportedOperatorType = errors.New("unknown operator name") ErrInvalidValueFormat = errors.New("unknown field value format") )
View Source
var ( ErrMustBePointer = errors.New("fields value must be a pointer") ErrFieldNotFound = errors.New("field was not found") ErrFieldInvalidValueType = errors.New("field value contains invalid type") ErrFieldUnsupportedOperatorType = errors.New("field value does not support provided operator") )
Functions ¶
func IsQueryField ¶
Types ¶
type FieldValue ¶
type FieldValue struct {
// contains filtered or unexported fields
}
func NewFieldValue ¶
func NewFieldValue(field string) FieldValue
func (FieldValue) Evaluate ¶
func (fv FieldValue) Evaluate(fields any) (interface{}, error)
Evaluate obtains the actual value from the provided fieldset The obtained value is then used for comparison, such as numplayers!=maxplayers
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func Parse ¶ added in v0.7.0
Parse accepts a string in the form of "<field><op><value>" that represents a single filter value for the specified server field. Examples: numplayers!=maxplayers, password=0, gamevariant='SWAT 4' Returns an instance of Filter
Click to show internal directories.
Click to hide internal directories.