Compare commits
	
		
			5 Commits
		
	
	
		
			v0.1.1
			...
			d875bbb2f7
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d875bbb2f7 | |||
| b1102825fe | |||
| 0b1826951e | |||
| f080034fa4 | |||
| 2de398032c | 
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							@@ -3,6 +3,7 @@
 | 
			
		||||
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)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							@@ -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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								TODO.md
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								TODO.md
									
									
									
									
									
								
							@@ -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
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								go.mod
									
									
									
									
									
								
							@@ -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
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.sum
									
									
									
									
									
								
							@@ -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=
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user