Categorygithub.com/xBlaz3kx/ocppManager-go
modulepackage
0.2.0
Repository: https://github.com/xblaz3kx/ocppmanager-go.git
Documentation: pkg.go.dev

# README

🔌 ocppManager-go

A library for dynamically managing OCPP configuration (variables). It can read, update, and validate OCPP variables. Currently, only mandatory key validation is implemented. Value validation will be implemented in the near future.

âš¡ Usage

Check out the full example. It also contains a sample configuration file.


package main

import (
	log "github.com/sirupsen/logrus"
	manager "github.com/xBlaz3kx/ocppManager-go"
	v16 "github.com/xBlaz3kx/ocppManager-go/configuration"
)

func main() {
	log.SetLevel(log.DebugLevel)

	manager.SetFilePath("./configuration.json")

	// Load configuration from file
	err := manager.LoadConfiguration()
	if err != nil {
		log.Fatalf("Error loading configuration: %v", err)
	}

	// Get value
	value, err := manager.GetConfigurationValue(v16.AuthorizationCacheEnabled.String())
	if err != nil {
		log.Errorf("Error getting configuration value: %v", err)
		return
	}

	log.Println(value)

	// Update key
	val := "false"
	err = manager.UpdateKey(v16.AuthorizationCacheEnabled.String(), &val)
	if err != nil {
		log.Errorf("Error updating key: %v", err)
		return
	}

	// Update file
	err = manager.UpdateConfigurationFile()
	if err != nil {
		log.Errorf("Error updating configuration file: %v", err)
	}
}

# Packages

No description provided by the author
No description provided by the author

# Functions

GetConfiguration Get the global configuration.
GetConfigurationValue Get the value of specified configuration variable from the global configuration in String format.
No description provided by the author
LoadConfiguration load OCPP configuration from the file.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UpdateConfigurationFile Write/Rewrite the configuration to the file.
UpdateKey Update the configuration variable in the global configuration if it is not readonly.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author