File: options.go

package info (click to toggle)
golang-github-vulcand-oxy 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 728 kB
  • sloc: makefile: 14
file content (23 lines) | stat: -rw-r--r-- 591 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package memmetrics

// RTOption represents an option you can pass to NewRTMetrics.
type RTOption func(r *RTMetrics) error

// RTCounter set a builder function for Counter.
func RTCounter(fn NewCounterFn) RTOption {
	return func(r *RTMetrics) error {
		r.newCounter = fn
		return nil
	}
}

// RTHistogram set a builder function for RollingHDRHistogram.
func RTHistogram(fn NewRollingHistogramFn) RTOption {
	return func(r *RTMetrics) error {
		r.newHist = fn
		return nil
	}
}

// RatioOption represents an option you can pass to NewRatioCounter.
type RatioOption func(r *RatioCounter) error