上一页 1 2 3 4 5 6 7 8 ··· 22 下一页
摘要: 创建docker网络 docker network create redis-cluster 列表展示所有docker网络 docker network ls 清理无用网络 docker network prune 删除指定网络 docker network rm redis-cluster 查看某 阅读全文
posted @ 2025-03-24 23:31 Ashe|||^_^ 阅读(18) 评论(0) 推荐(0)
摘要: 下载 https://github.com/docker/compose/releases 服务器下载很慢,建议本地下载,然后通过FileZilla上传至服务器 mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose chmod +x 阅读全文
posted @ 2025-03-23 18:21 Ashe|||^_^ 阅读(18) 评论(0) 推荐(0)
摘要: 前提是当前系统具备Docker环境 # 在项目根路径下,根据Dockerfile构建一个Docker镜像 docker build -t mygolang-app . # 如果你的服务器上运行了 Docker Registry,可以用 docker tag 和 docker push 直接推送到私有 阅读全文
posted @ 2025-03-23 13:44 Ashe|||^_^ 阅读(6) 评论(0) 推荐(0)
摘要: go mod init gin_beta 初始化go mod,Goland在创建project时会默认已完成 go get -u github.com/gin-gonic/gin go get -u github.com/labstack/echo/v4 引入gin依赖 go mod tidy 移除 阅读全文
posted @ 2025-03-22 20:42 Ashe|||^_^ 阅读(29) 评论(0) 推荐(0)
摘要: 对于系统范围内的全局配置,应该编辑 /etc/profile 或 /etc/bashrc。 对于特定用户的配置,应该编辑该用户的 ~/.bash_profile 或 ~/.bashrc。 在实际操作中,运维人员可能更倾向于使用 /etc/profile.d/ 目录来放置特定的环境变量配置脚本,这样可 阅读全文
posted @ 2025-03-22 19:01 Ashe|||^_^ 阅读(12) 评论(0) 推荐(0)
摘要: 打开命令提示符(cmd)或 PowerShell。 $env:GOOS = "linux" $env:GOARCH = "amd64" cd C:\workspace\golang\gin_alpha\cmd\ dir go build -o myapp-linux 然后将生成的Linux可执行文件 阅读全文
posted @ 2025-03-20 23:18 Ashe|||^_^ 阅读(784) 评论(0) 推荐(0)
摘要: Snowflake(雪花算法): 适用场景:小型微服务架构 特点:Snowflake算法由Twitter开发,能够生成64位的唯一ID,由时间戳、数据中心ID、机器ID和序列号组成。它不依赖于外部系统,可以在本地生成ID,因此适用于小型或中等规模的微服务架构,特别是在对ID生成性能要求不是极端高的情 阅读全文
posted @ 2025-03-15 22:07 Ashe|||^_^ 阅读(24) 评论(0) 推荐(0)
摘要: /your_project │── /api │ ├── api.go # API 路由管理 │── /cmd │ └── main.go # 入口 │── /configs │ ├── config.go # 读取配置 │ ├── config.yaml # 配置文件 │ ├── config_t 阅读全文
posted @ 2025-03-15 18:30 Ashe|||^_^ 阅读(67) 评论(0) 推荐(0)
摘要: EXPLAIN in MySQL is a powerful tool used to analyze and understand how MySQL executes a particular query. Here’s what EXPLAIN can do: Display the quer 阅读全文
posted @ 2025-03-14 18:55 Ashe|||^_^ 阅读(16) 评论(0) 推荐(0)
摘要: Before we embark on our journey through the world of pointers in Go, we must fist grasp the significance of the & operator. func main() { var i int = 阅读全文
posted @ 2025-02-28 17:12 Ashe|||^_^ 阅读(10) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 22 下一页