Skip to content

kelein/git

Repository files navigation

Project Template

Go Helm GitHub Build

Install Binary

go install github.com/go-kratos/kratos/cmd/kratos/v2@latest

Create Service

# Create a template project
kratos new server
cd server

# Add a proto template
kratos proto add api/server/server.proto

# Generate the proto code
kratos proto client api/server/server.proto

# Generate the source code of service by proto file
kratos proto server api/server/server.proto -t internal/service

go generate ./...
go build -o ./bin/ ./...
./bin/server -conf ./configs

Makefile Generate

make

Usage:
 make [target]

Targets:
init:           init env
config:         generate proto
api:            generate api proto
build:          build binary
generate:       generate
all:            generate all
help:           show help

Automate Initial

# install wire
go get github.com/google/wire/cmd/wire

# generate wire
cd cmd/server
wire

Docker Image

# build
docker build -t <your-docker-image-name> .

# run
docker run --rm -p 8000:8000 -p 9000:9000 -v </path/to/configs>:/data/conf <image-name>

About

Github Template Repository for Common Project - within CI/CD Actions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •