暫無描述

dcsunny 52078aa2b2 feat: 引用protobuf,更新go.mod相关包 1 年之前
cmd 50afa32118 update 3 年之前
configs 8e3a5a259a init 3 年之前
internal 52078aa2b2 feat: 引用protobuf,更新go.mod相关包 1 年之前
.gitignore 8e3a5a259a init 3 年之前
Dockerfile b01953d399 update 3 年之前
LICENSE 8e3a5a259a init 3 年之前
Makefile 8e3a5a259a init 3 年之前
README.md 8e3a5a259a init 3 年之前
build.sh 8e3a5a259a init 3 年之前
generate.go af7fbe835a init 3 年之前
go.mod 52078aa2b2 feat: 引用protobuf,更新go.mod相关包 1 年之前
go.sum 52078aa2b2 feat: 引用protobuf,更新go.mod相关包 1 年之前
start.sh 8e3a5a259a init 3 年之前

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