Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

6 changed files with 7 additions and 30 deletions

View File

@ -1,9 +1,8 @@
.PHONY: all test build docker install clean proto check_protoc .PHONY: all test build docker install clean proto check_protoc
CMD_NAME := go-server-with-otel CMD_NAME := demo-app
VERSION ?= development VERSION ?= development
API_DIR := api/ API_DIR := api/
SCHEMA_DIR := contrib/
PROTO_DIRS := $(wildcard proto/demo/app/*) # TODO: Update path (probably not demo) PROTO_DIRS := $(wildcard proto/demo/app/*) # TODO: Update path (probably not demo)
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
OUTPUT_DIR := bin OUTPUT_DIR := bin
@ -17,9 +16,7 @@ proto: check_protoc $(API_DIR)
--go_out=$(API_DIR) --go_opt=paths=source_relative \ --go_out=$(API_DIR) --go_opt=paths=source_relative \
--go-grpc_out=$(API_DIR) --go-grpc_opt=paths=source_relative \ --go-grpc_out=$(API_DIR) --go-grpc_opt=paths=source_relative \
--grpc-gateway_out=$(API_DIR) --grpc-gateway_opt=paths=source_relative \ --grpc-gateway_out=$(API_DIR) --grpc-gateway_opt=paths=source_relative \
--openapiv2_out=$(SCHEMA_DIR) \ --openapiv2_out=$(API_DIR) \
--openapiv2_opt allow_merge=true \
--openapiv2_opt merge_file_name=$(CMD_NAME) \
$(foreach dir, $(PROTO_DIRS), $(wildcard $(dir)/*.proto)) $(foreach dir, $(PROTO_DIRS), $(wildcard $(dir)/*.proto))
test: test:
@ -46,7 +43,6 @@ docker:
docker build \ docker build \
--build-arg VER_PKG=$(VER_PKG) \ --build-arg VER_PKG=$(VER_PKG) \
--build-arg VERSION=$(VERSION) \ --build-arg VERSION=$(VERSION) \
--build-arg APP_NAME=$(CMD_NAME) \
-t $(GIT_REPO):$(VERSION) . -t $(GIT_REPO):$(VERSION) .
docker push $(GIT_REPO):$(VERSION) docker push $(GIT_REPO):$(VERSION)

View File

@ -25,39 +25,32 @@ Check out the [go-app framework](https://gitea.libretechconsulting.com/rmcguire/
## 📚 Getting Started ## 📚 Getting Started
1. Install tools:
- Install make, protoc, and go using brew, apt, etc..
- Install protoc plugins (provided in go.mod tool()):
- `go get -v tool && go install -v tool`
1. **Rename your package:** 1. **Rename your package:**
```sh ```sh
make rename NAME=my.gitremote.com/pathto/repo make rename NAME=my.gitremote.com/pathto/repo
``` ```
1. **Review the config struct:** 2. **Review the config struct:**
Update and customize your app-specific configuration. This merges with go-app's configuration, providing logging, HTTP, and GRPC config for free. Update and customize your app-specific configuration. This merges with go-app's configuration, providing logging, HTTP, and GRPC config for free.
1. **Generate a new JSON schema:** 3. **Generate a new JSON schema:**
```sh ```sh
make schema make schema
``` ```
- Ensure your structs have `yaml` and `json` tags. - Ensure your structs have `yaml` and `json` tags.
- With the `yaml-language-server` LSP plugin, the schema will be auto-detected in your `config.yaml`. - With the `yaml-language-server` LSP plugin, the schema will be auto-detected in your `config.yaml`.
1. **Compile proto files:** 4. **Compile proto files:**
```sh ```sh
make proto make proto
``` ```
- Add paths under `proto/` as necessary. - Add paths under `proto/` as necessary.
1. **Implement your application logic.** 5. **Implement your application logic.**
1. **Update Gitea CI configuration:** 6. **Update Gitea CI configuration:**
Modify parameters in `.gitea/workflows/ci.yaml` as needed. Modify parameters in `.gitea/workflows/ci.yaml` as needed.
1. Tag your release: `git tag v0.1.0` and push `git push --tags`
--- ---
## 📂 Project Structure ## 📂 Project Structure

View File

@ -1,7 +1,5 @@
# Demo app TODO # Demo app TODO
- [ ] Update README for tagging/versioning/pipeline info
- [x] Update README for detail on installing protoc tools and make
- [x] Rename project - [x] Rename project
- [x] Finish grpc sample implementation - [x] Finish grpc sample implementation
- [x] Add Dockerfile - [x] Add Dockerfile

8
go.mod
View File

@ -55,12 +55,4 @@ require (
golang.org/x/net v0.38.0 // indirect golang.org/x/net v0.38.0 // indirect
golang.org/x/text v0.23.0 // indirect golang.org/x/text v0.23.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 // indirect
)
tool (
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
google.golang.org/grpc/cmd/protoc-gen-go-grpc
google.golang.org/protobuf/cmd/protoc-gen-go
) )

2
go.sum
View File

@ -134,8 +134,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=