Floqex API
Config
.env 配置文件
cp .env.example .env
快速启动
- 编写配置文件
# cp .env.example .env
vi .env
- 启动服务
go build -o server main.go && ./server
# 或者
air
开发相关
# install protoc plugin
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
# protobuf -> go
protoc -I . --go_out=./app/rpc/pb/{service_path}/{service_name} --go_opt=module="github.com/allotroper/floqex/api/app/rpc/pb/{service_path}/{service_name}" --go-grpc_out=./app/rpc/pb/{service_path}/{service_name} --go-grpc_opt=module="github.com/allotroper/floqex/api/app/rpc/pb/{service_path}/{service_name}" ./protobuf/{service_path}/{service_name}_service.proto
# Cache
go run main.go cache
go run main.go cache clear
go run main.go cache forget {key}
# Generate Id
go run main.go id snowflake
# Generate Key
go run main.go key
# Run Seed
go run main.go seed
# Migrate
go run main.go migrate up
go run main.go migrate down
go run main.go migrate reset
go run main.go migrate rollback
go run main.go migrate refresh
go run main.go migrate fresh
# Make Migration
go run main.go make migration {opt}_{tablename}_table
# Make Command
go run main.go make command {opt}
# Make Controller
go run main.go make controller {path}/{name}Controller
# Make Factory
go run main.go make factory {name}
# Make Model
go run main.go make model {tablename} # Table name is singular
# Make Policy
go run main.go make policy {policyname}
# Make Request
go run main.go make request {path}/{name}Request
# Make Seed
go run main.go make seeder {seedername}