Documentation ¶
Index ¶
- func Init(store IgnoreStore) error
- func ToQuery(ignores []*IgnoreRule) ([]url.Values, error)
- type IgnoreRule
- type IgnoreStore
- type MemIgnoreStore
- func (m *MemIgnoreStore) BuildRuleMatcher() (RuleMatcher, error)
- func (m *MemIgnoreStore) Create(rule *IgnoreRule) error
- func (m *MemIgnoreStore) Delete(id int64) (int, error)
- func (m *MemIgnoreStore) List(addCounts bool) ([]*IgnoreRule, error)
- func (m *MemIgnoreStore) Revision() int64
- func (m *MemIgnoreStore) Update(id int64, updated *IgnoreRule) error
- type QueryRule
- type RuleMatcher
- type SQLIgnoreStore
- func (m *SQLIgnoreStore) BuildRuleMatcher() (RuleMatcher, error)
- func (m *SQLIgnoreStore) Create(rule *IgnoreRule) error
- func (m *SQLIgnoreStore) Delete(id int64) (int, error)
- func (m *SQLIgnoreStore) List(addCounts bool) ([]*IgnoreRule, error)
- func (m *SQLIgnoreStore) Revision() int64
- func (m *SQLIgnoreStore) Update(id int64, rule *IgnoreRule) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(store IgnoreStore) error
StartMonitoring starts a new monitoring routine for the given ignore store that counts expired ignore rules and pushes that info into a metric.
Types ¶
type IgnoreRule ¶
type IgnoreRule struct { ID int64 `json:"id"` Name string `json:"name"` UpdatedBy string `json:"updatedBy"` Expires time.Time `json:"expires"` Query string `json:"query"` Note string `json:"note"` Count int `json:"count" datastore:"-"` ExclusiveCount int `json:"exclusiveCount" datastore:"-"` }
IgnoreRule is the GUI struct for dealing with Ignore rules.
func NewIgnoreRule ¶
type IgnoreStore ¶
type IgnoreStore interface { // Create adds a new rule to the ignore store. Create(*IgnoreRule) error // List returns all ignore rules in the ignore store. // 'addCounts' indicates whether to include counts how often an ignore // rule appears in the current tile. List(addCounts bool) ([]*IgnoreRule, error) // Updates an IgnoreRule. Update(id int64, rule *IgnoreRule) error // Removes an IgnoreRule from the store. The return value is the number of // records that were deleted (either 0 or 1). Delete(id int64) (int, error) // Revision returns a monotonically increasing int64 that goes up each time // the ignores have been changed. It will not persist nor will it be the same // between different instances of IgnoreStore. I.e. it will probably start at // zero each time an IngoreStore is instantiated. Revision() int64 // BuildRuleMatcher returns a RuleMatcher based on the current content // of the ignore store. BuildRuleMatcher() (RuleMatcher, error) }
IgnoreStore stores and matches ignore rules.
func NewCloudIgnoreStore ¶
func NewCloudIgnoreStore(client *datastore.Client, expStore expstorage.ExpectationsStore, tileStream <-chan *types.TilePair) (IgnoreStore, error)
NewCloudIgnoreStore returns an IgnoreStore instance that is backed by Cloud Datastore.
func NewMemIgnoreStore ¶
func NewMemIgnoreStore() IgnoreStore
func NewSQLIgnoreStore ¶
func NewSQLIgnoreStore(vdb *database.VersionedDB, expStore expstorage.ExpectationsStore, tileStream <-chan *types.TilePair) IgnoreStore
NewSQLIgnoreStore creates a new SQL based IgnoreStore.
vdb - database to connect to. expStore - expectations store needed to count the untriaged digests per rule. tileStream - continuously provides an updated copy of the current tile.
type MemIgnoreStore ¶
type MemIgnoreStore struct {
// contains filtered or unexported fields
}
MemIgnoreStore is an in-memory implementation of IgnoreStore.
func (*MemIgnoreStore) BuildRuleMatcher ¶
func (m *MemIgnoreStore) BuildRuleMatcher() (RuleMatcher, error)
BuildRuleMatcher, see IgnoreStore interface.
func (*MemIgnoreStore) Create ¶
func (m *MemIgnoreStore) Create(rule *IgnoreRule) error
Create, see IgnoreStore interface.
func (*MemIgnoreStore) Delete ¶
func (m *MemIgnoreStore) Delete(id int64) (int, error)
Delete, see IgnoreStore interface.
func (*MemIgnoreStore) List ¶
func (m *MemIgnoreStore) List(addCounts bool) ([]*IgnoreRule, error)
List, see IgnoreStore interface.
func (*MemIgnoreStore) Revision ¶
func (m *MemIgnoreStore) Revision() int64
func (*MemIgnoreStore) Update ¶
func (m *MemIgnoreStore) Update(id int64, updated *IgnoreRule) error
Update, see IgnoreStore interface.
type QueryRule ¶
QueryRule wraps around a web query and allows matching of parameter sets against it.
func NewQueryRule ¶
type RuleMatcher ¶
type RuleMatcher func(map[string]string) ([]*IgnoreRule, bool)
RuleMatcher returns a list of rules in the IgnoreStore that match the given set of parameters.
type SQLIgnoreStore ¶
type SQLIgnoreStore struct {
// contains filtered or unexported fields
}
func (*SQLIgnoreStore) BuildRuleMatcher ¶
func (m *SQLIgnoreStore) BuildRuleMatcher() (RuleMatcher, error)
BuildRuleMatcher, see IgnoreStore interface.
func (*SQLIgnoreStore) Create ¶
func (m *SQLIgnoreStore) Create(rule *IgnoreRule) error
Create, see IgnoreStore interface.
func (*SQLIgnoreStore) Delete ¶
func (m *SQLIgnoreStore) Delete(id int64) (int, error)
Delete, see IgnoreStore interface.
func (*SQLIgnoreStore) List ¶
func (m *SQLIgnoreStore) List(addCounts bool) ([]*IgnoreRule, error)
List, see IgnoreStore interface.
func (*SQLIgnoreStore) Revision ¶
func (m *SQLIgnoreStore) Revision() int64
Revision, see IngoreStore interface.
func (*SQLIgnoreStore) Update ¶
func (m *SQLIgnoreStore) Update(id int64, rule *IgnoreRule) error
Update, see IgnoreStore interface.