filters

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package filters provides API to implement goma filters.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("filter not found")
)

Errors for filters.

Functions

func Register

func Register(name string, ctor Constructor)

Register registers a constructor of a kind of filters.

Types

type Constructor

type Constructor func(params map[string]interface{}) (Filter, error)

Constructor is a function to create a filter.

params are configuration options for the probe.

type Filter

type Filter interface {
	// Init is called when goma starts monitoring.
	Init()

	// Put receives a return value from a probe, and returns a filtered value.
	Put(f float64) float64

	// String returns a descriptive string for this filter.
	String() string
}

Filter is the interface for filters.

func Construct

func Construct(name string, params map[string]interface{}) (Filter, error)

Construct constructs a named filter. This function is used internally in goma.

Directories

Path Synopsis
Package all import all filters to be compiled-in.
Package all import all filters to be compiled-in.
Package average implements moving-average filter type.
Package average implements moving-average filter type.

Jump to

Keyboard shortcuts

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