influxunifi

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 7 Imported by: 3

README

influx

This package provides the methods to turn UniFi measurements into influx data-points with appropriate tags and fields.

Documentation

Overview

Package influx provides the methods to turn UniFi measurements into influx data-points with appropriate tags and fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(in ...map[string]interface{}) map[string]interface{}

Combines concatenates N maps. This will delete things if not used with caution.

Types

type Config

type Config struct {
	Database string
	URL      string
	User     string
	Pass     string
	BadSSL   bool
}

Config defines the data needed to store metrics in InfluxDB

type InfluxUnifi

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

InfluxUnifi is returned by New() after you provide a Config.

func New

func New(c *Config) (*InfluxUnifi, error)

New returns an InfluxDB interface.

func (*InfluxUnifi) ReportMetrics

func (u *InfluxUnifi) ReportMetrics(m *metrics.Metrics) (*Report, error)

ReportMetrics batches all device and client data into influxdb data points. Call this after you've collected all the data you care about. Returns an error if influxdb calls fail, otherwise returns a report.

type Report

type Report struct {
	Metrics *metrics.Metrics
	Errors  []error
	Total   int
	Fields  int
	Start   time.Time
	Elapsed time.Duration
	// contains filtered or unexported fields
}

Report is returned to the calling procedure after everything is processed.

Jump to

Keyboard shortcuts

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