Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultCoreConfiguration() []core.ConfigurationKey
- func DefaultFirmwareConfiguration() []core.ConfigurationKey
- func DefaultLocalAuthConfiguration() []core.ConfigurationKey
- func DefaultSmartChargingConfiguration() []core.ConfigurationKey
- type Config
- func (config *Config) GetConfig() []core.ConfigurationKey
- func (config *Config) GetConfigurationValue(key string) (*string, error)
- func (config *Config) GetVersion() int
- func (config *Config) SetVersion(version int)
- func (config *Config) UpdateKey(key string, value *string) error
- func (config *Config) UpdateKeyReadability(key string, readable bool) error
- func (config *Config) Validate(mandatoryKeys []Key) error
- type Key
- type KeyValidator
- type Manager
- type ManagerV16
- func (m *ManagerV16) GetConfiguration() ([]core.ConfigurationKey, error)
- func (m *ManagerV16) GetConfigurationValue(key Key) (*string, error)
- func (m *ManagerV16) GetMandatoryKeys() []Key
- func (m *ManagerV16) OnUpdateKey(key Key, handler OnUpdateHandler) error
- func (m *ManagerV16) RegisterCustomKeyValidator(validator KeyValidator)
- func (m *ManagerV16) SetConfiguration(configuration Config) error
- func (m *ManagerV16) SetMandatoryKeys(mandatoryKeys []Key) error
- func (m *ManagerV16) UpdateKey(key Key, value *string) error
- func (m *ManagerV16) ValidateKey(key Key, value *string) error
- type OnUpdateHandler
Constants ¶
const ( AllowOfflineTxForUnknownId = Key("AllowOfflineTxForUnknownId") AuthorizationCacheEnabled = Key("AuthorizationCacheEnabled") AuthorizeRemoteTxRequests = Key("AuthorizeRemoteTxRequests") BlinkRepeat = Key("BlinkRepeat") ClockAlignedDataInterval = Key("ClockAlignedDataInterval") ConnectionTimeOut = Key("ConnectionTimeOut") GetConfigurationMaxKeys = Key("GetConfigurationMaxKeys") HeartbeatInterval = Key("HeartbeatInterval") LightIntensity = Key("LightIntensity") LocalAuthorizeOffline = Key("LocalAuthorizeOffline") LocalPreAuthorize = Key("LocalPreAuthorize") MaxEnergyOnInvalidId = Key("MaxEnergyOnInvalidId") MeterValuesAlignedData = Key("MeterValuesAlignedData") MeterValuesAlignedDataMaxLength = Key("MeterValuesAlignedDataMaxLength") MeterValuesSampledData = Key("MeterValuesSampledData") MeterValuesSampledDataMaxLength = Key("MeterValuesSampledDataMaxLength") MeterValueSampleInterval = Key("MeterValueSampleInterval") MinimumStatusDuration = Key("MinimumStatusDuration") NumberOfConnectors = Key("NumberOfConnectors") ResetRetries = Key("ResetRetries") ConnectorPhaseRotation = Key("ConnectorPhaseRotation") ConnectorPhaseRotationMaxLength = Key("ConnectorPhaseRotationMaxLength") StopTransactionOnEVSideDisconnect = Key("StopTransactionOnEVSideDisconnect") StopTransactionOnInvalidId = Key("StopTransactionOnInvalidId") StopTxnAlignedData = Key("StopTxnAlignedData") StopTxnAlignedDataMaxLength = Key("StopTxnAlignedDataMaxLength") StopTxnSampledData = Key("StopTxnSampledData") StopTxnSampledDataMaxLength = Key("StopTxnSampledDataMaxLength") SupportedFeatureProfiles = Key("SupportedFeatureProfiles") SupportedFeatureProfilesMaxLength = Key("SupportedFeatureProfilesMaxLength") TransactionMessageAttempts = Key("TransactionMessageAttempts") TransactionMessageRetryInterval = Key("TransactionMessageRetryInterval") UnlockConnectorOnEVSideDisconnect = Key("UnlockConnectorOnEVSideDisconnect") WebSocketPingInterval = Key("WebSocketPingInterval") LocalAuthListEnabled = Key("LocalAuthListEnabled") LocalAuthListMaxLength = Key("LocalAuthListMaxLength") SendLocalListMaxLength = Key("SendLocalListMaxLength") ReserveConnectorZeroSupported = Key("ReserveConnectorZeroSupported") SupportedFileTransferProtocols = Key("SupportedFileTransferProtocols") ChargeProfileMaxStackLevel = Key("ChargeProfileMaxStackLevel") ChargingScheduleAllowedChargingRateUnit = Key("ChargingScheduleAllowedChargingRateUnit") ChargingScheduleMaxPeriods = Key("ChargingScheduleMaxPeriods") MaxChargingProfilesInstalled = Key("MaxChargingProfilesInstalled") ConnectorSwitch3to1PhaseSupported = Key("ConnectorSwitch3to1PhaseSupported") /* ----------------- ISO15118 keys ----------------------- */ CentralContractValidationAllowed = Key("CentralContractValidationAllowed") CertificateSignedMaxChainSize = Key("CertificateSignedMaxChainSize") CertSigningWaitMinimum = Key("CertSigningWaitMinimum") CertSigningRepeatTimes = Key("CertSigningRepeatTimes") CertificateStoreMaxLength = Key("CertificateStoreMaxLength") ContractValidationOffline = Key("ContractValidationOffline") ISO15118PnCEnabled = Key("ISO15118PnCEnabled") /* ----------------- Security extension keys ----------------------- */ AuthorizationData = Key("AuthorizationData") AdditionalRootCertificateCheck = Key("AdditionalRootCertificateCheck") CpoName = Key("CpoName") SecurityProfile = Key("SecurityProfile") )
Variables ¶
var ( ErrKeyNotFound = errors.New("key not found") ErrReadOnly = errors.New("attribute is read-only") )
var ( MandatoryCoreKeys = []Key{ AuthorizeRemoteTxRequests, ClockAlignedDataInterval, ConnectionTimeOut, GetConfigurationMaxKeys, HeartbeatInterval, LocalPreAuthorize, MeterValuesAlignedData, MeterValuesSampledData, MeterValueSampleInterval, NumberOfConnectors, ResetRetries, ConnectorPhaseRotation, StopTransactionOnEVSideDisconnect, StopTransactionOnInvalidId, StopTxnAlignedData, StopTxnSampledData, SupportedFeatureProfiles, TransactionMessageAttempts, TransactionMessageRetryInterval, UnlockConnectorOnEVSideDisconnect, } MandatoryLocalAuthKeys = []Key{ LocalAuthListEnabled, LocalAuthListMaxLength, SendLocalListMaxLength, } MandatorySmartChargingKeys = []Key{ MaxChargingProfilesInstalled, ChargingScheduleMaxPeriods, ChargingScheduleAllowedChargingRateUnit, ChargeProfileMaxStackLevel, } MandatoryFirmwareKeys = []Key{ SupportedFileTransferProtocols, } MandatoryISO15118Keys = []Key{ ISO15118PnCEnabled, ContractValidationOffline, } )
var ErrKeyCannotBeEmpty = errors.New("key cannot be empty")
Functions ¶
func DefaultCoreConfiguration ¶
func DefaultCoreConfiguration() []core.ConfigurationKey
func DefaultFirmwareConfiguration ¶
func DefaultFirmwareConfiguration() []core.ConfigurationKey
func DefaultLocalAuthConfiguration ¶
func DefaultLocalAuthConfiguration() []core.ConfigurationKey
func DefaultSmartChargingConfiguration ¶
func DefaultSmartChargingConfiguration() []core.ConfigurationKey
Types ¶
type Config ¶
type Config struct { Version int `fig:"version" default:"1"` Keys []core.ConfigurationKey `fig:"keys"` }
func NewEmptyConfiguration ¶
func NewEmptyConfiguration() Config
func (*Config) GetConfig ¶
func (config *Config) GetConfig() []core.ConfigurationKey
GetConfig Get the configuration
func (*Config) GetConfigurationValue ¶
GetConfigurationValue Get the value of specified configuration variable in String format.
func (*Config) GetVersion ¶
GetVersion Get the current version
func (*Config) SetVersion ¶
SetVersion Set the current version
func (*Config) UpdateKey ¶
UpdateKey Update the configuration variable in the configuration if it is not readonly.
func (*Config) UpdateKeyReadability ¶
UpdateKeyReadability updates whether the key is updatable or not.
type KeyValidator ¶
type Manager ¶
type Manager interface { SetMandatoryKeys(mandatoryKeys []Key) error GetMandatoryKeys() []Key RegisterCustomKeyValidator(KeyValidator) ValidateKey(key Key, value *string) error UpdateKey(key Key, value *string) error OnUpdateKey(key Key, handler OnUpdateHandler) error GetConfigurationValue(key Key) (*string, error) SetConfiguration(configuration Config) error GetConfiguration() ([]core.ConfigurationKey, error) }
type ManagerV16 ¶
type ManagerV16 struct {
// contains filtered or unexported fields
}
func NewV16ConfigurationManager ¶
func NewV16ConfigurationManager(defaultConfiguration Config, profiles ...string) (*ManagerV16, error)
func (*ManagerV16) GetConfiguration ¶
func (m *ManagerV16) GetConfiguration() ([]core.ConfigurationKey, error)
GetConfiguration returns the full current configuration
func (*ManagerV16) GetConfigurationValue ¶
func (m *ManagerV16) GetConfigurationValue(key Key) (*string, error)
GetConfigurationValue returns the value of a specific key
func (*ManagerV16) GetMandatoryKeys ¶
func (m *ManagerV16) GetMandatoryKeys() []Key
GetMandatoryKeys returns the mandatory keys for the configuration
func (*ManagerV16) OnUpdateKey ¶
func (m *ManagerV16) OnUpdateKey(key Key, handler OnUpdateHandler) error
OnUpdateKey registers a function to call after a specific key has been updated.
func (*ManagerV16) RegisterCustomKeyValidator ¶
func (m *ManagerV16) RegisterCustomKeyValidator(validator KeyValidator)
RegisterCustomKeyValidator registers a custom key validator
func (*ManagerV16) SetConfiguration ¶
func (m *ManagerV16) SetConfiguration(configuration Config) error
SetConfiguration validates the provided and overwrites the current configuration
func (*ManagerV16) SetMandatoryKeys ¶
func (m *ManagerV16) SetMandatoryKeys(mandatoryKeys []Key) error
SetMandatoryKeys sets the mandatory keys for the configuration
func (*ManagerV16) UpdateKey ¶
func (m *ManagerV16) UpdateKey(key Key, value *string) error
UpdateKey updates the value of a specific key
func (*ManagerV16) ValidateKey ¶
func (m *ManagerV16) ValidateKey(key Key, value *string) error
ValidateKey validates a specific key by checking if there is a custom validator registered