config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config implements utility routines for manipulating application configuration.

The application configuration are grouped in the following categories:

  • overload protection parameters

  • vehicle parameters

  • wallbox parameters

  • log parameters

  • data model parameters

  • teleinformation client parameters

  • eebus parameters

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OverloadProtection    OverloadProtectionConfig    // Overload protection configuration
	Vehicle               VehicleConfig               // Vehicle configuration
	Wallbox               WallboxConfig               // Wallbox configuration
	Log                   LogConfig                   // Log configuration
	DataModel             DataModelConfig             // Data model configuration
	TeleInformationClient TeleInformationClientConfig // Teleinformation client configuration
	Eebus                 EebusConfig                 // EEBUS configuration
}

Application configuration structure It groups all configuration categories The configuration is loaded from a YAML file using LoadConfig() function

func LoadConfig

func LoadConfig(configFilePath string) (Config, error)

Load configuration from configFilePath. copies from src to dst until either EOF is reached on src or an error occurs. It returns the configuration loaded and the error encountered.

A successful load returns err == nil.

type CsvConfig

type CsvConfig struct {
	FilePath string             // CSV file path
	Rotation FileRotationConfig // CSV file rotation configuration
}

Data model CSV file configuration

type CurrentLimitConfig

type CurrentLimitConfig struct {
	ValueInAmps        float64 // Electric vehicle charge current limitation in Amps
	LockDelayInSeconds float64 // Electric vehicle charge lock delay in seconds
}

Current limitation configuration for electric vehicle charge

type DataModelConfig

type DataModelConfig struct {
	Csv      *CsvConfig      // CSV file configuration or nil if not configured
	InfluxDb *InfluxDbConfig // InfluxDb configuration or nil if not configured
}

Data model configuration

type EebusConfig

type EebusConfig struct {
	ServerPort                int    // EEBUS server TCP port
	RemoteSki                 string // EEBUS remote SKI (SHA-1 hash, 40 hexadecimal digits)
	CertificateFilePath       string // EEBUS certificate file path
	PrivateKeyFilePath        string // EEBUS private key file path
	VendorCode                string // EEBUS vendor code
	DeviceBrand               string // EEBUS device brand
	DeviceModel               string // EEBUS device model
	SerialNumber              string // EEBUS device serial number
	HeartbeatTimeoutInSeconds int    // EEBUS heartbeat timeout in seconds
}

EEBUS configuration

type FileRotationConfig

type FileRotationConfig struct {
	PeriodInHours int    // Rotation period in hours
	PeriodCount   int    // Number of files to keep
	PeriodPattern string // Rotation pattern, e.g. ".%Y%m%d%H"
}

File rotation configuration for log and data model CSV files

type InfluxDbConfig

type InfluxDbConfig struct {
	Bucket    string // InfluxDb bucket
	Org       string // InfluxDb organization
	Token     string // InfluxDb token
	IpAddress string // InfluxDb server IP address
	TcpPort   int    // InfluxDb server TCP port
}

Data model InfluxDb configuration

type LogConfig

type LogConfig struct {
	Level    log.Level          // Log level
	FilePath string             // Log file path
	Rotation FileRotationConfig // Log file rotation configuration
}

Log configuration

type OverloadProtectionConfig

type OverloadProtectionConfig struct {
	Enable                 bool               // Enable/disable overload protection algorithm
	RunningPeriodInSeconds int                // Overload protection algorithm running period in seconds
	CurrentLimit           CurrentLimitConfig // Electric vehicle charge current limitation configuration
}

Overload protection configuration

type TeleInformationClientConfig

type TeleInformationClientConfig struct {
	Tic2Websocket Tic2WebsocketConfig // TIC2WebSocket client configuration
	TicIdentifier TicIdentifierConfig // TIC identifier configuration
}

Teleinformation client configuration

type Tic2WebsocketConfig

type Tic2WebsocketConfig struct {
	IpAddress string // TIC2WebSocket server IP address
	TcpPort   int    // TIC2WebSocket server TCP port
}

TIC2WebSocket client configuration

type TicIdentifierConfig

type TicIdentifierConfig struct {
	SerialNumber string // Linky meter serial number
}

TIC identifier configuration used for TIC2WebSocket client subscription

type VehicleConfig

type VehicleConfig struct {
	UpdateDataPeriodInSeconds int  // Vehicle data update period in seconds
	DataPersistent            bool // Vehicle data persistent enable/disable
}

Vehicle configuration

type WallboxConfig

type WallboxConfig struct {
	UpdateDataPeriodInSeconds int  // Wallbox data update period in seconds
	DataPersistent            bool // Wallbox data persistent enable/disable
}

Wallbox configuration

Jump to

Keyboard shortcuts

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