Keine Beschreibung

dcsunny 2226bd164f 移除namespace的默认值 vor 4 Jahren
api f9e99750fc 调整项目生成的模板 vor 4 Jahren
cmd 2226bd164f 移除namespace的默认值 vor 4 Jahren
configs 478127fa4e init vor 4 Jahren
internal f9e99750fc 调整项目生成的模板 vor 4 Jahren
.gitignore 478127fa4e init vor 4 Jahren
Dockerfile bbd4113cf0 新增docker vor 4 Jahren
LICENSE 478127fa4e init vor 4 Jahren
Makefile f9e99750fc 调整项目生成的模板 vor 4 Jahren
README.md 478127fa4e init vor 4 Jahren
build.sh 139e3c081f 更新构建包 vor 4 Jahren
generate.go 478127fa4e init vor 4 Jahren
go.mod 05527f0e0c 更新kratos vor 4 Jahren
go.sum 05527f0e0c 更新kratos vor 4 Jahren
start.sh 478127fa4e init vor 4 Jahren

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