Implement reflection and list facets

This commit is contained in:
2024-11-26 10:54:55 -05:00
parent cba9c76a83
commit b97b24d394
9 changed files with 195 additions and 82 deletions

View File

@ -1,5 +1,7 @@
# Variables
CLIENT_PKG := ./cmd/eia-client
CLIENT_GEN_FILE := ./api/eiaapi.gen.go
GO_FORMATTER := gofumpt
.PHONY: all generate build install clean
@ -9,6 +11,11 @@ all: generate build
# Generate code
generate:
go generate ./...
# Fix errors in generated code
sed -E -i '' 's/Total[[:space:]]+\*int/Total *string/g' $(CLIENT_GEN_FILE)
sed -E -i '' 's/Command[[:space:]]+\*\[\]string/Command *string/g' $(CLIENT_GEN_FILE)
# Pretty it up
$(GO_FORMATTER) -w $(CLIENT_GEN_FILE)
# Build the client command binary
build: generate
@ -16,7 +23,7 @@ build: generate
# Install the client command binary
install: generate
go install $(CLIENT_PKG)
go install -v $(CLIENT_PKG)
# Clean up generated files and build artifacts
clean: