rules

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRuleGroup

func CloneRuleGroup(g rulefmt.RuleGroup) rulefmt.RuleGroup

func CloneRuleGroupList

func CloneRuleGroupList(list []rulefmt.RuleGroup) []rulefmt.RuleGroup

Types

type PrometheusRuleFinder

type PrometheusRuleFinder struct {
	PrometheusRuleFinderOptions
	// contains filtered or unexported fields
}

PrometheusRuleFinder can find rules defined in PrometheusRule CRDs.

func (*PrometheusRuleFinder) FindGroups

func (f *PrometheusRuleFinder) FindGroups(ctx context.Context) ([]rulefmt.RuleGroup, error)

type PrometheusRuleFinderOption

type PrometheusRuleFinderOption func(*PrometheusRuleFinderOptions)

func WithNamespaces

func WithNamespaces(namespaces ...string) PrometheusRuleFinderOption

type PrometheusRuleFinderOptions

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

func (*PrometheusRuleFinderOptions) Apply

type RuleFinder

type RuleFinder interface {
	FindGroups(ctx context.Context) ([]rulefmt.RuleGroup, error)
}

func NewPrometheusRuleFinder

func NewPrometheusRuleFinder(k8sClient client.Client, opts ...PrometheusRuleFinderOption) RuleFinder

type UpdateNotifier

type UpdateNotifier interface {
	// Returns a channel that will receive a list of rule groups whenever
	// any rules are added, removed, or updated. The channel has a small buffer
	// and will initially contain the latest rule group list.
	//
	// If the context is canceled, the channel will be closed. Additionally, if
	// the channel's buffer is full, any updates will be dropped.
	NotifyC(ctx context.Context) <-chan []rulefmt.RuleGroup
}

func NewPeriodicUpdateNotifier

func NewPeriodicUpdateNotifier(ctx context.Context, finder RuleFinder, interval time.Duration) UpdateNotifier

Jump to

Keyboard shortcuts

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