influxconnector

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 6 Imported by: 0

README

InfluxConnector

The influxconnector plugin enables the recording of various soundtouch message updates to an existing InfluxDB installation.

The plugin is enabled by including an [influxDB] section in your configuration-toml file.

[influxDB]
## speakers for which messages should be logged. If empty, all 
speakers = ["Office", "Kitchen"]

## log_messages describes the message types to be logged
## one or more of "ConnectionStateUpdated", "NowPlaying", "Volume"
## all if empty
log_messages = ["ConnectionStateUpdated", "NowPlaying", "Volume"] 

## URL of the InfluxDB
influxURL = "http://influxdb:8086"

## Database where to store the events
database = "soundtouch"

#
## dry_run indicates that the plugin dumps lineporoto for the influxDB conncetion
## as curl statement. 
# dry_run = true
## 

If a connection to the provided influxDB can not be established, the plugin will be disabled after some 20 retries.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	InfluxURL   string   `toml:"influxURL"`
	Database    string   `toml:"database"`
	Speakers    []string `toml:"speakers"`
	LogMessages []string `toml:"log_messages"`
	DryRun      bool     `toml:"dry_run"`
}

Config contains the configuration of the plugin Speakers list of SpeakerNames the handler is added. All if empty IgnoreMessages a list of message types to be ignored

type InfluxDB

type InfluxDB struct {
	Config
	Plugin soundtouch.PluginFunc
	// contains filtered or unexported fields
}

InfluxDB describes the plugin. It has a Config to store the configuration Plugin the plugin function suspended indicates that the plugin is temporarely suspended

func NewLogger

func NewLogger(config Config) (d *InfluxDB)

NewLogger creates a new Logger plugin with the configuration

func (*InfluxDB) Description

func (d *InfluxDB) Description() string

Description returns a string explaining the purpose of this plugin

func (*InfluxDB) Disable

func (d *InfluxDB) Disable()

Disable temporarely the execution of the plugin

func (*InfluxDB) Enable

func (d *InfluxDB) Enable()

Enable temporarely the execution of the plugin

func (*InfluxDB) Execute

func (d *InfluxDB) Execute(pluginName string, update soundtouch.Update, speaker soundtouch.Speaker)

Execute runs the plugin with the given parameter

func (*InfluxDB) IsEnabled

func (d *InfluxDB) IsEnabled() bool

IsEnabled returns true if the plugin is not suspened

func (*InfluxDB) Name

func (d *InfluxDB) Name() string

Name returns the plugin name

func (*InfluxDB) SampleConfig

func (d *InfluxDB) SampleConfig() string

SampleConfig returns text explaining how plugin should be configured

func (*InfluxDB) Terminate

func (d *InfluxDB) Terminate() bool

Terminate indicates that no further plugin will be executed on this speaker

Jump to

Keyboard shortcuts

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