filter

package
v0.0.0-...-c39517e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package filter defines which tickets pass which filters. Other implementations which help filter tickets (eg, a range index lookup) must conform to the same set of tickets being within the filter as here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilteredEntity

type FilteredEntity interface {
	GetId() string
	GetSearchFields() *pb.SearchFields
	GetCreateTime() *timestamp.Timestamp
}

FilteredEntity provides an interface for filterable items

type Manager

type Manager interface {
	ProfileMembershipTest(fe FilteredEntity) (string, string, error)
}

Manager provides an interface for filtering FilteredEntity into MatchProfile and Pools

func NewManager

func NewManager(profiles []*pb.MatchProfile) Manager

NewManager returns a filter Manager

type PoolFilter

type PoolFilter struct {
	DoubleRangeFilters  []*pb.DoubleRangeFilter
	StringEqualsFilters []*pb.StringEqualsFilter
	TagPresentFilters   []*pb.TagPresentFilter
	CreatedBefore       time.Time
	CreatedAfter        time.Time
}

PoolFilter contains all the filtering criteria from a Pool that the Ticket needs to meet to belong to that Pool.

func NewPoolFilter

func NewPoolFilter(pool *pb.Pool) (*PoolFilter, error)

NewPoolFilter validates a Pool's filtering criteria and returns a PoolFilter.

func (*PoolFilter) In

func (pf *PoolFilter) In(entity FilteredEntity) bool

In returns true if the Ticket meets all the criteria for this PoolFilter.

Directories

Path Synopsis
Package testcases contains lists of ticket filtering test cases.
Package testcases contains lists of ticket filtering test cases.

Jump to

Keyboard shortcuts

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