Documentation
¶
Index ¶
Constants ¶
View Source
const ( Eq = "==" Ne = "!=" Gt = ">" Lt = "<" Ge = ">=" Le = "<=" Exists = "exists" In = "in" Matches = "matches" Type = "type" And = "and" Or = "or" Not = "not" )
Condition operator constants.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition struct {
Path string `json:"p,omitempty"`
Op string `json:"o"` // see operator constants above
Value any `json:"v,omitempty"`
Sub []*Condition `json:"apply,omitempty"` // Sub-conditions for logical operators (and, or, not)
}
Condition represents a serializable predicate for conditional application.
func FromPredicate ¶
FromPredicate parses a JSON Patch predicate wire-format map into a Condition. This is the inverse of Condition.ToPredicate.
func (*Condition) ToPredicate ¶
ToPredicate returns a JSON-serializable map representing the condition in the JSON Patch predicate wire format. This is the inverse of FromPredicate.
Click to show internal directories.
Click to hide internal directories.