-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28dcbce
commit 3e8e8b4
Showing
29 changed files
with
382 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,3 @@ bin/ | |
output*.* | ||
out*.* | ||
out.txt | ||
|
||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,7 @@ builds: | |
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
main: ./cmd/gogoodwe | ||
- darwin | ||
|
||
archives: | ||
- format: tar.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,4 @@ | ||
# GoGoodwe - CHANGELOG | ||
|
||
## v2.0.0 (2024-01-22) | ||
|
||
- Major refactoring to cleanup project structure | ||
- Simplified package structure | ||
|
||
## v1.4.0 (2023-08-30) | ||
|
||
- Major refactoring to move non-shared code to /internal folder | ||
- Abstracted core away from main() | ||
|
||
## v1.1.0 (2023-08-16) | ||
|
||
- refactored code to make errors bubble back to main package and better error reporting/logging | ||
- refactored main package to include run() method | ||
- removed staticcheck as there is a bug with Go v1.21 | ||
# CHANGELOG | ||
|
||
## v1.0.0 (2023-08-10) | ||
|
||
- initial version 1.0 release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,68 @@ | ||
# Define Go command and flags | ||
GO = go | ||
GOFLAGS = -ldflags="-s -w" | ||
TARGET = gogoodwe | ||
MAINAPPPATH = ./main.go | ||
|
||
default: help | ||
#export PATH=$PATH:$HOME/go/bin; | ||
|
||
# Define the target executable | ||
TARGET = gogoodwe | ||
|
||
.PHONY: help | ||
## help - Display help about make targets for this Makefile | ||
help: | ||
@cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t | ||
|
||
|
||
.PHONY: release | ||
## release - Builds the project in preparation for (local)release | ||
release: vet lint seccheck | ||
go build $(GOFLAGS) -o bin/${TARGET} ${MAINAPPPATH} | ||
## localrelease - Builds the project in preparation for (local)release | ||
localrelease: | ||
go build $(GOFLAGS) -o bin/${TARGET} main.go | ||
file bin/${TARGET} | ||
|
||
|
||
.PHONY: goreleaser | ||
## goreleaser - Builds the project in preparation for release | ||
goreleaser: | ||
goreleaser release --snapshot --clean | ||
|
||
|
||
.PHONY: docs | ||
## docs - updates the swagger docs | ||
docs: | ||
swag init | ||
|
||
|
||
.PHONY: build | ||
## build - Builds the project in preparation for debug | ||
## release - Builds the project in preparation for release | ||
release: | ||
goreleaser release --snapshot --clean | ||
|
||
## debug - Builds the project in preparation for debug | ||
build: | ||
go build -o bin/${TARGET} ${MAINAPPPATH} | ||
go build -o bin/${TARGET} main.go | ||
file bin/${TARGET} | ||
|
||
## buildandrun - builds and runs the program on the target platform | ||
buildandrun: build | ||
./bin/${TARGET} | ||
|
||
.PHONY: run | ||
## run - builds and runs the program on the target platform | ||
run: | ||
go run ${MAINAPPPATH} | ||
## run - runs main.go for testing | ||
run: dep | ||
go run main.go | ||
|
||
|
||
.PHONY: clean | ||
## clean - Remove the old builds and any debug information | ||
clean: | ||
go clean | ||
rm -rf dist | ||
rm bin/${TARGET} | ||
|
||
|
||
.PHONY: test | ||
## test - executes unit tests | ||
## test - executes unit test | ||
test: | ||
go test -v ./test/... | ||
go test ./... | ||
|
||
|
||
.PHONY: deps | ||
## deps - fetches any external dependencies and updates | ||
deps: | ||
## dep - fetches any external dependencies | ||
dep: | ||
go mod tidy | ||
go mod download | ||
go get -u ./... | ||
|
||
|
||
.PHONY: vet | ||
## vet - Vet examines Go source code and reports suspicious constructs | ||
vet: | ||
go vet ./... | ||
|
||
## staticcheck - Runs static code analyzer staticcheck | ||
staticcheck: | ||
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./... | ||
|
||
.PHONY: staticcheck | ||
## staticcheck - Runs static code analyzer staticcheck - currently broken | ||
staticcheck: | ||
staticcheck ./... | ||
|
||
|
||
.PHONY: seccheck | ||
## seccheck - Code vulnerability check | ||
seccheck: | ||
brew install govulncheck | ||
govulncheck ./... | ||
|
||
|
||
.PHONY: lint | ||
## lint - format code and tidy modules | ||
lint: | ||
go fmt ./... | ||
go mod tidy -v | ||
go mod tidy -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
# GoGoodwe V2 - TODO | ||
# gogoodwe TODO | ||
|
||
### ToDo | ||
GoGoodwe backlog | ||
|
||
- [ ] Add ability to output inverter data to a file. | ||
- [ ] Format the inverter output to make it more human readable. | ||
- [ ] Add the ability to query historical data for a single day. | ||
- [ ] Have the ability to have a realtime logging to the screen or to a file in 5 minute intervals. | ||
- [ ] Add the ability to produce a daily summary of key data (Generation today, Income today, total generation, total income). | ||
- [ ] Add the ability to query the inverter status for Generation today and Status (check if operational). | ||
- [ ] Add goroutines and wait groups for the API calls and maybe channels for success/failed API calls. | ||
- [ ] Add Cobra for command flag parsing and processing. | ||
- [ ] Investigate the ability to generate .CSV files as output. | ||
- [ ] | ||
### Todo | ||
|
||
### In Progress | ||
- [ ] Add ability to output to file with a flag | ||
- [ ] Add ability to have a smaller output struct of just key reporting data | ||
- [ ] Add Golang contexts for API calls | ||
|
||
- [ ] add unit tests | ||
### In Progress | ||
|
||
### Done ✓ | ||
|
||
- [ ] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
/* | ||
# Name: constants - shared constants | ||
# Author: Aaron Saikovski - [email protected] | ||
*/ | ||
|
||
package constants | ||
|
||
const ( | ||
// Auth Login Url | ||
AuthLoginUrl string = "https://www.semsportal.com/api/v2/Common/CrossLogin" | ||
AuthLoginUrL string = "https://www.semsportal.com/api/v2/Common/CrossLogin" | ||
|
||
// Powerstation API Url | ||
PowerStationURL string = "v2/PowerStation/GetMonitorDetailByPowerstationId" | ||
|
@@ -16,7 +11,7 @@ const ( | |
HTTPTimeout = 20 | ||
|
||
// Version string | ||
VersionString string = "gogoodwe v2.0.0" | ||
VersionString string = "gogoodwe v0.0.7" | ||
|
||
//API login success response message | ||
SemsLoginSuccessResponse string = "Successful" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.