Documentation
¶
Overview ¶
Package influx sends values to an influxdb database
Index ¶
- func New(config Config) (log.ValuesLogger, error)
- type Config
- type Logger
- func (l *Logger) CreateBatch() (client.BatchPoints, error)
- func (l *Logger) CreatePoint(values map[string]interface{}) (*client.Point, error)
- func (l *Logger) SetErrorLogger(errLogger log.PrintLogger)
- func (l *Logger) Values(values map[string]interface{})
- func (l *Logger) ValuesBatch(valuesArray []map[string]interface{})
- func (l *Logger) WriteBatch(points client.BatchPoints)
- type StdErrLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string // The influxdb hostname Database string // The influxdb database name User string // The influxdb user name Password string // The influxdb user password WriteTimeout time.Duration // Timeout for influxdb writes }
Config represents the config for an influx.Logger instance
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logs values to a specified influxdb database
func (*Logger) CreateBatch ¶
CreateBatch creates a batch attached to the db to add points to
func (*Logger) CreatePoint ¶
CreatePoint creates a batch point for influx from a set of values If you need more control you can create points and use WriteBatch
func (*Logger) SetErrorLogger ¶
func (l *Logger) SetErrorLogger(errLogger log.PrintLogger)
SetErrorLogger sets the error logger for this influx.Logger
func (*Logger) ValuesBatch ¶
ValuesBatch sends multiple set of values to influxdb as a batch
func (*Logger) WriteBatch ¶
func (l *Logger) WriteBatch(points client.BatchPoints)
WriteBatch writes the points to the influxdb connection within a goroutine to avoid blockng the caller
type StdErrLogger ¶
type StdErrLogger struct{}
StdErrLogger prints to stdout using fmt.Printf and is used as the default error logger for stats errors
func (StdErrLogger) Printf ¶
func (l StdErrLogger) Printf(f string, args ...interface{})
Printf prints to stdout using fmt.Printf