sqlignorestore

package
v0.0.0-...-ded851d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package sqlignorestore contains a SQL implementation of ignore.Store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertIgnoreRules

func ConvertIgnoreRules(rules []paramtools.ParamSet) (string, []interface{})

ConvertIgnoreRules turns a Paramset into a SQL clause that would match rows using a column named "keys". It is currently implemented with AND/OR clauses, but could potentially be done with UNION/INTERSECT depending on performance needs.

func UpdateIgnoredTraces

func UpdateIgnoredTraces(ctx context.Context, db *pgxpool.Pool) error

UpdateIgnoredTraces applies all the given ignore rules to all Traces and ValuesAtHead.

Types

type StoreImpl

type StoreImpl struct {
	// contains filtered or unexported fields
}

func New

func New(db *pgxpool.Pool) *StoreImpl

New returns a SQL based implementation of ignore.Store.

func (*StoreImpl) Create

func (s *StoreImpl) Create(ctx context.Context, rule ignore.Rule) error

Create implements the ignore.Store interface. It will mark all traces that match the rule as "ignored".

func (*StoreImpl) Delete

func (s *StoreImpl) Delete(ctx context.Context, id string) error

Delete implements the ignore.Store interface. It will mark the traces that match the params of the deleted rule as "ignored" or not depending on how the unchanged n-1 rules affect them.

func (*StoreImpl) List

func (s *StoreImpl) List(ctx context.Context) ([]ignore.Rule, error)

List implements the ignore.Store interface.

func (*StoreImpl) Update

func (s *StoreImpl) Update(ctx context.Context, rule ignore.Rule) error

Update implements the ignore.Store interface. If the rule paramset changes, it will mark the traces that match the old params as "ignored" or not depending on how the unchanged n-1 rules plus the new rule affect them. It will then update all traces that match the new rule as "ignored".

Jump to

Keyboard shortcuts

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