filter

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package filter provides filters used in listing functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Requests

type Requests struct {
	IDs        []boruta.ReqID
	Priorities []boruta.Priority
	States     []boruta.ReqState
}

Requests implements ListFilter interface. Currently it is possible to filter by request IDs, states and priorities. All enabled filter fields (not nil nor empty) must be satisfied to make a match (AND behaviour). In a scope of a single filter field "one of" matches are used (OR behaviour). Empty or nil slice ignores filter for that type.

func NewRequests

func NewRequests(ids []boruta.ReqID, priorities []boruta.Priority,
	states []boruta.ReqState) *Requests

NewRequests returns pointer to initialized Requests structure.

func (*Requests) Match

func (filter *Requests) Match(elem interface{}) bool

Match is implementation of ListFilter interface. It checks if given ReqInfo matches ListFilter. For now only "one of" matches are possible in the scope of a single filter field (OR behaviour), but in the future following functionality should be added: * comparison, * ranges, * except of. All enabled filter fields (not nil nor empty) must be satisfied to make a match (AND behaviour).

type Workers

type Workers struct {
	boruta.Groups
	boruta.Capabilities
	// contains filtered or unexported fields
}

Workers contains Groups and Capabilities to be used to filter workers.

func NewWorkers

func NewWorkers(groups boruta.Groups, caps boruta.Capabilities) *Workers

NewWorkers returns pointer to initialized Workers structure.

func (*Workers) Match

func (filter *Workers) Match(elem interface{}) bool

Match is implementation of ListFilter interface. It checks if given WorkerInfo matches ListFilter. For now only exact matches are possible, but in the future following functionality should be added: * comparison, * ranges, * one of given, * except of.

Jump to

Keyboard shortcuts

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