Documentation
¶
Overview ¶
Package util provides some utility tools for other components. Such as net-transporting, file-operating, rate-limiter.
Index ¶
- func IsEmptyStr(s string) bool
- func IsNatural(value string) bool
- func IsNil(value interface{}) bool
- func IsNumeric(value string) bool
- func IsPositive(value int64) bool
- func IsTrue(value bool) bool
- func JSONString(v interface{}) string
- func Max(x, y int64) int64
- func Min(x, y int64) int64
- func NewCounter(subsystem, name, help string, labels []string) *prometheus.CounterVec
- func NewGauge(subsystem, name, help string, labels []string) *prometheus.GaugeVec
- func NewHistogram(subsystem, name, help string, labels []string, buckets []float64) *prometheus.HistogramVec
- func NewSummary(subsystem, name, help string, labels []string, objectives map[float64]float64) *prometheus.SummaryVec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNumeric ¶
IsNumeric returns whether the value is a numeric. If the bitSize of value below 0 or above 64 an error is returned.
func IsPositive ¶
IsPositive returns whether the value is a positive number.
func NewCounter ¶
func NewCounter(subsystem, name, help string, labels []string) *prometheus.CounterVec
NewCounter will auto-register a Counter metric to prometheus default registry and return it.
func NewGauge ¶
func NewGauge(subsystem, name, help string, labels []string) *prometheus.GaugeVec
NewGauge will auto-register a Gauge metric to prometheus default registry and return it.
func NewHistogram ¶
func NewHistogram(subsystem, name, help string, labels []string, buckets []float64) *prometheus.HistogramVec
NewHistogram will auto-register a Histogram metric to prometheus default registry and return it.
func NewSummary ¶
func NewSummary(subsystem, name, help string, labels []string, objectives map[float64]float64) *prometheus.SummaryVec
NewSummary will auto-register a Summary metric to prometheus default registry and return it.
Types ¶
This section is empty.