libmain

package
v0.0.0-...-1768917 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(sc device.SensorConfig)

Main is the "real" main.

Types

type BaseLogger

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

BaseLogger only logs std info or error.

func (*BaseLogger) Debugf

func (l *BaseLogger) Debugf(format string, args ...interface{})

Debugf logs message only when in debug level.

func (*BaseLogger) Errorf

func (l *BaseLogger) Errorf(format string, args ...interface{})

Errorf logs internal error message.

func (*BaseLogger) Infof

func (l *BaseLogger) Infof(format string, args ...interface{})

Infof logs and records info message.

func (*BaseLogger) Tracef

func (l *BaseLogger) Tracef(format string, args ...interface{})

Tracef logs message only when in trace level.

type BaseMetricCollector

type BaseMetricCollector struct{}

BaseMetricCollector provides a base implementation for metric management.

func (*BaseMetricCollector) CreateMetric

func (m *BaseMetricCollector) CreateMetric(name string, valueUnit string,
	description string) error

CreateMetric creates a new metric with the specified name, unit, and description.

func (*BaseMetricCollector) IncMetricInt

func (m *BaseMetricCollector) IncMetricInt(name string, value int64) error

IncMetricInt increases the metric value by the specified int64 amount. This method returns nil as there is no default implementation.

func (*BaseMetricCollector) SetMetricFloat

func (m *BaseMetricCollector) SetMetricFloat(name string, value float64) error

SetMetricFloat sets the value of the metric with the specified name to the provided float64 value. This method returns nil as there is no default implementation.

func (*BaseMetricCollector) SetMetricInt

func (m *BaseMetricCollector) SetMetricInt(name string, value int64) error

SetMetricInt sets the value of the metric with the specified name to the provided int64 value. This method returns nil as there is no default implementation.

func (*BaseMetricCollector) SetMetricString

func (m *BaseMetricCollector) SetMetricString(name string, value string) error

SetMetricString sets the value of the metric with the specified name to the provided string value. This method returns nil as there is no default implementation.

type BaseMonitor

type BaseMonitor struct {
	BaseLogger
	BaseMetricCollector
}

BaseMonitor is a not fully functional monitor for device creation in cmd/Collector.

func NewBaseMonitor

func NewBaseMonitor(logger *log.Entry) *BaseMonitor

NewBaseMonitor returns a new noop monitor for the collector.

Jump to

Keyboard shortcuts

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