settings

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YamlFile = "yaml"
	YmlFile  = "yml"
	JSON     = "json"
)
View Source
const (
	Model           = "chargepoint.info.ocpp.model"
	Vendor          = "chargepoint.info.ocpp.vendor"
	MaxChargingTime = "chargepoint.info.maxChargingTime"
	ProtocolVersion = "chargepoint.info.protocolVersion"
	LoggingFormat   = "chargepoint.logging.format"
	Debug           = "debug"
	ApiEnabled      = "api.enabled"
	ApiAddress      = "api.address"
	ApiPort         = "api.port"
)

Variables

View Source
var (
	ConnectorSettings = sync.Map{}
)
View Source
var (
	ErrUnsupportedFileFormat = errors.New("unsupported file format")
)

Functions

func GetConnectors

func GetConnectors(connectorsFolderPath string) []*settings.Connector

GetConnectors Scan the connectors folder, read all the connectors' settings and cache the settings.

func GetSettings

func GetSettings() *settings.Settings

GetSettings gets settings from cache or reads the settings file if the cached settings are not found.

func InitSettings

func InitSettings(settingsFilePath string)

func SetupOcppConfigurationManager

func SetupOcppConfigurationManager(filePath string, version configuration.ProtocolVersion, supportedProfiles ...string)

func UpdateConnectorSessionInfo

func UpdateConnectorSessionInfo(evseId, connectorId int, session *settings.Session)

UpdateConnectorSessionInfo update the Connector's Session object in the connector configuration file

func UpdateConnectorStatus

func UpdateConnectorStatus(evseId, connectorId int, status core.ChargePointStatus)

UpdateConnectorStatus update the Connector's status in the connector configuration file

func WriteToFile

func WriteToFile(filename string, structure interface{}) (err error)

WriteToFile writes come JSON/YAML/TOML structure to the specified path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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