labelfilter

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Label    string `json:"label,omitempty"`    // Label name (e.g., "type", "group", "app").
	Operator string `json:"operator,omitempty"` // Operator (e.g., "=", "!=", etc.).
	Value    string `json:"value,omitempty"`    // Value for the condition (e.g., "ssh", "prod").
}

Condition represents a strict evaluation on a specific label. The Operator is a simple representation of the type of evaluation being made. Equals `=` and Not Equals `!=` are supported. In future Bigger Than `>`, Smaller Than `<` and potentially `LIKE` type searches can be supported.

type Filter

type Filter struct {
	Scope *Scope `json:"scope"`
}

Filter represents the overarching filter for this particular set of conditions. It can have a condition, which is simple, or a query, which in turn can have many subqueries. This object is the wrapper for an entire set of queries and conditions that make up a single filter.

type Query

type Query struct {
	Operator string  `json:"operator"` // Logical operator (e.g., "AND", "OR").
	Scopes   []Scope `json:"scopes"`   // Scopes can be either `Condition` or nested `Query`.
}

Query brings N Conditions or Queries together with a logical operator A Query can have SubQueries for searches such as:

<-condition-> <-------subquery-------> "label:value AND (label:foo OR label:bar)"

type Scope

type Scope struct {
	*Condition `json:"condition,omitempty"`
	*Query     `json:"query,omitempty"`
}

Scope represents a Sub Condition or Query which can be logically represented separately or within another Scope

func (*Scope) IsCondition

func (qc *Scope) IsCondition() bool

func (*Scope) IsQuery

func (qc *Scope) IsQuery() bool

func (*Scope) MarshalJSON

func (s *Scope) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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