Nenhuma descrição

dcsunny 8dec1e86df update 2 anos atrás
cmd 50afa32118 update 3 anos atrás
configs 8e3a5a259a init 3 anos atrás
internal 72b0d13bf4 更新包,并将gpc客户端变成默认生成 2 anos atrás
.gitignore 8e3a5a259a init 3 anos atrás
Dockerfile b01953d399 update 3 anos atrás
LICENSE 8e3a5a259a init 3 anos atrás
Makefile 8e3a5a259a init 3 anos atrás
README.md 8e3a5a259a init 3 anos atrás
build.sh 8e3a5a259a init 3 anos atrás
generate.go af7fbe835a init 3 anos atrás
go.mod 8dec1e86df update 2 anos atrás
go.sum 8dec1e86df update 2 anos atrás
start.sh 8e3a5a259a init 3 anos atrás

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