Compare commits

...

6 Commits
v0.1.0 ... main

Author SHA1 Message Date
d875bbb2f7 use docker app_name arg
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 9s
Build and Publish / helm-release (push) Has been skipped
2025-04-04 15:42:05 -04:00
b1102825fe add tools and update readme/todo
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 11s
Build and Publish / helm-release (push) Has been skipped
2025-04-01 09:10:43 -04:00
0b1826951e merge and produce swagger in contrib/
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 10s
Build and Publish / helm-release (push) Has been skipped
2025-04-01 08:53:29 -04:00
f080034fa4 update TODO 2025-03-31 16:52:31 -04:00
2de398032c update TODO
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 9s
Build and Publish / helm-release (push) Has been skipped
2025-03-31 16:50:45 -04:00
6374aabd64 fix package name
All checks were successful
Build and Publish / check-chart (push) Successful in 13s
Build and Publish / helm-release (push) Has been skipped
Build and Publish / release (push) Successful in 4m28s
2025-03-31 16:40:20 -04:00
6 changed files with 30 additions and 7 deletions

View File

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

View File

@ -25,32 +25,39 @@ Check out the [go-app framework](https://gitea.libretechconsulting.com/rmcguire/
## 📚 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:**
```sh
make rename NAME=my.gitremote.com/pathto/repo
```
2. **Review the config struct:**
1. **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.
3. **Generate a new JSON schema:**
1. **Generate a new JSON schema:**
```sh
make schema
```
- 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`.
4. **Compile proto files:**
1. **Compile proto files:**
```sh
make proto
```
- Add paths under `proto/` as necessary.
5. **Implement your application logic.**
1. **Implement your application logic.**
6. **Update Gitea CI configuration:**
1. **Update Gitea CI configuration:**
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

View File

@ -1,5 +1,7 @@
# 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] Finish grpc sample implementation
- [x] Add Dockerfile

8
go.mod
View File

@ -55,4 +55,12 @@ require (
golang.org/x/net v0.38.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/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,6 +134,8 @@ 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/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
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/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=