logfile

package
v0.0.0-...-baaaa93 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(logfile Logfile, compression bool, round float64, measuredValues []*types.MeasuredValue) error

Append adds an array of several measured values to a logfile

func Compression

func Compression(measuredValues []*types.MeasuredValue) []*types.MeasuredValue

Compression the measured values. The system checks whether the measured values of the same type correspond to those of the predecessor. If this is the case, the current value is discarded and the validity date of the previous value is set to that of the current value. This means that no information is lost. Only the validity period of the measured value is increased.

Types

type Logfile

type Logfile interface {
	Read() ([]*types.MeasuredValue, error)
	Write(measuredValues []*types.MeasuredValue) error
}

Logfile is an interface for various logfiles

func New

func New(logfile string) Logfile

New returns a log file with basic functions for reading and writing data. The file extension of the logfile is taken into account to format the logfile into the correct format.

type MeasuredValue

type MeasuredValue struct {
	XMLName xml.Name `xml:"measured_value"`
	*types.MeasuredValue
}

MeasuredValue is an XML Wrapper for the original measured value struct

type MeasuredValues

type MeasuredValues struct {
	XMLName        xml.Name         `xml:"measured_values"`
	MeasuredValues []*MeasuredValue `xml:"measured_value"`
}

MeasuredValues is an XML Wrapper for an array of measured values

Jump to

Keyboard shortcuts

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