# Walnut **Repository Path**: go2work/walnut ## Basic Information - **Project Name**: Walnut - **Description**: Go语言项目模板 - **Primary Language**: Go - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-18 - **Last Updated**: 2025-08-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 前言 这是一个golang语言项目模板。 # 安装 ## 源码安装 编译当前系统执行程序 ```bash ./bin/build.sh ``` ## 部署安装 初始化环境 ```bash ./bin/init.sh user@host ``` 完成初始化之后,执行部署脚本 ```bash ./bin/deploy.sh user@host ``` # 使用 ## 启动服务 ```bash ./walnut.exe -c config.json ``` ## 查看版本信息 ```bash ./walnut.exe -v ``` # 配置文件模板 ```json { "mode": "debug", "bind": "0.0.0.0", "port": 8090, "read-header-timeout": 20, "write-timeout": 20, "max-header-bytes": 1, "forwarded-by-client-ip": true, "trusted-proxies": [ "127.0.0.1" ], "mysql": { "host": "127.0.0.1", "port": 3306, "user": "root", "pass": "123456", "name": "walnut", "charset": "utf8mb4", "max-idle-conns": 50, "max-open-conns": 50, "skip-initialize-with-version": false, "default-string-size": 191 }, "log": { "prefix": "[walnut]", "level": "debug", "encoding": "console", "caller": true, "stack-trace": true, "time-format": "2006-01-02T15:04:05Z07:00", "console-separator": " ", "enable-file": true, "file-config": { "max-age": 28, "max-size": 500, "max-backups": 3, "compress": true, "output-paths": [ "./logs/walnut.log" ], "error-output-paths": [ "./logs/walnut-error.log" ] } }, "jwt": { "key-name": "token", "secret-key": "123456", "ttl": 24, "issuer": "walnut" } } ```