store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildStoresFunc

type BuildStoresFunc func(metricFamilies []generator.FamilyGenerator,
	expectedType interface{},
	listWatchFunc func(client client.WithWatch, ns, fieldSelector string) cache.ListerWatcher,
	useAPIServerCache bool,
) []cache.Store

BuildStoresFunc function signature that is used to return a list of cache.Store using a WithWatch client

type Builder

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

Builder helps to build store. It follows the builder pattern (https://en.wikipedia.org/wiki/Builder_pattern).

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns a new builder.

func (*Builder) Build

func (b *Builder) Build() []metricsstore.MetricsWriter

Build initializes and registers all enabled stores. It returns metrics writers which can be used to write out metrics from the stores.

func (*Builder) DefaultGenerateStoresFunc

func (b *Builder) DefaultGenerateStoresFunc() BuildStoresFunc

DefaultGenerateStoresFunc returns default buildStores function

func (*Builder) WithAllowAnnotations

func (b *Builder) WithAllowAnnotations(annotations map[string][]string)

WithAllowAnnotations configures which annotations can be returned for metrics

func (*Builder) WithAllowDenyList

func (b *Builder) WithAllowDenyList(l ksmtypes.AllowDenyLister)

WithAllowDenyList configures the allow or denylisted metric to be exposed by the store build by the Builder.

func (*Builder) WithAllowLabels

func (b *Builder) WithAllowLabels(labels map[string][]string)

WithAllowLabels configures which labels can be returned for metrics

func (*Builder) WithContext

func (b *Builder) WithContext(ctx context.Context)

WithContext sets the ctx property of a Builder.

func (*Builder) WithCtrlClient

func (b *Builder) WithCtrlClient(c client.WithWatch)

WithCtrlClient sets the controller-runtime client with watch as property of a Builder.

func (*Builder) WithEnabledResources

func (b *Builder) WithEnabledResources(r []string) error

WithEnabledResources sets the enabledResources property of a Builder.

func (*Builder) WithGenerateStoresFunc

func (b *Builder) WithGenerateStoresFunc(f BuildStoresFunc, u bool)

WithGenerateStoresFunc configures a custom generate store function

func (*Builder) WithMetrics

func (b *Builder) WithMetrics(r prometheus.Registerer)

WithMetrics sets the metrics property of a Builder.

func (*Builder) WithNamespaces

func (b *Builder) WithNamespaces(n options.NamespaceList, nsFilter string)

WithNamespaces sets the namespaces property of a Builder.

Jump to

Keyboard shortcuts

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