tk cash game v4
Go to file
pengyinjie 8ebb876bc5 init 2025-10-22 18:01:11 +08:00
.tmpl init 2025-10-22 18:01:11 +08:00
api/eonline init 2025-10-22 18:01:11 +08:00
app/eonline init 2025-10-22 18:01:11 +08:00
pkg init 2025-10-22 18:01:11 +08:00
third_party init 2025-10-22 18:01:11 +08:00
wai init 2025-10-22 18:01:11 +08:00
.gitignore init 2025-10-22 18:01:11 +08:00
Dockerfile init 2025-10-22 18:01:11 +08:00
LICENSE init 2025-10-22 18:01:11 +08:00
Makefile init 2025-10-22 18:01:11 +08:00
README.md init 2025-10-22 18:01:11 +08:00
Supfile init 2025-10-22 18:01:11 +08:00
app_makefile init 2025-10-22 18:01:11 +08:00
build_docker.sh init 2025-10-22 18:01:11 +08:00
create_app.sh init 2025-10-22 18:01:11 +08:00
deploy_link.sh init 2025-10-22 18:01:11 +08:00
eonline.sql init 2025-10-22 18:01:11 +08:00
go.mod init 2025-10-22 18:01:11 +08:00
go.sum init 2025-10-22 18:01:11 +08:00
openapi.yaml init 2025-10-22 18:01:11 +08:00
readme.txt init 2025-10-22 18:01:11 +08:00

README.md

Kratos Project Template

Install Kratos

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

Install deps

make init

Create app

./create_app.sh

Create a 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

Generate other auxiliary files by Makefile

# Download and update dependencies
make init
# Generate API swagger json files by proto file
make swagger
# Generate API files (include: pb.go, http, grpc, validate, swagger) by proto file
make api
# Generate all files
make all

Automated Initialization (wire)

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

# generate wire
cd cmd/server
wire

Docker

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

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