This is a Golang implementation of the Joy of Energy project, which provides functionality for managing meter readings, calculating energy usage, and comparing price plans.
src/
: Source code for the applicationconfig/
: Configuration files for price plans and test datameters/
: Meter-related functionalitypricePlans/
: Price plan comparison logicreadings/
: Reading storage and retrievalusage/
: Usage calculation services
tests/
: Unit tests for each module
- Go 1.21 or higher
- Clone the repository
- Navigate to the project directory
- Run
go mod tidy
to download dependencies - Run the application with
go run src/app.go
Execute all tests with:
go test ./tests/...
- Meter Service: Manages meter creation and retrieval
- Reading Service: Stores and retrieves meter readings
- Price Plan Comparator: Calculates costs for different price plans
- Usage Service: Calculates total energy usage for a meter
The main application demonstrates:
- Creating meters
- Storing meter readings
- Calculating total usage
- Comparing price plans
[Add your license information here]