pet-store-grpc

module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: MIT

README

Pet Store

PetStore is a sample project for INFI backend Golang project generator.

Directory structure


├── cmd                           # Main applications for this project
|   ├── cli                       # Command Line code directory
|   ├── grpc                      # The entry point of gRPC application (grpc mode)
|   ├── main.go                   # The entry point of web application
├── conf                          # The configuration directory
├── deployments                   # The deployment file directory
├── examples                      # The example for gRPC call
├── grpc                          # Contains the gRPC client and proto file (grpc mode)
├── internal                      # Private application and library code
|   ├── domain                    # Business logic code directory
|   ├── webapi                    # WebAPI code directory (webapi mode)
|   ├── grpc                      # gRPC Stub implementation code directory (grpc mode)
├── schema                        # The database schema directory
├── test                          # The web api integration test code directory
├── .air.toml                     # Live loading config file
├── .gitignore                    # Git ignore file
├── CHANGELOG                     # Change log
├── docker-entrypoint.sh          # The entry point shell script for the application running in container
├── Dockerfile                    # Docker build file
├── go.mod                        # Golang module package dependencies file
├── go.sum                        # Golang module package dependencies sum file
├── LICENSE                       # License file
├── Makefile                      # Make file
└── README.md                     # The top level README for developers using this project

Live-reloading

go install github.com/cosmtrek/air@latest

gRPC Tools

Protocol Buffer Compiler Installation
brew install protobuf
Go plugins for the protocol compiler Installation
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Generate gRPC code
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto

Deployments

Kubectl Config

kubectl config get-contexts
kubectl config use-context <CONTEXT_NAME>
kubectl config set-context --current --namespace=<dev|prod|staging>

Scripts of Development


make help                    # Print help

make test                    # Unit test

make run                     # Runs the app in development mode on local

make live                    # Live reloading

make compile                 # Compile TypesScript to JavaScript

make build [tag=<tagname>]   # Build container image with tag. the default tag is latest

make push [tag=<tagname>]    # Push container image to Google Artifact Regstry. the default tag is latest

Dependencies

Directories

Path Synopsis
cmd
cli
examples
internal
pkg
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL