datadis

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL                    = "https://datadis.es"
	HOURLY measurementType = iota
	QuarterHourly
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumption

type Consumption struct {
	Cups         string
	Date         string
	Time         string
	KWh          float64 `json:"consumptionKWh"`
	ObtainMethod string
}

type Datadis

type Datadis struct {
	HTTPTimeout     config.Duration `toml:"http_timeout"`
	MeasurementType measurementType `toml:"measurement_type"`
	Username        string          `toml:"username"`
	Password        string          `toml:"password"`
	Supplies        []Supply        `toml:"supplies"`
	StartDate       string          `toml:"start_date"`
	EndDate         string          `toml:"end_date"`
	DateDuration    config.Duration `toml:"date_duration"`

	Log telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields
}

Datadis contains the configuration for the pluguin.

func (*Datadis) Description

func (d *Datadis) Description() string

Description returns a one-sentence description on the Datadis input plugin.

func (*Datadis) Gather

func (d *Datadis) Gather(acc telegraf.Accumulator) error

Gather takes in an accumulator and adds the metrics that the Input gathers. This is called every "interval".

func (*Datadis) Init

func (d *Datadis) Init() error

Init is for setup, and validating config.

func (*Datadis) SampleConfig

func (d *Datadis) SampleConfig() string

SampleConfig returns the default configuration of the Datadis input plugin.

type Supply

type Supply struct {
	Address         string `json:"address"`
	Cups            string `json:"cups" toml:"cups"`
	PostalCode      string `json:"postalCode"`
	Province        string `json:"province"`
	Municipality    string `json:"municipality"`
	Distributor     string `json:"distributor"`
	ValidDateFrom   string `json:"validDateFrom"`
	ValidDateTo     string `json:"validDateTo"`
	PointType       uint8  `json:"pointType" toml:"point_type"`
	DistributorCode string `json:"distributorCode" toml:"distributor_code"`
}

Jump to

Keyboard shortcuts

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