설명 없음

dcsunny b9a0be791c 将name改成小写 4 년 전
api f9e99750fc 调整项目生成的模板 4 년 전
cmd 7d66ecbb1f 更新kratosv2.1.1 4 년 전
configs 478127fa4e init 4 년 전
internal 7d66ecbb1f 更新kratosv2.1.1 4 년 전
.gitignore 478127fa4e init 4 년 전
Dockerfile bbd4113cf0 新增docker 4 년 전
LICENSE 478127fa4e init 4 년 전
Makefile b9a0be791c 将name改成小写 4 년 전
README.md 478127fa4e init 4 년 전
build.sh b9a0be791c 将name改成小写 4 년 전
generate.go 478127fa4e init 4 년 전
go.mod 7d66ecbb1f 更新kratosv2.1.1 4 년 전
go.sum 7d66ecbb1f 更新kratosv2.1.1 4 년 전
start.sh 478127fa4e init 4 년 전

README.md

Kratos Project Template

Install Kratos

go get -u github.com/go-kratos/kratos/cmd/kratos/v2@latest

Create a service

# create a template project
kratos new helloworld

cd helloworld
# Add a proto template
kratos proto add api/helloworld/helloworld.proto
# Generate the source code of service by proto file
kratos proto server api/helloworld/helloworld.proto -t internal/service

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

Automated Initialization (wire)

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

# generate wire
cd cmd/server
wire